typedoc
- Version 0.27.6
- Published
- 1.92 MB
- 5 dependencies
- Apache-2.0 license
Install
npm i typedoc
yarn add typedoc
pnpm add typedoc
Overview
Create api documentation for TypeScript projects.
Index
Variables
Functions
Classes
Application
- bootstrap()
- bootstrapWithPlugins()
- convert()
- convertAndWatch()
- converter
- deserializer
- entryPoints
- entryPointStrategy
- EVENT_BOOTSTRAP_END
- EVENT_PROJECT_REVIVE
- EVENT_VALIDATE_PROJECT
- files
- generateDocs()
- generateJson()
- generateOutputs()
- getDefinedEntryPoints()
- getEntryPoints()
- getTypeScriptPath()
- getTypeScriptVersion()
- i18n
- internationalization
- lang
- logger
- options
- outputs
- renderer
- serializer
- skipErrorChecking
- toString()
- validate()
- VERSION
Comment
- blockTags
- clone()
- cloneDisplayParts()
- combineDisplayParts()
- deserializeDisplayParts()
- fromObject()
- getIdentifiedTag()
- getShortSummary()
- getTag()
- getTags()
- hasModifier()
- hasVisibleComponent()
- inheritedFromParentDeclaration
- label
- modifierTags
- removeModifier()
- removeTags()
- serializeDisplayParts()
- similarTo()
- sourcePath
- splitPartsToHeaderAndBody()
- summary
- toObject()
Context
- addChild()
- checker
- converter
- convertingClassOrInterface
- convertingTypeNode
- createDeclarationReflection()
- expectSymbolAtLocation()
- finalizeDeclarationReflection()
- getComment()
- getFileComment()
- getJsDocComment()
- getNodeComment()
- getSignatureComment()
- getSymbolAtLocation()
- getTypeAtLocation()
- i18n
- postReflectionCreation()
- program
- programs
- project
- registerReflection()
- resolveAliasedSymbol()
- scope
- shouldBeStatic
- shouldIgnore()
- withScope()
Converter
- addUnknownSymbolResolver()
- commentStyle
- config
- convert()
- EVENT_BEGIN
- EVENT_CREATE_DECLARATION
- EVENT_CREATE_DOCUMENT
- EVENT_CREATE_PARAMETER
- EVENT_CREATE_PROJECT
- EVENT_CREATE_SIGNATURE
- EVENT_CREATE_TYPE_PARAMETER
- EVENT_END
- EVENT_RESOLVE
- EVENT_RESOLVE_BEGIN
- EVENT_RESOLVE_END
- excludeExternals
- excludeNotDocumented
- excludePrivate
- excludeProtected
- excludeReferences
- externalPattern
- externalSymbolLinkMappings
- maxTypeConversionDepth
- parseRawComment()
- preserveLinkText
- processDocumentTags()
- resolveLinks()
- validation
DeclarationReflection
- defaultValue
- extendedBy
- extendedTypes
- fromObject()
- getAllSignatures()
- getChildOrTypePropertyByName()
- getNonIndexSignatures()
- getProperties()
- getSignature
- hasGetterOrSetter()
- implementationOf
- implementedBy
- implementedTypes
- indexSignatures
- inheritedFrom
- isDeclaration()
- overwrites
- packageVersion
- readme
- relevanceBoost
- setSignature
- signatures
- sources
- toObject()
- toString()
- traverse()
- type
- typeHierarchy
- typeParameters
- variant
DefaultThemeRenderContext
- breadcrumb
- commentShortSummary
- commentSummary
- commentTags
- defaultLayout
- displayParts
- documentTemplate
- footer
- getNavigation
- getReflectionClasses
- header
- hierarchy
- hierarchyTemplate
- hook
- i18n
- icons
- index
- indexTemplate
- internationalization
- markdown
- member
- memberDeclaration
- memberGetterSetter
- members
- memberSignatureBody
- memberSignatures
- memberSignatureTitle
- memberSources
- moduleMemberSummary
- moduleReflection
- navigation
- options
- page
- pageNavigation
- pageSidebar
- reflectionFlags
- reflectionPreview
- reflectionTemplate
- relativeURL
- settings
- sidebar
- sidebarLinks
- slugger
- theme
- toolbar
- type
- typeAndParent
- typeDeclaration
- typeDetails
- typeDetailsIfUseful
- typeParameters
- urlTo
Reflection
- anchor
- comment
- flags
- fromObject()
- getChildByName()
- getFriendlyFullName()
- getFullName()
- hasComment()
- hasGetterOrSetter()
- hasOwnDocument
- id
- isDeclaration()
- isDeprecated()
- isDocument()
- isParameter()
- isProject()
- isReference()
- kind
- kindOf()
- name
- parent
- project
- setFlag()
- toObject()
- toString()
- toStringHierarchy()
- traverse()
- url
- variant
- visit()
Interfaces
TypeDocOptionMap
- alwaysCreateEntryPointModule
- basePath
- blockTags
- cacheBust
- cascadedModifierTags
- categorizeByGroup
- categoryOrder
- cleanOutputDir
- cname
- commentStyle
- compilerOptions
- customCss
- customFooterHtml
- customFooterHtmlDisableWrapper
- customJs
- darkHighlightTheme
- defaultCategory
- disableGit
- disableSources
- emit
- entryPoints
- entryPointStrategy
- exclude
- excludeCategories
- excludeExternals
- excludeInternal
- excludeNotDocumented
- excludeNotDocumentedKinds
- excludePrivate
- excludeProtected
- excludeReferences
- excludeTags
- externalPattern
- externalSymbolLinkMappings
- favicon
- githubPages
- gitRemote
- gitRevision
- groupOrder
- groupReferencesByType
- headings
- help
- hideGenerator
- highlightLanguages
- hostedBaseUrl
- html
- ignoredHighlightLanguages
- includeHierarchySummary
- includeVersion
- inlineTags
- intentionallyNotExported
- jsDocCompatibility
- json
- kindSortOrder
- lang
- lightHighlightTheme
- locales
- logLevel
- markdownItLoader
- markdownItOptions
- markdownLinkExternal
- maxTypeConversionDepth
- modifierTags
- name
- navigation
- navigationLeaves
- navigationLinks
- notRenderedTags
- options
- out
- outputs
- packageOptions
- plugin
- preserveLinkText
- preserveWatchOutput
- pretty
- projectDocuments
- readme
- requiredToBeDocumented
- searchCategoryBoosts
- searchGroupBoosts
- searchInComments
- searchInDocuments
- showConfig
- sidebarLinks
- skipErrorChecking
- sluggerConfiguration
- sort
- sortEntryPoints
- sourceLinkExternal
- sourceLinkTemplate
- suppressCommentWarningsInDeclarationFiles
- theme
- titleLink
- treatValidationWarningsAsErrors
- treatWarningsAsErrors
- tsconfig
- typePrintWidth
- useFirstParagraphOfCommentAsSummary
- useHostedBaseUrlForAbsoluteLinks
- useTsLinkResolution
- validation
- version
- visibilityFilters
- watch
Enums
Type Aliases
- CommentDisplayPart
- CommentStyle
- DeclarationOption
- DeclarationOptionToOptionType
- EntryPointStrategy
- EnumKeys
- ExternalResolveResult
- ExternalSymbolResolver
- JsDocCompatibility
- KeyToDeclaration
- ManuallyValidatedOption
- MeaningKeyword
- OutputSpecification
- ReflectionId
- ReflectionSymbolIdString
- ReflectionVisitor
- RenderTemplate
- SomeReflection
- SomeType
- SortStrategy
- TypeContext
- TypeDocOptions
- TypeDocOptionValues
- TypeKind
- TypeVisitor
- ValidationOptions
- VarianceModifier
Namespaces
Configuration
- ArgumentsReader
- ArrayDeclarationOption
- BooleanDeclarationOption
- CommentStyle
- CommentStyle
- DeclarationOption
- DeclarationOptionBase
- DeclarationOptionToOptionType
- EmitStrategy
- EmitStrategy
- FlagsDeclarationOption
- JsDocCompatibility
- KeyToDeclaration
- ManuallyValidatedOption
- MapDeclarationOption
- MixedDeclarationOption
- NumberDeclarationOption
- ObjectDeclarationOption
- Option()
- Options
- OptionsReader
- OutputSpecification
- PackageJsonReader
- ParameterHint
- ParameterType
- ParameterTypeToOptionTypeMap
- StringDeclarationOption
- TSConfigReader
- TypeDocOptionMap
- TypeDocOptions
- TypeDocOptionValues
- TypeDocReader
- ValidationOptions
JSONOutput
- ArrayType
- Comment
- CommentDisplayPart
- CommentTag
- ConditionalType
- ContainerReflection
- DeclarationReflection
- DocumentReflection
- FileRegistry
- IndexedAccessType
- InferredType
- InlineTagDisplayPart
- IntersectionType
- IntrinsicType
- LiteralType
- MappedType
- ModelToObject
- NamedTupleMemberType
- OptionalType
- ParameterReflection
- PredicateType
- ProjectReflection
- QueryType
- ReferenceReflection
- ReferenceType
- Reflection
- ReflectionCategory
- ReflectionFlags
- ReflectionGroup
- ReflectionSymbolId
- ReflectionType
- ReflectionVariantMap
- RelativeLinkDisplayPart
- RestType
- SignatureReflection
- SomeReflection
- SomeType
- SourceReference
- TemplateLiteralType
- TupleType
- Type
- TypeKindMap
- TypeOperatorType
- TypeParameterReflection
- UnionType
- UnknownType
Models
- ArrayType
- Comment
- CommentDisplayPart
- CommentTag
- ConditionalType
- ContainerReflection
- DeclarationHierarchy
- DeclarationReflection
- DocumentReflection
- FileRegistry
- IndexedAccessType
- InferredType
- InlineTagDisplayPart
- IntersectionType
- IntrinsicType
- LiteralType
- makeRecursiveVisitor()
- MappedType
- NamedTupleMember
- OptionalType
- ParameterReflection
- PredicateType
- ProjectReflection
- QueryType
- ReferenceReflection
- ReferenceType
- Reflection
- ReflectionCategory
- ReflectionFlag
- ReflectionFlags
- ReflectionGroup
- ReflectionId
- ReflectionKind
- ReflectionSymbolId
- ReflectionSymbolIdString
- ReflectionType
- ReflectionVariant
- ReflectionVisitor
- RelativeLinkDisplayPart
- RestType
- SignatureReflection
- SomeReflection
- SomeType
- SourceReference
- splitUnquotedString()
- TemplateLiteralType
- TraverseCallback
- TraverseProperty
- TupleType
- Type
- TypeContext
- TypeContext
- TypeKind
- TypeKindMap
- TypeOperatorType
- TypeParameterReflection
- TypeVisitor
- UnionType
- UnknownType
- ValidatingFileRegistry
- VarianceModifier
- VarianceModifier
Variables
variable CommentStyle
const CommentStyle: { readonly JSDoc: 'jsdoc'; readonly Block: 'block'; readonly Line: 'line'; readonly All: 'all';};
Determines how TypeDoc searches for comments.
variable EntryPointStrategy
const EntryPointStrategy: { readonly Resolve: 'resolve'; readonly Expand: 'expand'; readonly Packages: 'packages'; readonly Merge: 'merge';};
Defines how entry points are interpreted.
variable TypeContext
const TypeContext: { readonly none: 'none'; readonly templateLiteralElement: 'templateLiteralElement'; readonly arrayElement: 'arrayElement'; readonly indexedAccessElement: 'indexedAccessElement'; readonly conditionalCheck: 'conditionalCheck'; readonly conditionalExtends: 'conditionalExtends'; readonly conditionalTrue: 'conditionalTrue'; readonly conditionalFalse: 'conditionalFalse'; readonly indexedIndex: 'indexedIndex'; readonly indexedObject: 'indexedObject'; readonly inferredConstraint: 'inferredConstraint'; readonly intersectionElement: 'intersectionElement'; readonly mappedName: 'mappedName'; readonly mappedParameter: 'mappedParameter'; readonly mappedTemplate: 'mappedTemplate'; readonly optionalElement: 'optionalElement'; readonly predicateTarget: 'predicateTarget'; readonly queryTypeTarget: 'queryTypeTarget'; readonly typeOperatorTarget: 'typeOperatorTarget'; readonly referenceTypeArgument: 'referenceTypeArgument'; readonly restElement: 'restElement'; readonly tupleElement: 'tupleElement'; readonly unionElement: 'unionElement';};
Enumeration that can be used when traversing types to track the location of recursion. Used by TypeDoc internally to track when to output parenthesis when rendering.
variable VarianceModifier
const VarianceModifier: { readonly in: 'in'; readonly out: 'out'; readonly inOut: 'in out';};
Modifier flags for type parameters, added in TS 4.7
Functions
function makeRecursiveVisitor
makeRecursiveVisitor: (visitor: Partial<TypeVisitor>) => TypeVisitor;
function normalizePath
normalizePath: (path: string) => string;
Normalize the given path.
Parameter path
The path that should be normalized.
Returns
The normalized path.
function Option
Option: <K extends keyof TypeDocOptionMap>( name: K) => ( _: unknown, _context: ClassAccessorDecoratorContext< { application: Application } | { options: Options }, TypeDocOptionValues[K] >) => { get( this: { application: Application } | { options: Options } ): TypeDocOptionValues[K]; set(_value: never): never;};
Binds an option to an accessor. Does not register the option.
Note: This is a standard ES decorator. It will not work with pre-TS 5.0 experimental decorators enabled.
function resetReflectionID
resetReflectionID: () => void;
Reset the reflection id.
Used by the test cases to ensure the reflection ids won't change between runs.
function splitUnquotedString
splitUnquotedString: (input: string, delimiter: string) => string[];
Classes
class Application
class Application extends AbstractComponent<Application, ApplicationEvents> {}
The default TypeDoc main application class.
This class holds the two main components of TypeDoc, the Converter and the Renderer. When running TypeDoc, first the Converter is invoked which generates a ProjectReflection from the passed in source files. The ProjectReflection is a hierarchical model representation of the TypeScript project. Afterwards the model is passed to the Renderer which uses an instance of Theme to generate the final documentation.
Both the Converter and the Renderer emit a series of events while processing the project. Subscribe to these Events to control the application flow or alter the output.
Remarks
Access to an Application instance can be retrieved with Application.bootstrap or Application.bootstrapWithPlugins. It can not be constructed manually.
Common Root level class which contains most useful behavior.
property converter
converter: Converter;
The converter used to create the declaration reflections.
property deserializer
deserializer: Deserializer;
The deserializer used to restore previously serialized JSON output.
property entryPoints
entryPoints: string[];
property entryPointStrategy
entryPointStrategy: EntryPointStrategy;
property EVENT_BOOTSTRAP_END
static readonly EVENT_BOOTSTRAP_END: string;
Emitted after plugins have been loaded and options have been read, but before they have been frozen. The listener will be given an instance of Application.
property EVENT_PROJECT_REVIVE
static readonly EVENT_PROJECT_REVIVE: string;
Emitted after a project has been deserialized from JSON. The listener will be given an instance of ProjectReflection.
property EVENT_VALIDATE_PROJECT
static readonly EVENT_VALIDATE_PROJECT: string;
Emitted when validation is being run. The listener will be given an instance of ProjectReflection.
property files
files: FileRegistry;
property i18n
i18n: TranslationProxy;
Proxy based shortcuts for internationalization keys.
property internationalization
internationalization: Internationalization;
Internationalization module which supports translating according to the
lang
option.
property lang
lang: string;
property logger
logger: Logger;
The logger that should be used to output messages.
property options
options: Options;
property outputs
outputs: Outputs;
property renderer
renderer: Renderer;
The renderer used to generate the HTML documentation output.
property serializer
serializer: Serializer;
The serializer used to generate JSON output.
property skipErrorChecking
skipErrorChecking: boolean;
property VERSION
static readonly VERSION: string;
The version number of TypeDoc.
method bootstrap
static bootstrap: ( options?: Partial<TypeDocOptions>, readers?: readonly OptionsReader[]) => Promise<Application>;
Initialize TypeDoc without loading plugins.
Parameter options
Options to set during initialization
Parameter readers
Option readers to use to discover options from config files.
Example 1
Initialize the application with pretty-printing output disabled.
const app = Application.bootstrap({ pretty: false });
method bootstrapWithPlugins
static bootstrapWithPlugins: ( options?: Partial<TypeDocOptions>, readers?: readonly OptionsReader[]) => Promise<Application>;
Initialize TypeDoc, loading plugins if applicable.
method convert
convert: () => Promise<ProjectReflection | undefined>;
Run the converter for the given set of files and return the generated reflections.
Returns
An instance of ProjectReflection on success, undefined otherwise.
method convertAndWatch
convertAndWatch: ( success: (project: ProjectReflection) => Promise<void>) => void;
method generateDocs
generateDocs: (project: ProjectReflection, out: string) => Promise<void>;
Render HTML for the given project
method generateJson
generateJson: (project: ProjectReflection, out: string) => Promise<void>;
Write the reflections to a json file.
Parameter out
The path and file name of the target file.
Returns
Whether the JSON file could be written successfully.
method generateOutputs
generateOutputs: (project: ProjectReflection) => Promise<void>;
Render outputs selected with options for the specified project
method getDefinedEntryPoints
getDefinedEntryPoints: () => DocumentationEntryPoint[] | undefined;
Gets the entry points to be documented according to the current
entryPoints
andentryPointStrategy
options. May return undefined if entry points fail to be expanded.
method getEntryPoints
getEntryPoints: () => DocumentationEntryPoint[] | undefined;
method getTypeScriptPath
getTypeScriptPath: () => string;
Return the path to the TypeScript compiler.
method getTypeScriptVersion
getTypeScriptVersion: () => string;
method toString
toString: () => string;
Print the version number.
method validate
validate: (project: ProjectReflection) => void;
class ArgumentsReader
class ArgumentsReader implements OptionsReader {}
Obtains option values from command-line arguments
constructor
constructor(priority: number, args?: string[]);
property name
readonly name: string;
property order
readonly order: number;
property supportsPackages
readonly supportsPackages: boolean;
method read
read: (container: Options, logger: Logger) => void;
class ArrayType
class ArrayType extends Type {}
Represents an array type.
let value: string[];Types
constructor
constructor(elementType: SomeType);
Parameter elementType
The type of the elements in the array.
property elementType
elementType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ArrayType;
class Comment
class Comment {}
A model that represents a comment.
Instances of this model are created by the CommentPlugin. You can retrieve comments through the DeclarationReflection.comment property. Comments
constructor
constructor( summary?: CommentDisplayPart[], blockTags?: CommentTag[], modifierTags?: Set<`@${string}`>);
Creates a new Comment instance.
property blockTags
blockTags: CommentTag[];
All associated block level tags.
property inheritedFromParentDeclaration
inheritedFromParentDeclaration?: boolean;
If the comment was inherited from a different "parent" declaration (see #2545), then it is desirable to know this as any
@param
tags which do not apply should not cause warnings. This is not serialized, and only set when the comment was created from ats.CommentRange
.
property label
label?: string;
Label associated with this reflection, if any (https://tsdoc.org/pages/tags/label/)
property modifierTags
modifierTags: Set<`@${string}`>;
All modifier tags present on the comment, e.g.
@alpha
,@beta
.
property sourcePath
sourcePath?: string;
Full path to the file where this comment originated from, if any. This field will not be serialized, so will not be present when handling JSON-revived reflections.
Note: This field is non-enumerable to make testing comment contents with
deepEqual
easier.
property summary
summary: CommentDisplayPart[];
The content of the comment which is not associated with a block tag.
method clone
clone: () => Comment;
Create a deep clone of this comment.
method cloneDisplayParts
static cloneDisplayParts: ( parts: readonly CommentDisplayPart[]) => CommentDisplayPart[];
Helper utility to clone Comment.summary or CommentTag.content
method combineDisplayParts
static combineDisplayParts: ( parts: readonly CommentDisplayPart[] | undefined) => string;
Debugging utility for combining parts into a simple string. Not suitable for rendering, but can be useful in tests.
method deserializeDisplayParts
static deserializeDisplayParts: ( de: Deserializer, parts: JSONOutput.CommentDisplayPart[]) => CommentDisplayPart[];
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.Comment) => void;
method getIdentifiedTag
getIdentifiedTag: ( identifier: string, tagName: `@${string}`) => CommentTag | undefined;
method getShortSummary
getShortSummary: (useFirstParagraph: boolean) => readonly CommentDisplayPart[];
Gets either the
@summary
tag, or a short version of the comment summary section for rendering in module/namespace pages.
method getTag
getTag: (tagName: `@${string}`) => CommentTag | undefined;
Return the first tag with the given name.
Parameter tagName
The name of the tag to look for.
Returns
The found tag or undefined.
method getTags
getTags: (tagName: `@${string}`) => CommentTag[];
Get all tags with the given tag name.
method hasModifier
hasModifier: (tagName: `@${string}`) => boolean;
Test whether this comment contains a tag with the given name.
Parameter tagName
The name of the tag to look for.
Returns
TRUE when this comment contains a tag with the given name, otherwise FALSE.
method hasVisibleComponent
hasVisibleComponent: () => boolean;
Has this comment a visible component?
Returns
TRUE when this comment has a visible component.
method removeModifier
removeModifier: (tagName: `@${string}`) => void;
method removeTags
removeTags: (tagName: `@${string}`) => void;
Removes all block tags with the given tag name from the comment.
Parameter tagName
method serializeDisplayParts
static serializeDisplayParts: { ( serializer: Serializer, parts: CommentDisplayPart[] ): JSONOutput.CommentDisplayPart[]; ( serializer: Serializer, parts: CommentDisplayPart[] ): JSONOutput.CommentDisplayPart[];};
no point in showing this signature in api docs
method similarTo
similarTo: (other: Comment) => boolean;
Checks if this comment is roughly equal to the other comment. This isn't exactly equal, but just "roughly equal" by the comment text.
method splitPartsToHeaderAndBody
static splitPartsToHeaderAndBody: (parts: readonly CommentDisplayPart[]) => { header: string; body: CommentDisplayPart[];};
Splits the provided parts into a header (first line, as a string) and body (remaining lines). If the header line contains inline tags they will be serialized to a string.
method toObject
toObject: (serializer: Serializer) => JSONOutput.Comment;
class CommentTag
class CommentTag {}
A model that represents a single TypeDoc comment tag.
Tags are stored in the Comment.blockTags property. Comments
constructor
constructor(tag: string, text: CommentDisplayPart[]);
Create a new CommentTag instance.
property content
content: CommentDisplayPart[];
The actual body text of this tag.
property name
name?: string;
Some tags, (
@typedef
,@param
,@property
, etc.) may have a user defined identifier associated with them. If this tag is one of those, it will be parsed out and included here.
property skipRendering
skipRendering: boolean;
A flag which may be set by plugins to prevent TypeDoc from rendering this tag, if the plugin provides custom rendering. Note: This flag is **not** serialized, it is expected to be set just before the comment is rendered.
property tag
tag: string;
The name of this tag, e.g.
@returns
,@example
method clone
clone: () => CommentTag;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.CommentTag) => void;
method similarTo
similarTo: (other: CommentTag) => boolean;
Checks if this block tag is roughly equal to the other tag. This isn't exactly equal, but just "roughly equal" by the tag text.
method toObject
toObject: (serializer: Serializer) => JSONOutput.CommentTag;
class ConditionalType
class ConditionalType extends Type {}
Represents a conditional type.
let value: Check extends Extends ? True : False;Types
constructor
constructor( checkType: SomeType, extendsType: SomeType, trueType: SomeType, falseType: SomeType);
property checkType
checkType: SomeType;
property extendsType
extendsType: SomeType;
property falseType
falseType: SomeType;
property trueType
trueType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ConditionalType;
class ContainerReflection
abstract class ContainerReflection extends Reflection {}
Reflections
property categories
categories?: ReflectionCategory[];
All children grouped by their category.
property children
children?: DeclarationReflection[];
The children of this reflection. Do not add reflections to this array manually. Instead call addChild.
property childrenIncludingDocuments
childrenIncludingDocuments?: (DeclarationReflection | DocumentReflection)[];
property documents
documents?: DocumentReflection[];
Documents associated with this reflection.
These are not children as including them as children requires code handle both types, despite being mostly unrelated and handled separately.
Including them here in a separate array neatly handles that problem, but also introduces another one for rendering. When rendering, documents should really actually be considered part of the "children" of a reflection. For this reason, we also maintain a list of child declarations with child documents which is used when rendering.
property groups
groups?: ReflectionGroup[];
All children grouped by their kind.
method addChild
addChild: (child: DeclarationReflection | DocumentReflection) => void;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ContainerReflection) => void;
method getChildrenByKind
getChildrenByKind: (kind: ReflectionKind) => DeclarationReflection[];
Return a list of all children of a certain kind.
Parameter kind
The desired kind of children.
Returns
An array containing all children with the desired kind.
method removeChild
removeChild: (child: DeclarationReflection | DocumentReflection) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ContainerReflection;
method traverse
traverse: (callback: TraverseCallback) => void;
class Context
class Context {}
The context describes the current state the converter is in.
property checker
readonly checker: ts.TypeChecker;
The TypeChecker instance returned by the TypeScript compiler.
property converter
readonly converter: Converter;
The converter instance that has created the context.
property convertingClassOrInterface
convertingClassOrInterface: boolean;
property convertingTypeNode
convertingTypeNode: boolean;
property i18n
readonly i18n: TranslationProxy;
Translation interface for log messages.
property program
readonly program: ts.Program;
The program currently being converted. Accessing this property will throw if a source file is not currently being converted.
property programs
readonly programs: readonly ts.Program[];
All programs being converted.
property project
readonly project: ProjectReflection;
The project that is currently processed.
property scope
readonly scope: Reflection;
The scope or parent reflection that is currently processed.
property shouldBeStatic
shouldBeStatic: boolean;
method addChild
addChild: (reflection: DeclarationReflection | DocumentReflection) => void;
method createDeclarationReflection
createDeclarationReflection: ( kind: ReflectionKind, symbol: ts.Symbol | undefined, exportSymbol: ts.Symbol | undefined, nameOverride?: string) => DeclarationReflection;
method expectSymbolAtLocation
expectSymbolAtLocation: (node: ts.Node) => ts.Symbol;
method finalizeDeclarationReflection
finalizeDeclarationReflection: (reflection: DeclarationReflection) => void;
method getComment
getComment: ( symbol: ts.Symbol, kind: ReflectionKind) => import('../models/index.js').Comment | undefined;
method getFileComment
getFileComment: ( node: ts.SourceFile) => import('../models/index.js').Comment | undefined;
method getJsDocComment
getJsDocComment: ( declaration: | ts.JSDocPropertyLikeTag | ts.JSDocCallbackTag | ts.JSDocTypedefTag | ts.JSDocTemplateTag | ts.JSDocEnumTag) => import('../models/index.js').Comment | undefined;
method getNodeComment
getNodeComment: ( node: ts.Node, moduleComment: boolean) => import('../models/index.js').Comment | undefined;
method getSignatureComment
getSignatureComment: ( declaration: ts.SignatureDeclaration | ts.JSDocSignature) => import('../models/index.js').Comment | undefined;
method getSymbolAtLocation
getSymbolAtLocation: (node: ts.Node) => ts.Symbol | undefined;
method getTypeAtLocation
getTypeAtLocation: (node: ts.Node) => ts.Type | undefined;
Return the type declaration of the given node.
Parameter node
The TypeScript node whose type should be resolved.
Returns
The type declaration of the given node.
method postReflectionCreation
postReflectionCreation: ( reflection: Reflection, symbol: ts.Symbol | undefined, exportSymbol: ts.Symbol | undefined) => void;
method registerReflection
registerReflection: ( reflection: Reflection, symbol: ts.Symbol | undefined) => void;
Register a newly generated reflection. All created reflections should be passed to this method to ensure that the project helper functions work correctly.
Parameter reflection
The reflection that should be registered.
Parameter symbol
The symbol the given reflection was resolved from.
method resolveAliasedSymbol
resolveAliasedSymbol: (symbol: ts.Symbol) => ts.Symbol;
method shouldIgnore
shouldIgnore: (symbol: ts.Symbol) => boolean;
method withScope
withScope: (scope: Reflection) => Context;
class Converter
class Converter extends AbstractComponent<Application, ConverterEvents> {}
Compiles source files using TypeScript and converts compiler symbols to reflections.
Common Responsible for converting TypeScript symbols into Reflections and Types.
constructor
constructor(owner: Application);
property commentStyle
commentStyle: CommentStyle;
property config
readonly config: CommentParserConfig;
property EVENT_BEGIN
static readonly EVENT_BEGIN: string;
Triggered when the converter begins converting a project. The listener will be given a Context object.
property EVENT_CREATE_DECLARATION
static readonly EVENT_CREATE_DECLARATION: string;
Triggered when the converter has created a declaration reflection. The listener will be given Context and a Models.DeclarationReflection.
property EVENT_CREATE_DOCUMENT
static readonly EVENT_CREATE_DOCUMENT: string;
Triggered when the converter has created a document reflection. The listener will be given
undefined
(for consistency with the other create events) and a Models.DocumentReflection.
property EVENT_CREATE_PARAMETER
static readonly EVENT_CREATE_PARAMETER: string;
Triggered when the converter has created a parameter reflection. The listener will be given Context, Models.ParameterReflection and a
ts.Node?
property EVENT_CREATE_PROJECT
static readonly EVENT_CREATE_PROJECT: string;
Triggered when the converter has created a project reflection. The listener will be given Context and a Models.ProjectReflection.
property EVENT_CREATE_SIGNATURE
static readonly EVENT_CREATE_SIGNATURE: string;
Triggered when the converter has created a signature reflection. The listener will be given Context, Models.SignatureReflection | Models.ProjectReflection the declaration,
ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature | undefined
, andts.Signature | undefined
. The signature will be undefined if the created signature is an index signature.
property EVENT_CREATE_TYPE_PARAMETER
static readonly EVENT_CREATE_TYPE_PARAMETER: string;
Triggered when the converter has created a type parameter reflection. The listener will be given Context and a Models.TypeParameterReflection
property EVENT_END
static readonly EVENT_END: string;
Triggered when the converter has finished converting a project. The listener will be given a Context object.
property EVENT_RESOLVE
static readonly EVENT_RESOLVE: string;
Triggered when the converter resolves a reflection. The listener will be given Context and a Reflection.
property EVENT_RESOLVE_BEGIN
static readonly EVENT_RESOLVE_BEGIN: string;
Triggered when the converter begins resolving a project. The listener will be given Context.
property EVENT_RESOLVE_END
static readonly EVENT_RESOLVE_END: string;
Triggered when the converter has finished resolving a project. The listener will be given Context.
property excludeExternals
excludeExternals: boolean;
property excludeNotDocumented
excludeNotDocumented: boolean;
property excludePrivate
excludePrivate: boolean;
property excludeProtected
excludeProtected: boolean;
property excludeReferences
excludeReferences: boolean;
property externalPattern
externalPattern: string[];
property externalSymbolLinkMappings
externalSymbolLinkMappings: Record<string, Record<string, string>>;
property maxTypeConversionDepth
maxTypeConversionDepth: number;
property preserveLinkText
preserveLinkText: boolean;
property validation
validation: ValidationOptions;
method addUnknownSymbolResolver
addUnknownSymbolResolver: (resolver: ExternalSymbolResolver) => void;
Adds a new resolver that the theme can use to try to figure out how to link to a symbol declared by a third-party library which is not included in the documentation.
The resolver function will be passed a declaration reference which it can attempt to resolve. If resolution fails, the function should return undefined.
Note: This will be used for both references to types declared in node_modules (in which case the reference passed will have the
moduleSource
set and thesymbolReference
will navigate via.
) and user defined {@link} tags which cannot be resolved. If the link being resolved is inferred from a type, then nopart
will be passed to the resolver function.
method convert
convert: (entryPoints: readonly DocumentationEntryPoint[]) => ProjectReflection;
Compile the given source files and create a project reflection for them.
method parseRawComment
parseRawComment: ( file: MinimalSourceFile, files: FileRegistry) => { content: CommentDisplayPart[]; frontmatter: Record<string, unknown> };
Parse the given file into a comment. Intended to be used with markdown files.
method processDocumentTags
processDocumentTags: ( reflection: Reflection, parent: ContainerReflection) => void;
method resolveLinks
resolveLinks: { (comment: Comment, owner: Reflection): void; ( parts: readonly CommentDisplayPart[], owner: Reflection ): CommentDisplayPart[];};
class DeclarationReflection
class DeclarationReflection extends ContainerReflection {}
A reflection that represents a single declaration emitted by the TypeScript compiler.
All parts of a project are represented by DeclarationReflection instances. The actual kind of a reflection is stored in its ´kind´ member. Reflections
property defaultValue
defaultValue?: string;
The default value of this reflection.
Applies to function parameters, variables, and properties.
property extendedBy
extendedBy?: ReferenceType[];
A list of all types that extend this reflection (e.g. the subclasses).
property extendedTypes
extendedTypes?: SomeType[];
A list of all types this reflection extends (e.g. the parent classes).
property getSignature
getSignature?: SignatureReflection;
The get signature of this declaration.
property implementationOf
implementationOf?: ReferenceType;
A type that points to the reflection this reflection is the implementation of.
Applies to class members.
property implementedBy
implementedBy?: ReferenceType[];
A list of all types that implement this reflection.
property implementedTypes
implementedTypes?: SomeType[];
A list of all types this reflection implements.
property indexSignatures
indexSignatures?: SignatureReflection[];
The index signature of this declaration.
property inheritedFrom
inheritedFrom?: ReferenceType;
A type that points to the reflection this reflection has been inherited from.
Applies to interface and class members.
property overwrites
overwrites?: ReferenceType;
A type that points to the reflection that has been overwritten by this reflection.
Applies to interface and class members.
property packageVersion
packageVersion?: string;
The version of the module when found.
property readme
readme?: CommentDisplayPart[];
The contents of the readme file of the module when found.
property relevanceBoost
relevanceBoost?: number;
Precomputed boost for search results, may be less than 1 to de-emphasize this member in search results. Does NOT include group/category values as they are computed when building the JS index.
This is preserved for plugins, and may be removed in 0.28 if no plugins have used it yet.
property setSignature
setSignature?: SignatureReflection;
The set signature of this declaration.
property signatures
signatures?: SignatureReflection[];
A list of call signatures attached to this declaration.
TypeDoc creates one declaration per function that may contain one or more signature reflections.
property sources
sources?: SourceReference[];
A list of all source files that contributed to this reflection.
property type
type?: SomeType;
The type of the reflection.
If the reflection represents a variable or a property, this is the value type. If the reflection represents a signature, this is the return type.
property typeHierarchy
typeHierarchy?: DeclarationHierarchy;
Contains a simplified representation of the type hierarchy suitable for being rendered in templates.
property typeParameters
typeParameters?: TypeParameterReflection[];
property variant
readonly variant: 'declaration' | 'reference';
method fromObject
fromObject: ( de: Deserializer, obj: JSONOutput.DeclarationReflection | JSONOutput.ProjectReflection) => void;
method getAllSignatures
getAllSignatures: () => SignatureReflection[];
method getChildOrTypePropertyByName
getChildOrTypePropertyByName: ( path: string[]) => DeclarationReflection | undefined;
method getNonIndexSignatures
getNonIndexSignatures: () => SignatureReflection[];
method getProperties
getProperties: () => DeclarationReflection[];
method hasGetterOrSetter
hasGetterOrSetter: () => boolean;
method isDeclaration
isDeclaration: () => this is DeclarationReflection;
method toObject
toObject: (serializer: Serializer) => JSONOutput.DeclarationReflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method traverse
traverse: (callback: TraverseCallback) => void;
class DefaultTheme
class DefaultTheme extends Theme {}
constructor
constructor(renderer: Renderer);
Create a new DefaultTheme instance.
Parameter renderer
The renderer this theme is attached to.
property defaultLayoutTemplate
defaultLayoutTemplate: ( pageEvent: PageEvent<Reflection>, template: RenderTemplate<PageEvent<Reflection>>) => JSX.Element;
property documentTemplate
documentTemplate: (pageEvent: PageEvent<DocumentReflection>) => JSX.Element;
property hierarchyTemplate
hierarchyTemplate: (pageEvent: PageEvent<ProjectReflection>) => JSX.Element;
property icons
icons: { search: () => JSX.Element; anchor: () => JSX.Element; 1: () => JSX.Element; 2: () => JSX.Element; 4: () => JSX.Element; 8: () => JSX.Element; 16: () => JSX.Element; 32: () => JSX.Element; 64: () => JSX.Element; 128: () => JSX.Element; 256: () => JSX.Element; 512: () => JSX.Element; 1024: () => JSX.Element; 2048: () => JSX.Element; 4096: () => JSX.Element; 8192: () => JSX.Element; 16384: () => JSX.Element; 32768: () => JSX.Element; 65536: () => JSX.Element; 131072: () => JSX.Element; 262144: () => JSX.Element; 524288: () => JSX.Element; 1048576: () => JSX.Element; 2097152: () => JSX.Element; 4194304: () => JSX.Element; 8388608: () => JSX.Element; checkbox: () => JSX.Element; chevronDown: () => JSX.Element; menu: () => JSX.Element; chevronSmall: () => JSX.Element; folder: () => JSX.Element; alertNote: () => JSX.Element; alertTip: () => JSX.Element; alertImportant: () => JSX.Element; alertWarning: () => JSX.Element; alertCaution: () => JSX.Element;};
The icons which will actually be rendered. The source of truth lives on the theme, and the DefaultThemeRenderContext.icons member will produce references to these.
These icons will be written twice. Once to an
icons.svg
file in the assets directory which will be referenced by icons on the context, and once to anicons.js
file so that references to the icons can be dynamically embedded within the page for use by the search dropdown and when loading the page onfile://
urls.Custom themes may overwrite this entire object or individual properties on it to customize the icons used within the page, however TypeDoc currently assumes that all icons are svg elements, so custom themes must also use svg elements.
property indexTemplate
indexTemplate: (pageEvent: PageEvent<ProjectReflection>) => JSX.Element;
property reflectionTemplate
reflectionTemplate: (pageEvent: PageEvent<ContainerReflection>) => JSX.Element;
property sluggerConfiguration
sluggerConfiguration: any;
property URL_PREFIX
static URL_PREFIX: RegExp;
property usedFileNames
usedFileNames: Set<string>;
method applyAnchorUrl
applyAnchorUrl: (reflection: Reflection, container: Reflection) => void;
Generate an anchor url for the given reflection and all of its children.
Parameter reflection
The reflection an anchor url should be created for.
Parameter container
The nearest reflection having an own document.
method buildNavigation
buildNavigation: (project: ProjectReflection) => NavigationElement[];
method buildUrls
buildUrls: ( reflection: DeclarationReflection | DocumentReflection, urls: UrlMapping[]) => UrlMapping[];
Build the url for the the given reflection and all of its children.
Parameter reflection
The reflection the url should be created for.
Parameter urls
The array the url should be appended to.
Returns
The altered urls array.
method getFileName
getFileName: (reflection: Reflection) => string;
Parameter reflection
The reflection the url should be generated for.
method getNavigation
getNavigation: (project: ProjectReflection) => NavigationElement[];
If implementing a custom theme, it is recommended to override buildNavigation instead.
method getReflectionClasses
getReflectionClasses: ( reflection: DeclarationReflection | DocumentReflection) => string;
method getRenderContext
getRenderContext: ( pageEvent: PageEvent<Reflection>) => DefaultThemeRenderContext;
method getUrls
getUrls: (project: ProjectReflection) => UrlMapping[];
Map the models of the given project to the desired output files.
Parameter project
The project whose urls should be generated.
Returns
A list of UrlMapping instances defining which models should be rendered to which files.
method render
render: ( page: PageEvent<Reflection>, template: RenderTemplate<PageEvent<Reflection>>) => string;
class DefaultThemeRenderContext
class DefaultThemeRenderContext {}
constructor
constructor(theme: DefaultTheme, page: PageEvent<Reflection>, options: Options);
property breadcrumb
breadcrumb: ( props: Reflection) => import('../../../utils/jsx.elements.js').JsxElement | undefined;
property commentShortSummary
commentShortSummary: ( props: Reflection) => import('../../../utils/jsx.elements.js').JsxElement | undefined;
property commentSummary
commentSummary: ( props: Reflection) => import('../../../utils/jsx.elements.js').JsxElement | undefined;
property commentTags
commentTags: ( props: Reflection) => import('../../../utils/jsx.elements.js').JsxElement | undefined;
property defaultLayout
defaultLayout: ( template: import('../../index.js').RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property displayParts
displayParts: ( parts: readonly CommentDisplayPart[] | undefined) => import('../../../utils/jsx.elements.js').JsxElement | undefined;
Renders user comment markdown wrapped in a tsd-comment div
property documentTemplate
documentTemplate: ( props: PageEvent<DocumentReflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property footer
footer: () => import('../../../utils/jsx.elements.js').JsxElement;
property getNavigation
getNavigation: () => import('./DefaultTheme.js').NavigationElement[];
property getReflectionClasses
getReflectionClasses: ( refl: DeclarationReflection | DocumentReflection) => string;
property header
header: ( props: PageEvent<Reflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property hierarchy
hierarchy: ( typeHierarchy: | import('../../../models/index.js').DeclarationHierarchy | undefined) => import('../../../utils/jsx.elements.js').JsxElement | undefined;
property hierarchyTemplate
hierarchyTemplate: ( props: PageEvent<import('../../../models/index.js').ProjectReflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property hook
hook: <K extends keyof RendererHooks>( event: K, ...args: RendererHooks[K]) => JsxElement[];
property i18n
i18n: TranslationProxy;
property icons
readonly icons: Readonly< Record< | ReflectionKind | 'chevronDown' | 'checkbox' | 'menu' | 'search' | 'chevronSmall' | 'anchor' | 'folder' | 'alertNote' | 'alertTip' | 'alertImportant' | 'alertWarning' | 'alertCaution', () => JsxElement >>;
Icons available for use within the page.
Note: This creates a reference to icons declared by DefaultTheme.icons, to customize icons, that object must be modified instead.
property index
index: ( props: import('../../../models/index.js').ContainerReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property indexTemplate
indexTemplate: ( props: PageEvent<import('../../../models/index.js').ProjectReflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property internationalization
internationalization: Internationalization;
property markdown
markdown: ( md: readonly CommentDisplayPart[] | NeverIfInternal<string | undefined>) => string;
property member
member: ( props: DeclarationReflection | DocumentReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property memberDeclaration
memberDeclaration: ( props: DeclarationReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property memberGetterSetter
memberGetterSetter: ( props: DeclarationReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property members
members: ( props: import('../../../models/index.js').ContainerReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property memberSignatureBody
memberSignatureBody: ( props: import('../../../models/index.js').SignatureReflection, r_1?: { hideSources?: boolean } | undefined) => import('../../../utils/jsx.elements.js').JsxElement;
property memberSignatures
memberSignatures: ( props: DeclarationReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property memberSignatureTitle
memberSignatureTitle: ( props: import('../../../models/index.js').SignatureReflection, options?: { hideName?: boolean } | undefined) => import('../../../utils/jsx.elements.js').JsxElement;
property memberSources
memberSources: ( props: | DeclarationReflection | import('../../../models/index.js').SignatureReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property moduleMemberSummary
moduleMemberSummary: ( member: DeclarationReflection | DocumentReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property moduleReflection
moduleReflection: ( mod: | DeclarationReflection | import('../../../models/index.js').ProjectReflection) => import('../../../utils/jsx.elements.js').JsxElement;
property navigation
navigation: ( props: PageEvent<Reflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property options
options: Options;
property page
page: PageEvent<Reflection>;
property pageNavigation
pageNavigation: ( props: PageEvent<Reflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property pageSidebar
pageSidebar: ( props: PageEvent<Reflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property reflectionFlags
reflectionFlags: ( props: Reflection) => import('../../../utils/jsx.elements.js').JsxElement;
property reflectionPreview
reflectionPreview: ( props: Reflection) => import('../../../utils/jsx.elements.js').JsxElement | undefined;
Rendered just after the description for a reflection. This can be used to render a shortened type display of a reflection that the rest of the page expands on.
Note: Will not be called for variables/type aliases, as they are summarized by their type declaration, which is already rendered by DefaultThemeRenderContext.memberDeclaration
property reflectionTemplate
reflectionTemplate: ( props: PageEvent<import('../../../models/index.js').ContainerReflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property relativeURL
relativeURL: (url: string, cacheBust?: boolean) => string;
Avoid this in favor of urlTo if possible
property settings
settings: () => import('../../../utils/jsx.elements.js').JsxElement;
property sidebar
sidebar: ( props: PageEvent<Reflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property sidebarLinks
sidebarLinks: () => import('../../../utils/jsx.elements.js').JsxElement | null;
property slugger
readonly slugger: Slugger;
property theme
readonly theme: DefaultTheme;
property toolbar
toolbar: ( props: PageEvent<Reflection>) => import('../../../utils/jsx.elements.js').JsxElement;
property type
type: ( type: import('../../../models/types.js').SomeType | undefined, options?: { topLevelLinks: boolean } | undefined) => import('../../../utils/jsx.elements.js').JsxElement;
property typeAndParent
typeAndParent: ( props: import('../../../models/types.js').Type) => import('../../../utils/jsx.elements.js').JsxElement;
property typeDeclaration
typeDeclaration: ( type: import('../../../models/types.js').SomeType) => import('../../../utils/jsx.elements.js').JsxChildren;
Wrapper around typeDetails which checks if it is useful and includes a "Type Declaration" header.
property typeDetails
typeDetails: ( type: import('../../../models/types.js').SomeType, renderAnchors: boolean) => import('../../../utils/jsx.elements.js').JsxChildren;
Used to render additional details about a type. This is used to implement the
@expand
tag, comments on union members, comments on object type members...
property typeDetailsIfUseful
typeDetailsIfUseful: ( type: import('../../../models/types.js').SomeType | undefined) => import('../../../utils/jsx.elements.js').JsxChildren;
Should call the typeDetails helper if rendering additional details about the type will provide the user with more information about the type.
property typeParameters
typeParameters: ( typeParameters: import('../../../models/index.js').TypeParameterReflection[]) => import('../../../utils/jsx.elements.js').JsxElement;
property urlTo
urlTo: (reflection: Reflection) => string;
class Deserializer
class Deserializer {}
Deserializes TypeDoc's JSON output back to Reflection instances.
Common Deserializes TypeDoc's JSON output
constructor
constructor(application: Application);
property application
readonly application: Application;
property logger
readonly logger: Logger;
property oldFileIdToNewFileId
oldFileIdToNewFileId: Record<number, number>;
property oldIdToNewId
oldIdToNewId: Record<number, number>;
property project
project: ProjectReflection;
property projectRoot
projectRoot: string;
Only set when deserializing.
property reflectionBuilders
reflectionBuilders: { declaration: ( parent: Reflection, obj: JSONOutput.DeclarationReflection | JSONOutput.ReferenceReflection ) => DeclarationReflection; param: ( parent: SignatureReflection, obj: JSONOutput.ParameterReflection ) => ParameterReflection; project: ( parent: Reflection, obj: JSONOutput.ProjectReflection ) => ProjectReflection; reference: ( parent: Reflection, obj: JSONOutput.ReferenceReflection ) => ReferenceReflection; signature: ( parent: DeclarationReflection, obj: JSONOutput.SignatureReflection ) => SignatureReflection; typeParam: ( parent: DeclarationReflection | SignatureReflection, obj: JSONOutput.TypeParameterReflection ) => TypeParameterReflection; document: ( parent: Reflection, obj: JSONOutput.DocumentReflection ) => DocumentReflection;};
property typeBuilders
typeBuilders: { array: (obj: JSONOutput.ArrayType, de: Deserializer) => ArrayType; conditional: ( obj: JSONOutput.ConditionalType, de: Deserializer ) => ConditionalType; indexedAccess: ( obj: JSONOutput.IndexedAccessType, de: Deserializer ) => IndexedAccessType; inferred: (obj: JSONOutput.InferredType, de: Deserializer) => InferredType; intersection: ( obj: JSONOutput.IntersectionType, de: Deserializer ) => IntersectionType; intrinsic: ( obj: JSONOutput.IntrinsicType, de: Deserializer ) => IntrinsicType; literal: (obj: JSONOutput.LiteralType, de: Deserializer) => LiteralType; mapped: (obj: JSONOutput.MappedType, de: Deserializer) => MappedType; optional: (obj: JSONOutput.OptionalType, de: Deserializer) => OptionalType; predicate: ( obj: JSONOutput.PredicateType, de: Deserializer ) => PredicateType; query: (obj: JSONOutput.QueryType, de: Deserializer) => QueryType; reference: ( obj: JSONOutput.ReferenceType, de: Deserializer ) => ReferenceType; reflection: ( obj: JSONOutput.ReflectionType, de: Deserializer ) => ReflectionType; rest: (obj: JSONOutput.RestType, de: Deserializer) => RestType; templateLiteral: ( obj: JSONOutput.TemplateLiteralType, de: Deserializer ) => TemplateLiteralType; tuple: (obj: JSONOutput.TupleType, de: Deserializer) => TupleType; namedTupleMember: ( obj: JSONOutput.NamedTupleMemberType, de: Deserializer ) => NamedTupleMember; typeOperator: ( obj: JSONOutput.TypeOperatorType, de: Deserializer ) => TypeOperatorType; union: (obj: JSONOutput.UnionType, de: Deserializer) => UnionType; unknown: (obj: JSONOutput.UnknownType, de: Deserializer) => UnknownType;};
method addDeserializer
addDeserializer: (de: DeserializerComponent) => void;
method constructReflection
constructReflection: <T extends JSONOutput.SomeReflection>( obj: T) => ReflectionVariant[T['variant']];
method constructType
constructType: <T extends JSONOutput.SomeType>(obj: T) => TypeKindMap[T['type']];
method defer
defer: (cb: (project: ProjectReflection) => void) => void;
Defers work until the initial pass of serialization has been completed. This can be used to set up references which cannot be immediately restored.
May only be called when deserializing.
method fromObject
fromObject: <T>( receiver: { fromObject(d: Deserializer, o: T): void }, obj: T) => void;
method revive
revive: { <T, U extends Deserializable<T>>( source: NonNullable<T>, creator: (obj: T) => U ): U; <T, U extends Deserializable<T>>(source: T, creator: (obj: T) => U): U;};
method reviveMany
reviveMany: { <T, U extends Deserializable<T>>( sourceArray: T[], creator: (obj: T) => U ): U[]; <T, U extends Deserializable<T>>( sourceArray: T[], creator: (obj: T) => U ): U[];};
method reviveProject
reviveProject: ( name: string, projectObj: JSONOutput.ProjectReflection, options: { projectRoot: string; registry: FileRegistry; addProjectDocuments?: boolean; }) => ProjectReflection;
Revive a single project into the structure it was originally created with. This is generally not appropriate for merging multiple projects since projects may contain reflections in their root, not inside a module.
method reviveProjects
reviveProjects: ( name: string, projects: readonly JSONOutput.ProjectReflection[], options: { projectRoot: string; registry: FileRegistry; addProjectDocuments?: boolean; }) => ProjectReflection;
method reviveType
reviveType: { <T extends JSONOutput.SomeType>(obj: T): TypeKindMap[T['type']]; <T extends JSONOutput.SomeType>(obj: T): TypeKindMap[T['type']];};
class DocumentReflection
class DocumentReflection extends Reflection {}
Non-TS reflection type which is used to represent markdown documents included in the docs.
constructor
constructor( name: string, parent: Reflection, content: CommentDisplayPart[], frontmatter: Record<string, unknown>);
property children
children?: DocumentReflection[];
Child documents, if any are present.
property content
content: CommentDisplayPart[];
The content to be displayed on the page for this reflection.
property frontmatter
frontmatter: Record<string, unknown>;
Frontmatter included in document
property relevanceBoost
relevanceBoost?: number;
A precomputed boost derived from the searchCategoryBoosts and searchGroupBoosts options, used when boosting search relevance scores at runtime. May be modified by plugins.
property variant
readonly variant: string;
method addChild
addChild: (child: DocumentReflection) => void;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.DocumentReflection) => void;
method isDocument
isDocument: () => this is DocumentReflection;
method toObject
toObject: (serializer: Serializer) => JSONOutput.DocumentReflection;
method traverse
traverse: (callback: TraverseCallback) => void;
class EventDispatcher
class EventDispatcher<T extends Record<keyof T, unknown[]>> {}
Intentionally very simple event emitter.
method off
off: <K extends keyof T>( event: K, listener: (this: undefined, ...args: T[K]) => void) => void;
Stops listening to an event.
Parameter event
the event to stop listening to.
Parameter listener
the function to remove from the listener array.
method on
on: <K extends keyof T>( event: K, listener: (this: undefined, ...args: T[K]) => void, priority?: number) => void;
Starts listening to an event.
Parameter event
the event to listen to.
Parameter listener
function to be called when an this event is emitted.
Parameter priority
optional priority to insert this hook with.
method trigger
trigger: <K extends keyof T>(event: K, ...args: T[K]) => void;
Emits an event to all currently subscribed listeners.
Parameter event
the event to emit.
Parameter args
any arguments required for the event.
class EventHooks
class EventHooks<T extends Record<keyof T, unknown[]>, R> {}
Event emitter which allows listeners to return a value.
This is beneficial for the themes since it allows plugins to modify the HTML output without doing unsafe text replacement.
Very simple event emitter class which collects the return values of its listeners.
Example 1
const x = new EventHooks<{ a: [string] }, string>()x.on('a', a => a.repeat(123)) // ok, returns a stringx.on('b', console.log) // error, 'b' is not assignable to 'a'x.on('a' a => 1) // error, returns a number but expected a string
method emit
emit: <K extends keyof T>(event: K, ...args: T[K]) => R[];
Emits an event to all currently subscribed listeners.
Parameter event
the event to emit.
Parameter args
any arguments required for the event.
method off
off: <K extends keyof T>(event: K, listener: (...args: T[K]) => R) => void;
Stops listening to an event.
Parameter event
the event to stop listening to.
Parameter listener
the function to remove from the listener array.
method on
on: <K extends keyof T>( event: K, listener: (...args: T[K]) => R, order?: number) => void;
Starts listening to an event.
Parameter event
the event to listen to.
Parameter listener
function to be called when an this event is emitted.
Parameter order
optional order to insert this hook with.
method once
once: <K extends keyof T>( event: K, listener: (...args: T[K]) => R, order?: number) => void;
Listens to a single occurrence of an event.
Parameter event
the event to listen to.
Parameter listener
function to be called when an this event is emitted.
Parameter order
optional order to insert this hook with.
method restoreMomento
restoreMomento: (momento: EventHooksMomento<T, R>) => void;
method saveMomento
saveMomento: () => EventHooksMomento<T, R>;
class FileRegistry
class FileRegistry {}
property mediaToPath
protected mediaToPath: Map<number, string>;
property mediaToReflection
protected mediaToReflection: Map<number, ReflectionId>;
property names
protected names: Map<number, string>;
property nameUsage
protected nameUsage: Map<string, number>;
property nextId
protected nextId: number;
property pathToMedia
protected pathToMedia: Map<string, number>;
property reflectionToPath
protected reflectionToPath: Map<ReflectionId, string>;
method fromObject
fromObject: (de: Deserializer, obj: JSONFileRegistry) => void;
Revive a file registry from disc. Note that in the packages context this may be called multiple times on a single object, and should merge in files from the other registries.
method getName
getName: (id: number) => string | undefined;
method getNameToAbsoluteMap
getNameToAbsoluteMap: () => ReadonlyMap<string, string>;
method getReflectionPath
getReflectionPath: (reflection: Reflection) => string | undefined;
method register
register: ( sourcePath: string, relativePath: string) => { target: number; anchor: string | undefined } | undefined;
method registerAbsolute
registerAbsolute: (absolute: string) => { target: number; anchor: string | undefined;};
method removeReflection
removeReflection: (reflection: Reflection) => void;
method resolve
resolve: ( id: number, project: ProjectReflection) => string | Reflection | undefined;
method toObject
toObject: (ser: Serializer) => JSONFileRegistry;
class IndexedAccessType
class IndexedAccessType extends Type {}
Represents an indexed access type. Types
constructor
constructor(objectType: SomeType, indexType: SomeType);
property indexType
indexType: SomeType;
property objectType
objectType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.IndexedAccessType;
class IndexEvent
class IndexEvent {}
An event emitted when the search index is being prepared.
constructor
constructor(searchResults: (DeclarationReflection | DocumentReflection)[]);
property PREPARE_INDEX
static readonly PREPARE_INDEX: string;
Triggered on the renderer when the search index is being prepared.
property searchFields
searchFields: Record<string, string>[];
Additional search fields to be used when creating the search index.
name
,comment
anddocument
may be specified to overwrite TypeDoc's search fields.Do not use
id
as a custom search field.
property searchFieldWeights
readonly searchFieldWeights: Record<string, number>;
Weights for the fields defined in
searchFields
. The default will weightname
as 10x more important than comment and document content.If a field added to searchFields is not added to this object, it will **not** be searchable.
Do not replace this object, instead, set new properties on it for custom search fields added by your plugin.
property searchResults
searchResults: (DeclarationReflection | DocumentReflection)[];
May be filtered by plugins to reduce the results available. Additional items *should not* be added to this array.
If you remove an index from this array, you must also remove the same index from searchFields. The removeResult helper will do this for you.
method removeResult
removeResult: (index: number) => void;
Remove a search result by index.
class InferredType
class InferredType extends Type {}
Represents an inferred type, U in the example below.
type Z = Promise<string> extends Promise<infer U> : neverTypes
constructor
constructor(name: string, constraint?: SomeType);
property constraint
constraint?: SomeType;
property name
name: string;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.InferredType;
class IntersectionType
class IntersectionType extends Type {}
Represents an intersection type.
let value: A & B;Types
constructor
constructor(types: SomeType[]);
property type
readonly type: string;
property types
types: SomeType[];
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.IntersectionType;
class IntrinsicType
class IntrinsicType extends Type {}
Represents an intrinsic type like
string
orboolean
.let value: number;Types
constructor
constructor(name: string);
property name
name: string;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: () => JSONOutput.IntrinsicType;
class LiteralType
class LiteralType extends Type {}
Represents a literal type.
type A = "A"type B = 1Types
constructor
constructor(value: string | number | bigint | boolean);
property type
readonly type: string;
property value
value: string | number | bigint | boolean;
method getTypeString
protected getTypeString: () => string;
Return a string representation of this type.
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: () => JSONOutput.LiteralType;
class Logger
class Logger {}
A logger that will not produce any output.
This logger also serves as the base class of other loggers as it implements all the required utility functions.
property errorCount
errorCount: number;
How many error messages have been logged?
property i18n
i18n: TranslationProxy;
Translation utility for internationalization.
property level
level: LogLevel;
The minimum logging level to print.
property warningCount
warningCount: number;
How many warning messages have been logged?
method addContext
protected addContext: ( message: string, _level: LogLevel, ..._args: [ts.Node?] | [number, MinimalSourceFile]) => string;
method diagnostic
diagnostic: (diagnostic: ts.Diagnostic) => void;
Print the given TypeScript log message.
Parameter diagnostic
The TypeScript message that should be logged.
method diagnostics
diagnostics: (diagnostics: ReadonlyArray<ts.Diagnostic>) => void;
Print the given TypeScript log messages.
Parameter diagnostics
The TypeScript messages that should be logged.
method error
error: { (text: IfInternal<TranslatedString, string>, node?: ts.Node): void; (text: string, pos: number, file: MinimalSourceFile): void;};
Log the given error.
Parameter text
The error that should be logged.
method hasErrors
hasErrors: () => boolean;
Has an error been raised through the log method?
method hasWarnings
hasWarnings: () => boolean;
Has a warning been raised through the log method?
method info
info: (text: IfInternal<TranslatedString, string>) => void;
Log the given info message.
method log
log: (_message: string, level: LogLevel) => void;
Print a log message.
Parameter _message
The message itself.
Parameter level
The urgency of the log message.
method resetErrors
resetErrors: () => void;
Reset the error counter.
method resetWarnings
resetWarnings: () => void;
Reset the warning counter.
method verbose
verbose: (text: string) => void;
Log the given verbose message.
Parameter text
The message that should be logged.
method warn
warn: { (text: IfInternal<TranslatedString, string>, node?: ts.Node): void; (text: string, pos: number, file: MinimalSourceFile): void;};
Log the given warning.
Parameter text
The warning that should be logged.
class MappedType
class MappedType extends Type {}
Represents a mapped type.
{ -readonly [K in Parameter as Name]?: Template }Types
constructor
constructor( parameter: string, parameterType: SomeType, templateType: SomeType, readonlyModifier?: '+' | '-', optionalModifier?: '+' | '-', nameType?: SomeType);
property nameType
nameType?: SomeType;
property optionalModifier
optionalModifier?: '+' | '-';
property parameter
parameter: string;
property parameterType
parameterType: SomeType;
property readonlyModifier
readonlyModifier?: '+' | '-';
property templateType
templateType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.MappedType;
class MarkdownEvent
class MarkdownEvent {}
An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
See Also
constructor
constructor(page: PageEvent<unknown>, originalText: string, parsedText: string);
property originalText
readonly originalText: string;
The unparsed original text.
property page
readonly page: PageEvent<unknown>;
The page that this markdown is being parsed for.
property PARSE
static readonly PARSE: string;
Triggered on the renderer when this plugin parses a markdown string.
property parsedText
parsedText: string;
The parsed output.
class MinimalSourceFile
class MinimalSourceFile implements SourceFileLike {}
constructor
constructor(text: string, fileName: string);
property fileName
readonly fileName: string;
property text
readonly text: string;
method getLineAndCharacterOfPosition
getLineAndCharacterOfPosition: (pos: number) => LineAndCharacter;
class NamedTupleMember
class NamedTupleMember extends Type {}
Represents a named member of a tuple type.
let value: [name: string];Types
constructor
constructor(name: string, isOptional: boolean, element: SomeType);
property element
element: SomeType;
property isOptional
isOptional: boolean;
property name
name: string;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
Return a string representation of this type.
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.NamedTupleMemberType;
class OptionalType
class OptionalType extends Type {}
Represents an optional type
type Z = [1, 2?]// ^^Types
constructor
constructor(elementType: SomeType);
property elementType
elementType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.OptionalType;
class Options
class Options {}
Maintains a collection of option declarations split into TypeDoc options and TypeScript options. Ensures options are of the correct type for calling code.
### Option Discovery
Since plugins commonly add custom options, and TypeDoc does not permit options which have not been declared to be set, options must be read twice. The first time options are read, a noop logger is passed so that any errors are ignored. Then, after loading plugins, options are read again, this time with the logger specified by the application.
Options are read in a specific order. 1. argv (0) - Must be read first since it should change the files read when passing --options or --tsconfig. 2. typedoc-json (100) - Read next so that it can specify the tsconfig.json file to read. 3. tsconfig-json (200) - Last config file reader, cannot specify the typedoc.json file to read. 4. argv (300) - Read argv again since any options set there should override those set in config files.
Common Contains all of TypeDoc's option declarations & values
constructor
constructor(i18n: TranslationProxy);
property packageDir
packageDir?: string;
In packages mode, the directory of the package being converted.
method addDeclaration
addDeclaration: { <K extends keyof TypeDocOptionMap>( declaration: { name: K } & KeyToDeclaration<K> ): void; (declaration: Readonly<DeclarationOption>): void;};
Adds an option declaration to the container with extra type checking to ensure that the runtime type is consistent with the declared type.
Parameter declaration
The option declaration that should be added.
Adds an option declaration to the container.
Parameter declaration
The option declaration that should be added.
method addReader
addReader: (reader: OptionsReader) => void;
Adds an option reader that will be used to read configuration values from the command line, configuration files, or other locations.
Parameter reader
method copyForPackage
copyForPackage: (packageDir: string) => Options;
Clones the options, intended for use in packages mode.
method getCompilerOptions
getCompilerOptions: () => ts.CompilerOptions;
Gets the set compiler options.
method getDeclaration
getDeclaration: (name: string) => Readonly<DeclarationOption> | undefined;
Gets a declaration by one of its names.
Parameter name
method getDeclarations
getDeclarations: () => Readonly<DeclarationOption>[];
Gets all declared options.
method getFileNames
getFileNames: () => readonly string[];
Gets the file names discovered through reading a tsconfig file.
method getHelp
getHelp: (i18n: TranslationProxy) => string;
Get the help message to be displayed to the user if
--help
is passed.
method getProjectReferences
getProjectReferences: () => readonly ts.ProjectReference[];
Gets the project references - used in solution style tsconfig setups.
method getRawValues
getRawValues: () => Readonly<Partial<TypeDocOptions>>;
Gets all of the TypeDoc option values defined in this option container.
method getSimilarOptions
getSimilarOptions: (missingName: string) => string[];
Discover similar option names to the given name, for use in error reporting.
method getValue
getValue: { <K extends keyof TypeDocOptionMap>(name: K): TypeDocOptionValues[K]; (name: string): unknown;};
Gets a value for the given option key, throwing if the option has not been declared.
Parameter name
method isSet
isSet: { (name: keyof TypeDocOptions): boolean; (name: string): boolean };
Checks if the given option's value is deeply strict equal to the default.
Parameter name
method read
read: (logger: Logger, cwd?: string) => Promise<void>;
method reset
reset: { (name?: keyof TypeDocOptions): void; (name?: string): void };
Resets the option bag to all default values. If a name is provided, will only reset that name.
method setCompilerOptions
setCompilerOptions: ( fileNames: readonly string[], options: ts.CompilerOptions, projectReferences: readonly ts.ProjectReference[] | undefined) => void;
Sets the compiler options that will be used to get a TS program.
method setValue
setValue: { <K extends keyof TypeDocOptionMap>( name: K, value: TypeDocOptions[K], configPath?: string ): void; (name: string, value: unknown, configPath?: string): void;};
Sets the given declared option. Throws if setting the option fails.
Parameter name
Parameter value
Parameter configPath
the directory to resolve Path type values against
class Outputs
class Outputs {}
constructor
constructor(application: Application);
property application
readonly application: Application;
method addOutput
addOutput: ( name: string, output: (path: string, project: ProjectReflection) => Promise<void>) => void;
method getOutputSpecs
getOutputSpecs: () => OutputSpecification[];
method setDefaultOutputName
setDefaultOutputName: (name: string) => void;
method writeOutput
writeOutput: ( output: OutputSpecification, project: ProjectReflection) => Promise<void>;
method writeOutputs
writeOutputs: (project: ProjectReflection) => Promise<void>;
class PackageJsonReader
class PackageJsonReader implements OptionsReader {}
property name
name: string;
property order
order: number;
property supportsPackages
supportsPackages: boolean;
method read
read: (container: Options, logger: Logger, cwd: string) => void;
class PageEvent
class PageEvent<out Model = unknown> {}
An event emitted by the Renderer class before and after the markup of a page is rendered.
See Also
constructor
constructor(model: {});
constructor
constructor(name: string, model: {});
Deprecated
use the single constructor arg instead, will be removed in 0.27
property BEGIN
static readonly BEGIN: string;
Triggered before a document will be rendered.
property contents
contents?: string;
The final html content of this page.
Should be rendered by layout templates and can be modified by plugins.
property END
static readonly END: string;
Triggered after a document has been rendered, just before it is written to disc.
property filename
filename: string;
The filename the page will be written to.
property model
readonly model: {};
The model that should be rendered on this page.
property pageHeadings
pageHeadings: PageHeading[];
Links to content within this page that should be rendered in the page navigation. This is built when rendering the document content.
property pageSections
pageSections: { title: string; headings: PageHeading[] }[];
Sections of the page, generally set by
@group
s
property project
project: ProjectReflection;
The project the renderer is currently processing.
property url
url: string;
The url this page will be located at.
method startNewSection
startNewSection: (title: string) => void;
Start a new section of the page. Sections are collapsible within the "On This Page" sidebar.
class ParameterReflection
class ParameterReflection extends Reflection {}
Reflections
property defaultValue
defaultValue?: string;
property parent
parent?: SignatureReflection;
property type
type?: SomeType;
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ParameterReflection) => void;
method isParameter
isParameter: () => this is ParameterReflection;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ParameterReflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method traverse
traverse: (callback: TraverseCallback) => void;
class PredicateType
class PredicateType extends Type {}
Represents a type predicate.
function isString(x: unknown): x is string {}function assert(condition: boolean): asserts condition {}Types
constructor
constructor(name: string, asserts: boolean, targetType?: SomeType);
Create a new PredicateType instance.
Parameter name
The identifier name which is tested by the predicate.
Parameter asserts
True if the type is of the form
asserts val is string
, false if the type is of the formval is string
Parameter targetType
The type that the identifier is tested to be. May be undefined if the type is of the form
asserts val
. Will be defined if the type is of the formasserts val is string
orval is string
.
property asserts
asserts: boolean;
property name
name: string;
property targetType
targetType?: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
Return a string representation of this type.
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.PredicateType;
class ProjectReflection
class ProjectReflection extends ContainerReflection {}
A reflection that represents the root of the project.
The project reflection acts as a global index, one may receive all reflections and source files of the processed project through this reflection. Reflections
constructor
constructor(name: string, registry: FileRegistry);
property files
readonly files: FileRegistry;
Object which describes where to find content for relative links.
property packageName
packageName?: string;
The name of the package that this reflection documents according to package.json.
property packageVersion
packageVersion?: string;
The version of the package that this reflection documents according to package.json.
property readme
readme?: CommentDisplayPart[];
The contents of the readme.md file of the project when found.
property reflections
reflections: { [id: number]: Reflection };
A list of all reflections within the project. DO NOT MUTATE THIS OBJECT. All mutation should be done via registerReflection and removeReflection to ensure that links to reflections remain valid.
This may be replaced with a
Map<number, Reflection>
someday.
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ProjectReflection) => void;
method getReflectionById
getReflectionById: (id: number) => Reflection | undefined;
Gets the reflection registered for the given reflection ID, or undefined if it is not present in the project.
method getReflectionsByKind
getReflectionsByKind: (kind: ReflectionKind) => Reflection[];
Return a list of all reflections in this project of a certain kind.
Parameter kind
The desired kind of reflection.
Returns
An array containing all reflections with the desired kind.
method isProject
isProject: () => this is ProjectReflection;
Return whether this reflection is the root / project reflection.
method registerReflection
registerReflection: ( reflection: Reflection, symbol: ts.Symbol | undefined, filePath: string | undefined) => void;
Registers the given reflection so that it can be quickly looked up by helper methods. Should be called for *every* reflection added to the project.
method removeReflection
removeReflection: (reflection: Reflection) => void;
Removes a reflection from the documentation. Can be used by plugins to filter reflections out of the generated documentation. Has no effect if the reflection is not present in the project.
method removeTypeReflections
removeTypeReflections: (type: Type | undefined) => void;
Removes references to reflections contained within the provided type. Plugins which overwrite types on reflections should pass the type to this method before overwriting the property. 0.26.6
method symbolIdHasBeenRemoved
symbolIdHasBeenRemoved: (id: ReflectionSymbolId) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ProjectReflection;
class QueryType
class QueryType extends Type {}
Represents a type that is constructed by querying the type of a reflection.
const x = 1type Z = typeof x // query on reflection for xTypes
constructor
constructor(queryType: ReferenceType);
property queryType
queryType: ReferenceType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.QueryType;
class ReferenceReflection
class ReferenceReflection extends DeclarationReflection {}
Describes a reflection which does not exist at this location, but is referenced. Used for imported reflections.
// a.tsexport const a = 1;// b.tsimport { a } from './a';// Here to avoid extra work we create a reference to the original reflection in module a instead// of copying the reflection.export { a };Reflections
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReferenceReflection) => void;
method getChildByName
getChildByName: (arg: string | string[]) => Reflection | undefined;
method getTargetReflection
getTargetReflection: () => Reflection;
Gets the reflection that is referenced. This may be another reference reflection. To fully resolve any references, use getTargetReflectionDeep.
method getTargetReflectionDeep
getTargetReflectionDeep: () => Reflection;
Gets the reflection that is referenced, this will fully resolve references. To only resolve one reference, use getTargetReflection.
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReferenceReflection;
method tryGetTargetReflection
tryGetTargetReflection: () => Reflection | undefined;
Tries to get the reflection that is referenced. This may be another reference reflection. To fully resolve any references, use tryGetTargetReflectionDeep.
method tryGetTargetReflectionDeep
tryGetTargetReflectionDeep: () => Reflection | undefined;
Tries to get the reflection that is referenced, this will fully resolve references. To only resolve one reference, use tryGetTargetReflection.
class ReferenceType
class ReferenceType extends Type {}
Represents a type that refers to another reflection like a class, interface or enum.
let value: MyClass<T>;Types
property externalUrl
externalUrl?: string;
If this reference type refers to a reflection defined by a project not being rendered, points to the url that this type should be linked to.
property highlightedProperties
highlightedProperties?: Map<string, CommentDisplayPart[]>;
Sometimes a few properties are more important than the rest of the properties within a type. This occurs most often with object parameters, where users want to specify
@param foo.bar
to highlight something about thebar
property.Does NOT support nested properties.
property name
name: string;
The name of the referenced type.
If the symbol cannot be found because it's not part of the documentation this can be used to represent the type.
property package
package?: string;
The package that this type is referencing.
property preferValues
preferValues: boolean;
If set, will prefer reflections with ReflectionKinds which represent values rather than those which represent types.
property qualifiedName
qualifiedName: string;
The fully qualified name of the referenced type, relative to the file it is defined in. This will usually be the same as
name
, unless namespaces are used.
property refersToTypeParameter
refersToTypeParameter: boolean;
If set, no warnings about something not being exported should be created since this may be referring to a type created with
infer X
which will not be registered on the project.
property reflection
readonly reflection: Reflection;
The resolved reflection.
property symbolId
readonly symbolId: ReflectionSymbolId;
If not resolved, the symbol id of the reflection, otherwise undefined.
property type
readonly type: string;
property typeArguments
typeArguments?: SomeType[];
The type arguments of this reference.
method createResolvedReference
static createResolvedReference: ( name: string, target: Reflection | number, project: ProjectReflection | null) => ReferenceType;
method createSymbolReference
static createSymbolReference: ( symbol: ts.Symbol, context: Context, name?: string) => ReferenceType;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReferenceType) => void;
method getTypeString
protected getTypeString: () => string;
method isIntentionallyBroken
isIntentionallyBroken: () => boolean;
Checks if this type is a reference type because it uses a name, but is intentionally not pointing to a reflection. This happens for type parameters and when representing a mapped type.
method needsParenthesis
needsParenthesis: () => boolean;
method toDeclarationReference
toDeclarationReference: () => DeclarationReference;
Convert this reference type to a declaration reference used for resolution of external types.
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReferenceType;
class Reflection
abstract class Reflection {}
Base class for all reflection classes.
While generating a documentation, TypeDoc generates an instance of ProjectReflection as the root for all reflections within the project. All other reflections are represented by the DeclarationReflection class.
This base class exposes the basic properties one may use to traverse the reflection tree. You can use the ContainerReflection.children and parent properties to walk the tree. The ContainerReflection.groups property contains a list of all children grouped and sorted for rendering. Reflections
constructor
constructor(name: string, kind: ReflectionKind, parent?: Reflection);
property anchor
anchor?: string;
The name of the anchor of this child. TODO: Reflections shouldn't know anchors exist. Move this to a serializer.
property comment
comment?: Comment;
The parsed documentation comment attached to this reflection.
property flags
flags: ReflectionFlags;
property hasOwnDocument
hasOwnDocument?: boolean;
Is the url pointing to an individual document?
When FALSE, the url points to an anchor tag on a page of a different reflection. TODO: Reflections shouldn't know how they are rendered. Move this to the correct serializer.
property id
id: Number & { __reflectionIdBrand: never };
Unique id of this reflection.
property kind
kind: ReflectionKind;
The kind of this reflection.
property name
name: string;
The symbol name of this reflection.
property parent
parent?: Reflection;
The reflection this reflection is a child of.
property project
project: ProjectReflection;
property url
url?: string;
The url of this reflection in the generated documentation. TODO: Reflections shouldn't know urls exist. Move this to a serializer.
property variant
abstract readonly variant: keyof ReflectionVariant;
Discriminator representing the type of reflection represented by this object.
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.Reflection) => void;
method getChildByName
getChildByName: (arg: string | string[]) => Reflection | undefined;
Return a child by its name.
Parameter arg
The name hierarchy of the child to look for.
Returns
The found child or undefined.
method getFriendlyFullName
getFriendlyFullName: () => string;
Return the full name of this reflection, with signature names dropped if possible without introducing ambiguity in the name.
method getFullName
getFullName: (separator?: string) => string;
Return the full name of this reflection. Intended for use in debugging. For log messages intended to be displayed to the user for them to fix, prefer getFriendlyFullName instead.
The full name contains the name of this reflection and the names of all parent reflections.
Parameter separator
Separator used to join the names of the reflections.
Returns
The full name of this reflection.
method hasComment
hasComment: () => boolean;
Has this reflection a visible comment?
Returns
TRUE when this reflection has a visible comment.
method hasGetterOrSetter
hasGetterOrSetter: () => boolean;
method isDeclaration
isDeclaration: () => this is DeclarationReflection;
method isDeprecated
isDeprecated: () => boolean;
Check if this reflection or any of its parents have been marked with the
@deprecated
tag.
method isDocument
isDocument: () => this is DocumentReflection;
method isParameter
isParameter: () => this is ParameterReflection;
method isProject
isProject: () => this is ProjectReflection;
Return whether this reflection is the root / project reflection.
method isReference
isReference: () => this is ReferenceReflection;
method kindOf
kindOf: (kind: ReflectionKind | ReflectionKind[]) => boolean;
Test whether this reflection is of the given kind.
method setFlag
setFlag: (flag: ReflectionFlag, value?: boolean) => void;
Set a flag on this reflection.
method toObject
toObject: (serializer: Serializer) => JSONOutput.Reflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method toStringHierarchy
toStringHierarchy: (indent?: string) => string;
Return a string representation of this reflection and all of its children.
Note: This is intended as a debug tool only, output may change between patch versions.
Parameter indent
Used internally to indent child reflections.
method traverse
abstract traverse: (callback: TraverseCallback) => void;
Traverse most potential child reflections of this reflection.
Note: This may not necessarily traverse child reflections contained within the
type
property of the reflection, and should not be relied on for this. Support for checking object types will likely be removed in v0.27.The given callback will be invoked for all children, signatures and type parameters attached to this reflection.
Parameter callback
The callback function that should be applied for each child reflection.
method visit
visit: (visitor: ReflectionVisitor) => void;
class ReflectionCategory
class ReflectionCategory {}
A category of reflections.
Reflection categories are created by the ´CategoryPlugin´ in the resolving phase of the dispatcher. The main purpose of categories is to be able to more easily render human readable children lists in templates.
constructor
constructor(title: string);
Create a new ReflectionCategory instance.
Parameter title
The title of this category.
property children
children: (DeclarationReflection | DocumentReflection)[];
All reflections of this category.
property description
description?: CommentDisplayPart[];
The user specified description, if any, set with
@categoryDescription
property title
title: string;
The title, a string representation of this category.
method allChildrenHaveOwnDocument
allChildrenHaveOwnDocument: () => boolean;
Do all children of this category have a separate document?
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReflectionCategory) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReflectionCategory;
class ReflectionFlags
class ReflectionFlags {}
This must extend Array in order to work with Handlebar's each helper.
property isAbstract
readonly isAbstract: boolean;
property isConst
readonly isConst: boolean;
property isExternal
readonly isExternal: boolean;
Is this a declaration from an external document?
property isInherited
readonly isInherited: boolean;
property isOptional
readonly isOptional: boolean;
Whether this reflection is an optional component or not.
Applies to function parameters and object members.
property isPrivate
readonly isPrivate: boolean;
Is this a private member?
property isProtected
readonly isProtected: boolean;
Is this a protected member?
property isPublic
readonly isPublic: boolean;
Is this a public member?
property isReadonly
readonly isReadonly: boolean;
property isRest
readonly isRest: boolean;
Whether it's a rest parameter, like
foo(...params);
.
property isStatic
readonly isStatic: boolean;
Is this a static member?
method fromObject
fromObject: (obj: JSONOutput.ReflectionFlags) => void;
method getFlagStrings
getFlagStrings: (i18n: Internationalization) => TranslatedString[];
method hasFlag
hasFlag: (flag: ReflectionFlag) => boolean;
method setFlag
setFlag: (flag: ReflectionFlag, set: boolean) => void;
method toObject
toObject: () => JSONOutput.ReflectionFlags;
class ReflectionGroup
class ReflectionGroup {}
A group of reflections. All reflections in a group are of the same kind.
Reflection groups are created by the ´GroupHandler´ in the resolving phase of the dispatcher. The main purpose of groups is to be able to more easily render human readable children lists in templates.
constructor
constructor(title: string, owningReflection: Reflection);
Create a new ReflectionGroup instance.
Parameter title
The title of this group.
Parameter owningReflection
The reflection containing this group, useful for changing rendering based on a comment on a reflection.
property categories
categories?: ReflectionCategory[];
Categories contained within this group.
property children
children: (DeclarationReflection | DocumentReflection)[];
All reflections of this group.
property description
description?: CommentDisplayPart[];
User specified description via
@groupDescription
, if specified.
property owningReflection
readonly owningReflection: Reflection;
property title
title: string;
The title, a string representation of the typescript kind, of this group.
method allChildrenHaveOwnDocument
allChildrenHaveOwnDocument: () => boolean;
Do all children of this group have a separate document?
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReflectionGroup) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReflectionGroup;
class ReflectionSymbolId
class ReflectionSymbolId {}
This exists so that TypeDoc can store a unique identifier for a
ts.Symbol
without keeping a reference to thets.Symbol
itself. This identifier should be stable across runs so long as the symbol is exported from the same file.
constructor
constructor(symbol: ts.Symbol, declaration?: ts.Declaration);
constructor
constructor(json: JSONOutput.ReflectionSymbolId);
property fileName
readonly fileName: string;
property pos
pos: number;
Note: This is **not** serialized. It exists for sorting by declaration order, but should not be needed when deserializing from JSON. Will be set to
Infinity
if the ID was deserialized from JSON.
property qualifiedName
readonly qualifiedName: string;
property transientId
transientId: number;
Note: This is **not** serialized. It exists to support detection of the differences between symbols which share declarations, but are instantiated with different type parameters. This will be
NaN
if the symbol reference is not transient. Note: This can only be non-NaN if pos is finite.
method getStableKey
getStableKey: () => ReflectionSymbolIdString;
method toDeclarationReference
toDeclarationReference: () => DeclarationReference;
method toObject
toObject: (serializer: Serializer) => { sourceFileName: string; qualifiedName: string;};
class ReflectionType
class ReflectionType extends Type {}
Represents a type which has it's own reflection like literal types. This type will likely go away at some point and be replaced by a dedicated
ObjectType
. Allowing reflections to be nested within types causes much pain in the rendering code.let value: { a: string, b: number };Types
constructor
constructor(declaration: DeclarationReflection);
property declaration
declaration: DeclarationReflection;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReflectionType;
class Renderer
class Renderer extends AbstractComponent<Application, RendererEvents> {}
The renderer processes a ProjectReflection using a Theme instance and writes the emitted html documents to a output directory. You can specify which theme should be used using the
--theme <name>
command line argument.Renderer is a subclass of EventDispatcher and triggers a series of events while a project is being processed. You can listen to these events to control the flow or manipulate the output.
* Renderer.EVENT_BEGIN Triggered before the renderer starts rendering a project. The listener receives an instance of RendererEvent.
* Renderer.EVENT_BEGIN_PAGE Triggered before a document will be rendered. The listener receives an instance of PageEvent.
* Renderer.EVENT_END_PAGE Triggered after a document has been rendered, just before it is written to disc. The listener receives an instance of PageEvent.
* Renderer.EVENT_END Triggered after the renderer has written all documents. The listener receives an instance of RendererEvent.
* Renderer.EVENT_PREPARE_INDEX Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive an instance of IndexEvent.
Writes HTML output from TypeDoc's models Common
constructor
constructor(owner: Application);
property cacheBust
cacheBust: boolean;
property cleanOutputDir
cleanOutputDir: any;
property cname
cname: any;
property darkTheme
darkTheme: any;
property EVENT_BEGIN
static readonly EVENT_BEGIN: string;
property EVENT_BEGIN_PAGE
static readonly EVENT_BEGIN_PAGE: string;
property EVENT_END
static readonly EVENT_END: string;
property EVENT_END_PAGE
static readonly EVENT_END_PAGE: string;
property EVENT_PREPARE_INDEX
static readonly EVENT_PREPARE_INDEX: string;
property githubPages
githubPages: any;
property highlightLanguages
highlightLanguages: any;
property hooks
hooks: EventHooks<RendererHooks, JsxElement>;
Hooks which will be called when rendering pages. Note: - Hooks added during output will be discarded at the end of rendering. - Hooks added during a page render will be discarded at the end of that page's render.
See RendererHooks for a description of each available hook, and when it will be called.
property ignoredHighlightLanguages
ignoredHighlightLanguages: any;
property lightTheme
lightTheme: any;
property markedPlugin
markedPlugin: MarkedPlugin;
property postRenderAsyncJobs
postRenderAsyncJobs: ((output: RendererEvent) => Promise<void>)[];
A list of async jobs which must be completed after rendering output files but before generation is considered successful. These functions will be called after all documents have been written to the filesystem.
This may be used by plugins to register work that must be done to finalize output files. For example: asynchronously generating an image referenced in a render hook.
Note: This array is cleared after calling the contained functions on each Renderer.render call.
property preRenderAsyncJobs
preRenderAsyncJobs: ((output: RendererEvent) => Promise<void>)[];
A list of async jobs which must be completed *before* rendering output. They will be called after RendererEvent.BEGIN has fired, but before any files have been written.
This may be used by plugins to register work that must be done to prepare output files. For example: asynchronously transform markdown to HTML.
Note: This array is cleared after calling the contained functions on each Renderer.render call.
property pretty
pretty: any;
property renderStartTime
renderStartTime: number;
property theme
theme?: Theme;
The theme that is used to render the documentation.
property themeName
themeName: any;
method defineTheme
defineTheme: (name: string, theme: new (renderer: Renderer) => Theme) => void;
Define a new theme that can be used to render output. This API will likely be changing at some point, to allow more easily overriding parts of the theme without requiring additional boilerplate.
Parameter name
Parameter theme
method render
render: (project: ProjectReflection, outputDirectory: string) => Promise<void>;
Render the given project reflection to the specified output directory.
Parameter project
The project that should be rendered.
Parameter outputDirectory
The path of the directory the documentation should be rendered to.
class RendererEvent
class RendererEvent {}
An event emitted by the Renderer class at the very beginning and ending of the entire rendering process.
See Also
constructor
constructor(outputDirectory: string, project: ProjectReflection);
property BEGIN
static readonly BEGIN: string;
Triggered before the renderer starts rendering a project.
property END
static readonly END: string;
Triggered after the renderer has written all documents.
property outputDirectory
readonly outputDirectory: string;
The path of the directory the documentation should be written to.
property project
readonly project: ProjectReflection;
The project the renderer is currently processing.
property urls
urls?: UrlMapping<Reflection>[];
A list of all pages that should be generated.
This list can be altered during the Renderer.EVENT_BEGIN event.
class RestType
class RestType extends Type {}
Represents a rest type
type Z = [1, ...2[]]// ^^^^^^Types
constructor
constructor(elementType: SomeType);
property elementType
elementType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.RestType;
class SerializeEvent
class SerializeEvent {}
An event emitted by the Serializer class at the very beginning and ending of the a project serialization process.
See Also
constructor
constructor(project: ProjectReflection, output?: JSONProjectReflection);
property output
output: JSONProjectReflection;
property project
readonly project: ProjectReflection;
The project the renderer is currently processing.
class Serializer
class Serializer extends EventDispatcher<SerializerEvents> {}
Serializes TypeDoc's models to JSON
Common Serializes TypeDoc's models to JSON
property EVENT_BEGIN
static readonly EVENT_BEGIN: string;
Triggered when the Serializer begins transforming a project.
property EVENT_END
static readonly EVENT_END: string;
Triggered when the Serializer has finished transforming a project.
property project
project: ProjectReflection;
Only set when serializing
property projectRoot
projectRoot: string;
Only set when serializing.
method addSerializer
addSerializer: <T extends object>(serializer: SerializerComponent<T>) => void;
method projectToObject
projectToObject: ( value: ProjectReflection, projectRoot: string) => ModelToObject<ProjectReflection>;
Same as toObject but emits Serializer.EVENT_BEGIN and Serializer.EVENT_END events.
Parameter value
method removeSerializer
removeSerializer: (serializer: SerializerComponent<any>) => void;
method toObject
toObject: { <T extends { toObject(serializer: Serializer): ModelToObject<T> }>( value: T ): ModelToObject<T>; <T extends { toObject(serializer: Serializer): ModelToObject<T> }>( value: T ): ModelToObject<T>;};
method toObjectsOptional
toObjectsOptional: < T extends { toObject(serializer: Serializer): ModelToObject<T> }>( value: T[] | undefined) => ModelToObject<T>[] | undefined;
class SignatureReflection
class SignatureReflection extends Reflection {}
Reflections
constructor
constructor( name: string, kind: | ReflectionKind.CallSignature | ReflectionKind.IndexSignature | ReflectionKind.ConstructorSignature | ReflectionKind.GetSignature | ReflectionKind.SetSignature, parent: DeclarationReflection);
property implementationOf
implementationOf?: ReferenceType;
A type that points to the reflection this reflection is the implementation of.
Applies to class members.
property inheritedFrom
inheritedFrom?: ReferenceType;
A type that points to the reflection this reflection has been inherited from.
Applies to interface and class members.
property kind
kind: | ReflectionKind.CallSignature | ReflectionKind.IndexSignature | ReflectionKind.ConstructorSignature | ReflectionKind.GetSignature | ReflectionKind.SetSignature;
property overwrites
overwrites?: ReferenceType;
A type that points to the reflection that has been overwritten by this reflection.
Applies to interface and class members.
property parameters
parameters?: ParameterReflection[];
property parent
parent: DeclarationReflection;
property sources
sources?: SourceReference[];
A list of all source files that contributed to this reflection.
property type
type?: SomeType;
property typeParameters
typeParameters?: TypeParameterReflection[];
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.SignatureReflection) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.SignatureReflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method traverse
traverse: (callback: TraverseCallback) => void;
class Slugger
class Slugger {}
Responsible for getting a unique anchor for elements within a page.
constructor
constructor(options: { lowercase: boolean });
method getSimilarAnchors
getSimilarAnchors: (anchor: string) => string[];
method hasAnchor
hasAnchor: (anchor: string) => boolean;
method slug
slug: (value: string) => string;
class SourceReference
class SourceReference {}
Represents references of reflections to their defining source files.
See Also
constructor
constructor(fileName: string, line: number, character: number);
property character
character: number;
The index of the character that emitted the declaration.
property fileName
fileName: string;
The filename of the source file.
property line
line: number;
The one based number of the line that emitted the declaration.
property url
url?: string;
URL for displaying the source file.
method equals
equals: (other: SourceReference) => boolean;
method fromObject
fromObject: (_de: Deserializer, obj: JSONSourceReference) => void;
method toObject
toObject: () => JSONSourceReference;
class TemplateLiteralType
class TemplateLiteralType extends Type {}
TS 4.1 template literal types
type Z = `${'a' | 'b'}${'a' | 'b'}`Types
constructor
constructor(head: string, tail: [SomeType, string][]);
property head
head: string;
property tail
tail: [SomeType, string][];
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TemplateLiteralType;
class Theme
abstract class Theme extends RendererComponent {}
Base class of all themes.
The theme class controls which files will be created through the Theme.getUrls function. It returns an array of UrlMapping instances defining the target files, models and templates to use. Additionally themes can subscribe to the events emitted by Renderer to control and manipulate the output process.
method getSlugger
getSlugger: (reflection: Reflection) => Slugger;
method getUrls
abstract getUrls: (project: ProjectReflection) => UrlMapping<Reflection>[];
Map the models of the given project to the desired output files. It is assumed that with the project structure:
A|- B|- CIf
B
has a UrlMapping, thenA
also has a UrlMapping, andC
may or may not have a UrlMapping. IfB
does not have a UrlMapping, thenA
may or may not have a UrlMapping, butC
must not have a UrlMapping.Parameter project
The project whose urls should be generated.
Returns
A list of UrlMapping instances defining which models should be rendered to which files.
method render
abstract render: ( page: PageEvent<Reflection>, template: RenderTemplate<PageEvent<Reflection>>) => string;
Renders the provided page to a string, which will be written to disk by the Renderer
method setSlugger
setSlugger: (reflection: Reflection, slugger: Slugger) => void;
class TSConfigReader
class TSConfigReader implements OptionsReader {}
property name
name: string;
property order
order: number;
Note: Runs after the TypeDocReader.
property supportsPackages
supportsPackages: boolean;
method read
read: (container: Options, logger: Logger, cwd: string) => void;
class TupleType
class TupleType extends Type {}
Represents a tuple type.
let value: [string, boolean];Types
constructor
constructor(elements: SomeType[]);
Parameter elements
The ordered type elements of the tuple type.
property elements
elements: SomeType[];
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TupleType;
class Type
abstract class Type {}
Base class of all type definitions. Types
property type
abstract readonly type: keyof TypeKindMap;
The type name identifier.
method estimatePrintWidth
estimatePrintWidth: () => number;
Return the estimated size of the type if it was all printed on one line.
method fromObject
fromObject: (_de: Deserializer, _obj: JSONOutput.SomeType) => void;
method getTypeString
protected abstract getTypeString: () => string;
Implementation method for
toString
.needsParenthesis
will be used to determine if the returned string should be wrapped in parenthesis.
method needsParenthesis
abstract needsParenthesis: (context: TypeContext) => boolean;
method stringify
stringify: (context: TypeContext) => string;
method toObject
abstract toObject: (serializer: Serializer) => JSONOutput.SomeType;
method toString
toString: () => string;
Return a string representation of this type.
method visit
visit: { <T, A extends any[] = []>(visitor: TypeVisitor<T, A>, ...args: A): T; <T, A extends any[] = []>( visitor: Partial<TypeVisitor<T, A>>, ...args: A ): T;};
Visit this type, returning the value returned by the visitor.
class TypeDocReader
class TypeDocReader implements OptionsReader {}
Obtains option values from typedoc.json
property name
name: string;
property order
order: number;
Should run before the tsconfig reader so that it can specify a tsconfig file to read.
property supportsPackages
supportsPackages: boolean;
method read
read: (container: Options, logger: Logger, cwd: string) => Promise<void>;
Read user configuration from a typedoc.json or typedoc.js configuration file.
class TypeOperatorType
class TypeOperatorType extends Type {}
Represents a type operator type.
class A {}class B<T extends keyof A> {}Types
constructor
constructor(target: SomeType, operator: 'readonly' | 'keyof' | 'unique');
property operator
operator: 'readonly' | 'keyof' | 'unique';
property target
target: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TypeOperatorType;
class TypeParameterReflection
class TypeParameterReflection extends Reflection {}
Reflections
constructor
constructor( name: string, parent: Reflection, varianceModifier: VarianceModifier);
property default
default?: SomeType;
property parent
parent?: DeclarationReflection | SignatureReflection;
property type
type?: SomeType;
property varianceModifier
varianceModifier?: VarianceModifier;
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.TypeParameterReflection) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TypeParameterReflection;
method traverse
traverse: (_callback: TraverseCallback) => void;
class UnionType
class UnionType extends Type {}
Represents an union type.
let value: string | string[];Types
constructor
constructor(types: SomeType[]);
property elementSummaries
elementSummaries?: CommentDisplayPart[][];
If present, there should be as many items in this array as there are items in the types array.
This member is only valid on unions which are on with a ReflectionKind
kind
ofTypeAlias
. Specifying it on any other union is undefined behavior.
property type
readonly type: string;
property types
types: SomeType[];
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.UnionType) => void;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.UnionType;
class UnknownType
class UnknownType extends Type {}
Represents all unknown types that cannot be converted by TypeDoc. Types
constructor
constructor(name: string);
property name
name: string;
A string representation of the type as returned from TypeScript compiler.
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
Always returns true if not at the root level, we have no idea what's in here, so wrap it in parenthesis to be extra safe.
method toObject
toObject: () => JSONOutput.UnknownType;
class UrlMapping
class UrlMapping<Model = any> {}
constructor
constructor(url: string, model: {}, template: RenderTemplate<PageEvent<Model>>);
property model
model: {};
property template
template: RenderTemplate<PageEvent<Model>>;
property url
url: string;
class ValidatingFileRegistry
class ValidatingFileRegistry extends FileRegistry {}
method fromObject
fromObject: (de: Deserializer, obj: JSONFileRegistry) => void;
method register
register: ( sourcePath: string, relativePath: string) => { target: number; anchor: string | undefined } | undefined;
Interfaces
interface ApplicationEvents
interface ApplicationEvents {}
property bootstrapEnd
bootstrapEnd: [Application];
property reviveProject
reviveProject: [ProjectReflection];
property validateProject
validateProject: [ProjectReflection];
interface ArrayDeclarationOption
interface ArrayDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: readonly string[];
If not specified defaults to an empty array.
property type
type: | ParameterType.Array | ParameterType.PathArray | ParameterType.ModuleArray | ParameterType.GlobArray;
property validate
validate?: (value: string[], i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface BooleanDeclarationOption
interface BooleanDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: boolean;
If not specified defaults to false.
property type
type: ParameterType.Boolean;
interface CommentParserConfig
interface CommentParserConfig {}
property blockTags
blockTags: Set<string>;
property commentStyle
commentStyle: CommentStyle;
property inlineTags
inlineTags: Set<string>;
property jsDocCompatibility
jsDocCompatibility: JsDocCompatibility;
property modifierTags
modifierTags: Set<string>;
property suppressCommentWarningsInDeclarationFiles
suppressCommentWarningsInDeclarationFiles: boolean;
property useTsLinkResolution
useTsLinkResolution: boolean;
interface ComponentPath
interface ComponentPath {}
property navigation
navigation: '.' | '#' | '~';
How to resolve the
path
-.
- Navigate viaexports
of symbol -#
- Navigate viamembers
of symbol -~
- Navigate vialocals
of symbol (note: TypeDoc does not support locals, see the declaration reference docs)
property path
path: string;
interface ConverterEvents
interface ConverterEvents {}
property begin
begin: [Context];
property createDeclaration
createDeclaration: [Context, DeclarationReflection];
property createDocument
createDocument: [undefined, DocumentReflection];
property createParameter
createParameter: [Context, ParameterReflection, ts.Node?];
property createProject
createProject: [Context, ProjectReflection];
property createSignature
createSignature: [ Context, SignatureReflection, ( | ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature )?, ts.Signature?];
property createTypeParameter
createTypeParameter: [ Context, TypeParameterReflection, ts.TypeParameterDeclaration?];
property end
end: [Context];
property resolveBegin
resolveBegin: [Context];
property resolveEnd
resolveEnd: [Context];
property resolveReflection
resolveReflection: [Context, Reflection];
interface DeclarationHierarchy
interface DeclarationHierarchy {}
Stores hierarchical type data.
See Also
interface DeclarationOptionBase
interface DeclarationOptionBase {}
property configFileOnly
configFileOnly?: boolean;
If set, this option will be omitted from
--help
, and attempting to specify it on the command line will produce an error.
property help
help: NeverIfInternal<string> | ((i18n: TranslationProxy) => string);
The help text to be displayed to the user when --help is passed.
This may be a string, which will be presented directly, or a function, which will be called with an TranslationProxy so that option help can be translated into the user specified locale.
property name
name: string;
The option name.
property type
type?: ParameterType;
The parameter type, used to convert user configuration values into the expected type. If not set, the type will be a string.
interface DeclarationReference
interface DeclarationReference {}
property moduleSource
moduleSource?: string;
property resolutionStart
resolutionStart: 'global' | 'local';
property symbolReference
symbolReference?: SymbolReference;
interface Deserializable
interface Deserializable<T> {}
method fromObject
fromObject: (d: Deserializer, o: T) => void;
interface DeserializerComponent
interface DeserializerComponent {}
property priority
priority: number;
method fromObject
fromObject: (model: unknown, obj: unknown) => void;
method supports
supports: (model: unknown, obj: unknown) => boolean;
interface DocumentationEntryPoint
interface DocumentationEntryPoint {}
property displayName
displayName: string;
property program
program: ts.Program;
property sourceFile
sourceFile: ts.SourceFile;
interface FlagsDeclarationOption
interface FlagsDeclarationOption<T extends Record<string, boolean>> extends DeclarationOptionBase {}
interface InlineTagDisplayPart
interface InlineTagDisplayPart {}
Represents an inline tag like
{@link Foo}
The
@link
,@linkcode
, and@linkplain
tags may have atarget
property set indicating which reflection/url they link to. They may also have atsLinkText
property which includes the part of thetext
which TypeScript thinks should be displayed as the link text. Comments
property kind
kind: 'inline-tag';
property tag
tag: `@${string}`;
property target
target?: Reflection | string | ReflectionSymbolId;
property text
text: string;
property tsLinkText
tsLinkText?: string;
interface MapDeclarationOption
interface MapDeclarationOption<T> extends DeclarationOptionBase {}
property defaultValue
defaultValue: T;
Unlike the rest of the option types, there is no sensible generic default for mapped option types. The default value for a mapped type must be specified.
property map
map: Map<string, T> | Record<string | number, T>;
Maps a given value to the option type. The map type may be a TypeScript enum. In that case, when generating an error message for a mismatched key, the numeric keys will not be listed.
property type
type: ParameterType.Map;
interface Meaning
interface Meaning {}
interface MixedDeclarationOption
interface MixedDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: unknown;
If not specified defaults to undefined.
property type
type: ParameterType.Mixed;
property validate
validate?: (value: unknown, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface NavigationElement
interface NavigationElement {}
interface NumberDeclarationOption
interface NumberDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: number;
If not specified defaults to 0.
property maxValue
maxValue?: number;
Highest possible value.
property minValue
minValue?: number;
Lowest possible value.
property type
type: ParameterType.Number;
property validate
validate?: (value: number, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface ObjectDeclarationOption
interface ObjectDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: unknown;
If not specified defaults to undefined.
property type
type: ParameterType.Object;
property validate
validate?: (value: unknown, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface OptionsReader
interface OptionsReader {}
Describes an option reader that discovers user configuration and converts it to the TypeDoc format.
property name
readonly name: string;
The name of this reader so that it may be removed by plugins without the plugin accessing the instance performing the read. Multiple readers may have the same name.
property order
readonly order: number;
Readers will be processed according to their orders. A higher order indicates that the reader should be called *later*.
Note that to preserve expected behavior, the argv reader must have both the lowest order so that it may set the location of config files used by other readers and the highest order so that it can override settings from lower order readers.
property supportsPackages
readonly supportsPackages: boolean;
Flag to indicate that this reader should be included in sub-options objects created to read options for packages mode.
method read
read: (container: Options, logger: Logger, cwd: string) => void | Promise<void>;
Read options from the reader's source and place them in the options parameter. Options without a declared name may be treated as if they were declared with type ParameterType.Mixed. Options which have been declared must be converted to the correct type. As an alternative to doing this conversion in the reader, the reader may use Options.setValue, which will correctly convert values.
Parameter container
the options container that provides declarations
Parameter logger
logger to be used to report errors
Parameter cwd
the directory which should be treated as the current working directory for option file discovery
interface PageHeading
interface PageHeading {}
interface ParameterTypeToOptionTypeMap
interface ParameterTypeToOptionTypeMap {}
property [ParameterType.Array]
[ParameterType.Array]: string[];
property [ParameterType.Boolean]
[ParameterType.Boolean]: boolean;
property [ParameterType.Flags]
[ParameterType.Flags]: Record<string, boolean>;
property [ParameterType.GlobArray]
[ParameterType.GlobArray]: string[];
property [ParameterType.Map]
[ParameterType.Map]: unknown;
property [ParameterType.Mixed]
[ParameterType.Mixed]: unknown;
property [ParameterType.ModuleArray]
[ParameterType.ModuleArray]: string[];
property [ParameterType.Number]
[ParameterType.Number]: number;
property [ParameterType.Object]
[ParameterType.Object]: unknown;
property [ParameterType.Path]
[ParameterType.Path]: string;
property [ParameterType.PathArray]
[ParameterType.PathArray]: string[];
property [ParameterType.String]
[ParameterType.String]: string;
interface ReflectionVariant
interface ReflectionVariant {}
A map of known Reflection concrete subclasses. This is used during deserialization to reconstruct serialized objects.
property declaration
declaration: DeclarationReflection;
property document
document: DocumentReflection;
property param
param: ParameterReflection;
property project
project: ProjectReflection;
property reference
reference: ReferenceReflection;
property signature
signature: SignatureReflection;
property typeParam
typeParam: TypeParameterReflection;
interface RelativeLinkDisplayPart
interface RelativeLinkDisplayPart {}
Represents a reference to a path relative to where the comment resides. This is used to detect and copy relative image links.
Use FileRegistry to determine what path on disc this refers to.
This is used for relative links within comments/documents. It is used to mark pieces of text which need to be replaced to make links work properly. Comments
property kind
kind: 'relative-link';
property target
target: number | undefined;
A link to either some document outside of the project or a reflection. This may be
undefined
if the relative path does not exist.
property targetAnchor
targetAnchor: string | undefined;
Anchor within the target page, validated after rendering if possible
property text
text: string;
The original relative text from the parsed comment.
interface RendererEvents
interface RendererEvents {}
property beginPage
beginPage: [PageEvent<Reflection>];
property beginRender
beginRender: [RendererEvent];
property endPage
endPage: [PageEvent<Reflection>];
property endRender
endRender: [RendererEvent];
property parseMarkdown
parseMarkdown: [MarkdownEvent];
property prepareIndex
prepareIndex: [IndexEvent];
interface RendererHooks
interface RendererHooks {}
Describes the hooks available to inject output in the default theme. If the available hooks don't let you put something where you'd like, please open an issue!
property "body.begin"
'body.begin': [DefaultThemeRenderContext];
Applied immediately after the opening
<body>
tag.
property "body.end"
'body.end': [DefaultThemeRenderContext];
Applied immediately before the closing
</body>
tag.
property "comment.afterTags"
'comment.afterTags': [DefaultThemeRenderContext, Comment, Reflection];
Applied immediately after a comment's tags are rendered.
This may be used to set Models.CommentTag.skipRendering on any tags which should not be rendered as this hook is called before the tags are actually rendered.
property "comment.beforeTags"
'comment.beforeTags': [DefaultThemeRenderContext, Comment, Reflection];
Applied immediately before a comment's tags are rendered.
This may be used to set Models.CommentTag.skipRendering on any tags which should not be rendered.
property "content.begin"
'content.begin': [DefaultThemeRenderContext];
Applied immediately before the main template.
property "content.end"
'content.end': [DefaultThemeRenderContext];
Applied immediately after the main template.
property "footer.begin"
'footer.begin': [DefaultThemeRenderContext];
Applied immediately before the "Generated by TypeDoc" link in the footer.
property "footer.end"
'footer.end': [DefaultThemeRenderContext];
Applied immediately after the "Generated by TypeDoc" link in the footer.
property "head.begin"
'head.begin': [DefaultThemeRenderContext];
Applied immediately after the opening
<head>
tag.
property "head.end"
'head.end': [DefaultThemeRenderContext];
Applied immediately before the closing
</head>
tag.
property "pageSidebar.begin"
'pageSidebar.begin': [DefaultThemeRenderContext];
Applied immediately before calling
context.pageSidebar
.
property "pageSidebar.end"
'pageSidebar.end': [DefaultThemeRenderContext];
Applied immediately after calling
context.pageSidebar
.
property "sidebar.begin"
'sidebar.begin': [DefaultThemeRenderContext];
Applied immediately before calling
context.sidebar
.
property "sidebar.end"
'sidebar.end': [DefaultThemeRenderContext];
Applied immediately after calling
context.sidebar
.
interface SerializerComponent
interface SerializerComponent<T extends object> {}
Represents Serializer plugin component.
Like Converter plugins each Serializer plugin defines a predicate that instructs if an object can be serialized by it. This is done dynamically at runtime via a
supports
method.
property priority
readonly priority: number;
The priority this serializer should be executed with. A higher priority means the Serializer will be applied earlier.
method supports
supports: (item: unknown) => boolean;
Technically this should return
item is T
, but that doesn't play nicely with inference, so allow the looserboolean
return type.Parameter item
method toObject
toObject: ( item: T, obj: Partial<ModelToObject<T>>, serializer: Serializer) => Partial<ModelToObject<T>>;
interface SerializerEvents
interface SerializerEvents {}
interface StringDeclarationOption
interface StringDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: string;
If not specified defaults to the empty string for both
String
andPath
.
property hint
hint?: ParameterHint;
An optional hint for the type of input expected, will be displayed in the help output.
property outputShortcut
outputShortcut?: string;
If specified, when this output is specified TypeDoc will automatically add an output to the
outputs
option whose name is the value of this property with the path set to the value of this option. Should only be used withtype
set to ParameterType.Path.If any output shortcuts are set, the
outputs
option will be ignored.
property type
type?: ParameterType.String | ParameterType.Path;
Specifies the resolution strategy. If
Path
is provided, values will be resolved according to their location in a file. IfString
or no value is provided, values will not be resolved.
property validate
validate?: (value: string, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface SymbolReference
interface SymbolReference {}
interface TranslatableStrings
interface TranslatableStrings extends BuiltinTranslatableStringArgs {}
### What is translatable? TypeDoc includes a lot of literal strings. By convention, messages which are displayed to the user at the INFO level or above should be present in this object to be available for translation. Messages at the VERBOSE level need not be translated as they are primarily intended for debugging. ERROR/WARNING deprecation messages related to TypeDoc's API, or requesting users submit a bug report need not be translated.
Errors thrown by TypeDoc are generally *not* considered translatable as they are not displayed to the user. An exception to this is errors thrown by the
validate
method on options, as option readers will use them to report errors to the user.### Interface Keys This object uses a similar convention as TypeScript, where the specified key should indicate where placeholders are present by including a number in the name. This is so that translations can easily tell that they are including the appropriate placeholders. This will also be validated at runtime by the Internationalization class, but it's better to have that hint when editing as well.
This interface defines the available translatable strings, and the number of placeholders that are required to use each string. Plugins may use declaration merging to add members to this interface to use TypeDoc's internationalization module.
Example 1
declare module "typedoc" {interface TranslatableStrings {// Define a translatable string with no argumentsplugin_msg: [];// Define a translatable string requiring one argumentplugin_msg_0: [string];}}
interface TraverseCallback
interface TraverseCallback {}
call signature
(reflection: Reflection, property: TraverseProperty): | boolean | NeverIfInternal<void>;
May return false to bail out of any further iteration. To preserve backwards compatibility, if a function returns undefined, iteration must continue.
interface TypeDocOptionMap
interface TypeDocOptionMap {}
Describes all TypeDoc options. Used internally to provide better types when fetching options. External consumers should likely use TypeDocOptions instead.
If writing a plugin, you may find it useful to use declaration merging to add your options to this interface so that you have autocomplete when using
app.options.getValue
.declare module "typedoc" {export interface TypeDocOptionMap {pluginOption: string[];}}
property alwaysCreateEntryPointModule
alwaysCreateEntryPointModule: boolean;
property basePath
basePath: string;
property blockTags
blockTags: `@${string}`[];
property cacheBust
cacheBust: boolean;
property cascadedModifierTags
cascadedModifierTags: `@${string}`[];
property categorizeByGroup
categorizeByGroup: boolean;
property categoryOrder
categoryOrder: string[];
property cleanOutputDir
cleanOutputDir: boolean;
property cname
cname: string;
property commentStyle
commentStyle: typeof CommentStyle;
property compilerOptions
compilerOptions: unknown;
property customCss
customCss: string;
property customFooterHtml
customFooterHtml: string;
property customFooterHtmlDisableWrapper
customFooterHtmlDisableWrapper: boolean;
property customJs
customJs: string;
property darkHighlightTheme
darkHighlightTheme: ShikiTheme;
property defaultCategory
defaultCategory: string;
property disableGit
disableGit: boolean;
property disableSources
disableSources: boolean;
property emit
emit: typeof EmitStrategy;
property entryPoints
entryPoints: string[];
property entryPointStrategy
entryPointStrategy: typeof EntryPointStrategy;
property exclude
exclude: string[];
property excludeCategories
excludeCategories: string[];
property excludeExternals
excludeExternals: boolean;
property excludeInternal
excludeInternal: boolean;
property excludeNotDocumented
excludeNotDocumented: boolean;
property excludeNotDocumentedKinds
excludeNotDocumentedKinds: ReflectionKind.KindString[];
property excludePrivate
excludePrivate: boolean;
property excludeProtected
excludeProtected: boolean;
property excludeReferences
excludeReferences: boolean;
property excludeTags
excludeTags: `@${string}`[];
property externalPattern
externalPattern: string[];
property externalSymbolLinkMappings
externalSymbolLinkMappings: ManuallyValidatedOption< Record<string, Record<string, string>>>;
property favicon
favicon: string;
property githubPages
githubPages: boolean;
property gitRemote
gitRemote: string;
property gitRevision
gitRevision: string;
property groupOrder
groupOrder: string[];
property groupReferencesByType
groupReferencesByType: boolean;
property headings
headings: { readme: boolean; document: boolean;};
property help
help: boolean;
property hideGenerator
hideGenerator: boolean;
property highlightLanguages
highlightLanguages: string[];
property hostedBaseUrl
hostedBaseUrl: string;
property html
html: string;
property ignoredHighlightLanguages
ignoredHighlightLanguages: string[];
property includeHierarchySummary
includeHierarchySummary: boolean;
property includeVersion
includeVersion: boolean;
property inlineTags
inlineTags: `@${string}`[];
property intentionallyNotExported
intentionallyNotExported: string[];
property jsDocCompatibility
jsDocCompatibility: JsDocCompatibility;
property json
json: string;
property kindSortOrder
kindSortOrder: ReflectionKind.KindString[];
property lang
lang: string;
property lightHighlightTheme
lightHighlightTheme: ShikiTheme;
property locales
locales: ManuallyValidatedOption<Record<string, Record<string, string>>>;
property logLevel
logLevel: typeof LogLevel;
property markdownItLoader
markdownItLoader: ManuallyValidatedOption<(parser: any) => void>;
Will be called when TypeDoc is setting up the markdown parser to use to render markdown. Can be used to add markdown-it plugins to the parser with code like this:
// typedoc.config.mjsimport iterator from "markdown-it-for-inline";export default {/** @param {MarkdownIt} parser *\/markdownItLoader(parser) {parser.use(iterator, "foo_replace", "text", function(tokens, idx) {tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');});}}Note: Unfortunately, markdown-it doesn't ship its own types, so
parser
isn't strictly typed here.
property markdownItOptions
markdownItOptions: ManuallyValidatedOption<Record<string, unknown>>;
property markdownLinkExternal
markdownLinkExternal: boolean;
property maxTypeConversionDepth
maxTypeConversionDepth: number;
property modifierTags
modifierTags: `@${string}`[];
property name
name: string;
property navigation
navigation: { includeCategories: boolean; includeGroups: boolean; includeFolders: boolean; compactFolders: boolean; excludeReferences: boolean;};
property navigationLeaves
navigationLeaves: string[];
property navigationLinks
navigationLinks: ManuallyValidatedOption<Record<string, string>>;
property notRenderedTags
notRenderedTags: `@${string}`[];
property options
options: string;
property out
out: string;
property outputs
outputs: ManuallyValidatedOption<Array<OutputSpecification>>;
property packageOptions
packageOptions: ManuallyValidatedOption<TypeDocOptions>;
property plugin
plugin: string[];
property preserveLinkText
preserveLinkText: boolean;
property preserveWatchOutput
preserveWatchOutput: boolean;
property pretty
pretty: boolean;
property projectDocuments
projectDocuments: string[];
property readme
readme: string;
property requiredToBeDocumented
requiredToBeDocumented: ReflectionKind.KindString[];
property searchCategoryBoosts
searchCategoryBoosts: ManuallyValidatedOption<Record<string, number>>;
property searchGroupBoosts
searchGroupBoosts: ManuallyValidatedOption<Record<string, number>>;
property searchInComments
searchInComments: boolean;
property searchInDocuments
searchInDocuments: boolean;
property showConfig
showConfig: boolean;
property sidebarLinks
sidebarLinks: ManuallyValidatedOption<Record<string, string>>;
property skipErrorChecking
skipErrorChecking: boolean;
property sluggerConfiguration
sluggerConfiguration: { lowercase: boolean;};
property sort
sort: SortStrategy[];
property sortEntryPoints
sortEntryPoints: boolean;
property sourceLinkExternal
sourceLinkExternal: boolean;
property sourceLinkTemplate
sourceLinkTemplate: string;
property suppressCommentWarningsInDeclarationFiles
suppressCommentWarningsInDeclarationFiles: boolean;
property theme
theme: string;
property titleLink
titleLink: string;
property treatValidationWarningsAsErrors
treatValidationWarningsAsErrors: boolean;
property treatWarningsAsErrors
treatWarningsAsErrors: boolean;
property tsconfig
tsconfig: string;
property typePrintWidth
typePrintWidth: number;
property useFirstParagraphOfCommentAsSummary
useFirstParagraphOfCommentAsSummary: boolean;
property useHostedBaseUrlForAbsoluteLinks
useHostedBaseUrlForAbsoluteLinks: boolean;
property useTsLinkResolution
useTsLinkResolution: boolean;
property validation
validation: ValidationOptions;
property version
version: boolean;
property visibilityFilters
visibilityFilters: ManuallyValidatedOption<{ protected?: boolean; private?: boolean; inherited?: boolean; external?: boolean; [tag: `@${string}`]: boolean;}>;
property watch
watch: boolean;
interface TypeKindMap
interface TypeKindMap {}
Types
property array
array: ArrayType;
property conditional
conditional: ConditionalType;
property indexedAccess
indexedAccess: IndexedAccessType;
property inferred
inferred: InferredType;
property intersection
intersection: IntersectionType;
property intrinsic
intrinsic: IntrinsicType;
property literal
literal: LiteralType;
property mapped
mapped: MappedType;
property namedTupleMember
namedTupleMember: NamedTupleMember;
property optional
optional: OptionalType;
property predicate
predicate: PredicateType;
property query
query: QueryType;
property reference
reference: ReferenceType;
property reflection
reflection: ReflectionType;
property rest
rest: RestType;
property templateLiteral
templateLiteral: TemplateLiteralType;
property tuple
tuple: TupleType;
property typeOperator
typeOperator: TypeOperatorType;
property union
union: UnionType;
property unknown
unknown: UnknownType;
Enums
enum LogLevel
enum LogLevel { Verbose = 0, Info = 1, Warn = 2, Error = 3, None = 4,}
List of known log levels. Used to specify the urgency of a log message.
enum ParameterHint
enum ParameterHint { File = 0, Directory = 1,}
enum ParameterType
enum ParameterType { String = 0, Path = 1, Number = 2, Boolean = 3, Map = 4, Mixed = 5, Array = 6, PathArray = 7, ModuleArray = 8, GlobArray = 9, Object = 10, Flags = 11,}
member Array
Array = 6
member Boolean
Boolean = 3
member Flags
Flags = 11
An object with true/false flags
member GlobArray
GlobArray = 9
Resolved according to the config directory unless it starts with
**
, after skipping any leading!
and#
characters.
member Map
Map = 4
member Mixed
Mixed = 5
member ModuleArray
ModuleArray = 8
Resolved according to the config directory if it starts with
.
member Number
Number = 2
member Object
Object = 10
An object which partially merges user-set values into the defaults.
member Path
Path = 1
Resolved according to the config directory.
member PathArray
PathArray = 7
Resolved according to the config directory.
member String
String = 0
enum ReflectionFlag
enum ReflectionFlag { None = 0, Private = 1, Protected = 2, Public = 4, Static = 8, External = 16, Optional = 32, Rest = 64, Abstract = 128, Const = 256, Readonly = 512, Inherited = 1024,}
member Abstract
Abstract = 128
member Const
Const = 256
member External
External = 16
member Inherited
Inherited = 1024
member None
None = 0
member Optional
Optional = 32
member Private
Private = 1
member Protected
Protected = 2
member Public
Public = 4
member Readonly
Readonly = 512
member Rest
Rest = 64
member Static
Static = 8
enum ReflectionKind
enum ReflectionKind { Project = 1, Module = 2, Namespace = 4, Enum = 8, EnumMember = 16, Variable = 32, Function = 64, Class = 128, Interface = 256, Constructor = 512, Property = 1024, Method = 2048, CallSignature = 4096, IndexSignature = 8192, ConstructorSignature = 16384, Parameter = 32768, TypeLiteral = 65536, TypeParameter = 131072, Accessor = 262144, GetSignature = 524288, SetSignature = 1048576, TypeAlias = 2097152, Reference = 4194304, Document = 8388608,}
Defines the available reflection kinds. Reflections
member Accessor
Accessor = 262144
member CallSignature
CallSignature = 4096
member Class
Class = 128
member Constructor
Constructor = 512
member ConstructorSignature
ConstructorSignature = 16384
member Document
Document = 8388608
Generic non-ts content to be included in the generated docs as its own page.
member Enum
Enum = 8
member EnumMember
EnumMember = 16
member Function
Function = 64
member GetSignature
GetSignature = 524288
member IndexSignature
IndexSignature = 8192
member Interface
Interface = 256
member Method
Method = 2048
member Module
Module = 2
member Namespace
Namespace = 4
member Parameter
Parameter = 32768
member Project
Project = 1
member Property
Property = 1024
member Reference
Reference = 4194304
member SetSignature
SetSignature = 1048576
member TypeAlias
TypeAlias = 2097152
member TypeLiteral
TypeLiteral = 65536
member TypeParameter
TypeParameter = 131072
member Variable
Variable = 32
enum TraverseProperty
enum TraverseProperty { Children = 0, Documents = 1, Parameters = 2, TypeLiteral = 3, TypeParameter = 4, Signatures = 5, IndexSignature = 6, GetSignature = 7, SetSignature = 8,}
member Children
Children = 0
member Documents
Documents = 1
member GetSignature
GetSignature = 7
member IndexSignature
IndexSignature = 6
member Parameters
Parameters = 2
member SetSignature
SetSignature = 8
member Signatures
Signatures = 5
member TypeLiteral
TypeLiteral = 3
member TypeParameter
TypeParameter = 4
Type Aliases
type CommentDisplayPart
type CommentDisplayPart = /** * Represents a plain text portion of the comment, may contain markdown */ | { kind: 'text'; text: string; } /** * Represents a code block separated out form the plain text entry so * that TypeDoc knows to skip it when parsing relative links and inline tags. **/ | { kind: 'code'; text: string; } | InlineTagDisplayPart | RelativeLinkDisplayPart;
Represents a parsed piece of a comment. Comments
See Also
type CommentStyle
type CommentStyle = (typeof CommentStyle)[keyof typeof CommentStyle];
type DeclarationOption
type DeclarationOption = | StringDeclarationOption | NumberDeclarationOption | BooleanDeclarationOption | MixedDeclarationOption | ObjectDeclarationOption | MapDeclarationOption<unknown> | ArrayDeclarationOption | FlagsDeclarationOption<Record<string, boolean>>;
type DeclarationOptionToOptionType
type DeclarationOptionToOptionType<T extends DeclarationOption> = T extends MapDeclarationOption<infer U> ? U : T extends FlagsDeclarationOption<infer U> ? U : ParameterTypeToOptionTypeMap[Exclude<T['type'], undefined>];
type EntryPointStrategy
type EntryPointStrategy = (typeof EntryPointStrategy)[keyof typeof EntryPointStrategy];
type EnumKeys
type EnumKeys<E extends object> = { [K in keyof E]: number extends E[K] ? K : never;}[keyof E] & {};
type ExternalResolveResult
type ExternalResolveResult = { target: string; caption?: string;};
type ExternalSymbolResolver
type ExternalSymbolResolver = ( ref: DeclarationReference, refl: Reflection, part: Readonly<CommentDisplayPart> | undefined, symbolId: ReflectionSymbolId | undefined) => ExternalResolveResult | string | undefined;
Parameter ref
Parsed declaration reference to resolve. This may be created automatically for some symbol, or parsed from user input.
Parameter refl
Reflection that contains the resolved link
Parameter part
If the declaration reference was created from a comment, the originating part.
Parameter symbolId
If the declaration reference was created from a symbol, or
useTsLinkResolution
is turned on and TypeScript resolved the link to some symbol, the ID of that symbol.
type JsDocCompatibility
type JsDocCompatibility = { /** * If set, TypeDoc will treat `@example` blocks as code unless they contain a code block. * On by default, this is how VSCode renders blocks. */ exampleTag: boolean; /** * If set, TypeDoc will treat `@default` blocks as code unless they contain a code block. * On by default, this is how VSCode renders blocks. */ defaultTag: boolean; /** * If set, TypeDoc will warn if a `@inheritDoc` tag is spelled without TSDoc capitalization * (i.e. `@inheritdoc`). On by default. */ inheritDocTag: boolean; /** * If set, TypeDoc will not emit warnings about unescaped `{` and `}` characters encountered * when parsing a comment. On by default. */ ignoreUnescapedBraces: boolean;};
type KeyToDeclaration
type KeyToDeclaration<K extends keyof TypeDocOptionMap> = TypeDocOptionMap[K] extends boolean ? BooleanDeclarationOption : TypeDocOptionMap[K] extends string ? StringDeclarationOption : TypeDocOptionMap[K] extends number ? NumberDeclarationOption : TypeDocOptionMap[K] extends string[] ? ArrayDeclarationOption : unknown extends TypeDocOptionMap[K] ? MixedDeclarationOption | ObjectDeclarationOption : TypeDocOptionMap[K] extends ManuallyValidatedOption<unknown> ? | (MixedDeclarationOption & { validate(value: unknown, i18n: TranslationProxy): void; }) | (ObjectDeclarationOption & { validate(value: unknown, i18n: TranslationProxy): void; }) : TypeDocOptionMap[K] extends Record<string, boolean> ? FlagsDeclarationOption<TypeDocOptionMap[K]> : TypeDocOptionMap[K] extends Record<string | number, infer U> ? MapDeclarationOption<U> : never;
Converts a given TypeDoc option key to the type of the declaration expected.
type ManuallyValidatedOption
type ManuallyValidatedOption<T> = { __validated: T;};
Wrapper type for values in TypeDocOptionMap which are represented with an unknown option type, but have a validation function that checks that they are the given type.
type MeaningKeyword
type MeaningKeyword = (typeof MeaningKeywords)[number];
type OutputSpecification
type OutputSpecification = { name: string; path: string; options?: Partial<TypeDocOptions>;};
type ReflectionId
type ReflectionId = number & { __reflectionIdBrand: never;};
type ReflectionSymbolIdString
type ReflectionSymbolIdString = string & { readonly __reflectionSymbolId: unique symbol;};
type ReflectionVisitor
type ReflectionVisitor = { [K in keyof ReflectionVariant]?: (refl: ReflectionVariant[K]) => void;};
type RenderTemplate
type RenderTemplate<T> = (data: T) => JSX.Element | string;
Parameter data
the reflection to render
Returns
either a string to be written to the file, or an element to be serialized and then written.
type SomeReflection
type SomeReflection = ReflectionVariant[keyof ReflectionVariant];
type SomeType
type SomeType = TypeKindMap[keyof TypeKindMap];
Types
type SortStrategy
type SortStrategy = (typeof SORT_STRATEGIES)[number];
type TypeContext
type TypeContext = (typeof TypeContext)[keyof typeof TypeContext];
type TypeDocOptions
type TypeDocOptions = { [K in keyof TypeDocOptionMap]: unknown extends TypeDocOptionMap[K] ? unknown : TypeDocOptionMap[K] extends ManuallyValidatedOption< infer ManuallyValidated > ? ManuallyValidated : TypeDocOptionMap[K] extends string | string[] | number | boolean ? TypeDocOptionMap[K] : TypeDocOptionMap[K] extends Record<string, boolean> ? Partial<TypeDocOptionMap[K]> | boolean : keyof TypeDocOptionMap[K] | TypeDocOptionMap[K][keyof TypeDocOptionMap[K]];};
An interface describing all TypeDoc specific options. Generated from a map which contains more information about each option for better types when defining said options.
type TypeDocOptionValues
type TypeDocOptionValues = { [K in keyof TypeDocOptionMap]: unknown extends TypeDocOptionMap[K] ? unknown : TypeDocOptionMap[K] extends ManuallyValidatedOption< infer ManuallyValidated > ? ManuallyValidated : TypeDocOptionMap[K] extends | string | string[] | number | boolean | Record<string, boolean> ? TypeDocOptionMap[K] : TypeDocOptionMap[K][keyof TypeDocOptionMap[K]];};
Describes all TypeDoc specific options as returned by Options.getValue, this is slightly more restrictive than the TypeDocOptions since it does not allow both keys and values for mapped option types, and does not allow partials of flag values.
type TypeKind
type TypeKind = keyof TypeKindMap;
Types
type TypeVisitor
type TypeVisitor<T = void, A extends any[] = []> = { [K in TypeKind]: (type: TypeKindMap[K], ...args: A) => T;};
type ValidationOptions
type ValidationOptions = { /** * If set, TypeDoc will produce warnings when a symbol is referenced by the documentation, * but is not included in the documentation. */ notExported: boolean; /** * If set, TypeDoc will produce warnings about \{\@link\} tags which will produce broken links. */ invalidLink: boolean; /** * If set, TypeDoc will produce warnings about \{\@link\} tags which do not link directly to their target. */ rewrittenLink: boolean; /** * If set, TypeDoc will produce warnings about declarations that do not have doc comments */ notDocumented: boolean; /** * If set, TypeDoc will produce warnings about `@mergeModuleWith` tags which were not resolved. */ unusedMergeModuleWith: boolean;};
type VarianceModifier
type VarianceModifier = (typeof VarianceModifier)[keyof typeof VarianceModifier];
Namespaces
namespace Configuration
module 'dist/lib/utils/options/index.d.ts' {}
variable CommentStyle
const CommentStyle: { readonly JSDoc: 'jsdoc'; readonly Block: 'block'; readonly Line: 'line'; readonly All: 'all';};
Determines how TypeDoc searches for comments.
variable EmitStrategy
const EmitStrategy: { readonly both: 'both'; readonly docs: 'docs'; readonly none: 'none';};
function Option
Option: <K extends keyof TypeDocOptionMap>( name: K) => ( _: unknown, _context: ClassAccessorDecoratorContext< { application: Application } | { options: Options }, TypeDocOptionValues[K] >) => { get( this: { application: Application } | { options: Options } ): TypeDocOptionValues[K]; set(_value: never): never;};
Binds an option to an accessor. Does not register the option.
Note: This is a standard ES decorator. It will not work with pre-TS 5.0 experimental decorators enabled.
class ArgumentsReader
class ArgumentsReader implements OptionsReader {}
Obtains option values from command-line arguments
constructor
constructor(priority: number, args?: string[]);
property name
readonly name: string;
property order
readonly order: number;
property supportsPackages
readonly supportsPackages: boolean;
method read
read: (container: Options, logger: Logger) => void;
class Options
class Options {}
Maintains a collection of option declarations split into TypeDoc options and TypeScript options. Ensures options are of the correct type for calling code.
### Option Discovery
Since plugins commonly add custom options, and TypeDoc does not permit options which have not been declared to be set, options must be read twice. The first time options are read, a noop logger is passed so that any errors are ignored. Then, after loading plugins, options are read again, this time with the logger specified by the application.
Options are read in a specific order. 1. argv (0) - Must be read first since it should change the files read when passing --options or --tsconfig. 2. typedoc-json (100) - Read next so that it can specify the tsconfig.json file to read. 3. tsconfig-json (200) - Last config file reader, cannot specify the typedoc.json file to read. 4. argv (300) - Read argv again since any options set there should override those set in config files.
Common Contains all of TypeDoc's option declarations & values
constructor
constructor(i18n: TranslationProxy);
property packageDir
packageDir?: string;
In packages mode, the directory of the package being converted.
method addDeclaration
addDeclaration: { <K extends keyof TypeDocOptionMap>( declaration: { name: K } & KeyToDeclaration<K> ): void; (declaration: Readonly<DeclarationOption>): void;};
Adds an option declaration to the container with extra type checking to ensure that the runtime type is consistent with the declared type.
Parameter declaration
The option declaration that should be added.
Adds an option declaration to the container.
Parameter declaration
The option declaration that should be added.
method addReader
addReader: (reader: OptionsReader) => void;
Adds an option reader that will be used to read configuration values from the command line, configuration files, or other locations.
Parameter reader
method copyForPackage
copyForPackage: (packageDir: string) => Options;
Clones the options, intended for use in packages mode.
method getCompilerOptions
getCompilerOptions: () => ts.CompilerOptions;
Gets the set compiler options.
method getDeclaration
getDeclaration: (name: string) => Readonly<DeclarationOption> | undefined;
Gets a declaration by one of its names.
Parameter name
method getDeclarations
getDeclarations: () => Readonly<DeclarationOption>[];
Gets all declared options.
method getFileNames
getFileNames: () => readonly string[];
Gets the file names discovered through reading a tsconfig file.
method getHelp
getHelp: (i18n: TranslationProxy) => string;
Get the help message to be displayed to the user if
--help
is passed.
method getProjectReferences
getProjectReferences: () => readonly ts.ProjectReference[];
Gets the project references - used in solution style tsconfig setups.
method getRawValues
getRawValues: () => Readonly<Partial<TypeDocOptions>>;
Gets all of the TypeDoc option values defined in this option container.
method getSimilarOptions
getSimilarOptions: (missingName: string) => string[];
Discover similar option names to the given name, for use in error reporting.
method getValue
getValue: { <K extends keyof TypeDocOptionMap>(name: K): TypeDocOptionValues[K]; (name: string): unknown;};
Gets a value for the given option key, throwing if the option has not been declared.
Parameter name
method isSet
isSet: { (name: keyof TypeDocOptions): boolean; (name: string): boolean };
Checks if the given option's value is deeply strict equal to the default.
Parameter name
method read
read: (logger: Logger, cwd?: string) => Promise<void>;
method reset
reset: { (name?: keyof TypeDocOptions): void; (name?: string): void };
Resets the option bag to all default values. If a name is provided, will only reset that name.
method setCompilerOptions
setCompilerOptions: ( fileNames: readonly string[], options: ts.CompilerOptions, projectReferences: readonly ts.ProjectReference[] | undefined) => void;
Sets the compiler options that will be used to get a TS program.
method setValue
setValue: { <K extends keyof TypeDocOptionMap>( name: K, value: TypeDocOptions[K], configPath?: string ): void; (name: string, value: unknown, configPath?: string): void;};
Sets the given declared option. Throws if setting the option fails.
Parameter name
Parameter value
Parameter configPath
the directory to resolve Path type values against
class PackageJsonReader
class PackageJsonReader implements OptionsReader {}
property name
name: string;
property order
order: number;
property supportsPackages
supportsPackages: boolean;
method read
read: (container: Options, logger: Logger, cwd: string) => void;
class TSConfigReader
class TSConfigReader implements OptionsReader {}
property name
name: string;
property order
order: number;
Note: Runs after the TypeDocReader.
property supportsPackages
supportsPackages: boolean;
method read
read: (container: Options, logger: Logger, cwd: string) => void;
class TypeDocReader
class TypeDocReader implements OptionsReader {}
Obtains option values from typedoc.json
property name
name: string;
property order
order: number;
Should run before the tsconfig reader so that it can specify a tsconfig file to read.
property supportsPackages
supportsPackages: boolean;
method read
read: (container: Options, logger: Logger, cwd: string) => Promise<void>;
Read user configuration from a typedoc.json or typedoc.js configuration file.
interface ArrayDeclarationOption
interface ArrayDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: readonly string[];
If not specified defaults to an empty array.
property type
type: | ParameterType.Array | ParameterType.PathArray | ParameterType.ModuleArray | ParameterType.GlobArray;
property validate
validate?: (value: string[], i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface BooleanDeclarationOption
interface BooleanDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: boolean;
If not specified defaults to false.
property type
type: ParameterType.Boolean;
interface DeclarationOptionBase
interface DeclarationOptionBase {}
property configFileOnly
configFileOnly?: boolean;
If set, this option will be omitted from
--help
, and attempting to specify it on the command line will produce an error.
property help
help: NeverIfInternal<string> | ((i18n: TranslationProxy) => string);
The help text to be displayed to the user when --help is passed.
This may be a string, which will be presented directly, or a function, which will be called with an TranslationProxy so that option help can be translated into the user specified locale.
property name
name: string;
The option name.
property type
type?: ParameterType;
The parameter type, used to convert user configuration values into the expected type. If not set, the type will be a string.
interface FlagsDeclarationOption
interface FlagsDeclarationOption<T extends Record<string, boolean>> extends DeclarationOptionBase {}
interface MapDeclarationOption
interface MapDeclarationOption<T> extends DeclarationOptionBase {}
property defaultValue
defaultValue: T;
Unlike the rest of the option types, there is no sensible generic default for mapped option types. The default value for a mapped type must be specified.
property map
map: Map<string, T> | Record<string | number, T>;
Maps a given value to the option type. The map type may be a TypeScript enum. In that case, when generating an error message for a mismatched key, the numeric keys will not be listed.
property type
type: ParameterType.Map;
interface MixedDeclarationOption
interface MixedDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: unknown;
If not specified defaults to undefined.
property type
type: ParameterType.Mixed;
property validate
validate?: (value: unknown, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface NumberDeclarationOption
interface NumberDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: number;
If not specified defaults to 0.
property maxValue
maxValue?: number;
Highest possible value.
property minValue
minValue?: number;
Lowest possible value.
property type
type: ParameterType.Number;
property validate
validate?: (value: number, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface ObjectDeclarationOption
interface ObjectDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: unknown;
If not specified defaults to undefined.
property type
type: ParameterType.Object;
property validate
validate?: (value: unknown, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface OptionsReader
interface OptionsReader {}
Describes an option reader that discovers user configuration and converts it to the TypeDoc format.
property name
readonly name: string;
The name of this reader so that it may be removed by plugins without the plugin accessing the instance performing the read. Multiple readers may have the same name.
property order
readonly order: number;
Readers will be processed according to their orders. A higher order indicates that the reader should be called *later*.
Note that to preserve expected behavior, the argv reader must have both the lowest order so that it may set the location of config files used by other readers and the highest order so that it can override settings from lower order readers.
property supportsPackages
readonly supportsPackages: boolean;
Flag to indicate that this reader should be included in sub-options objects created to read options for packages mode.
method read
read: (container: Options, logger: Logger, cwd: string) => void | Promise<void>;
Read options from the reader's source and place them in the options parameter. Options without a declared name may be treated as if they were declared with type ParameterType.Mixed. Options which have been declared must be converted to the correct type. As an alternative to doing this conversion in the reader, the reader may use Options.setValue, which will correctly convert values.
Parameter container
the options container that provides declarations
Parameter logger
logger to be used to report errors
Parameter cwd
the directory which should be treated as the current working directory for option file discovery
interface ParameterTypeToOptionTypeMap
interface ParameterTypeToOptionTypeMap {}
property [ParameterType.Array]
[ParameterType.Array]: string[];
property [ParameterType.Boolean]
[ParameterType.Boolean]: boolean;
property [ParameterType.Flags]
[ParameterType.Flags]: Record<string, boolean>;
property [ParameterType.GlobArray]
[ParameterType.GlobArray]: string[];
property [ParameterType.Map]
[ParameterType.Map]: unknown;
property [ParameterType.Mixed]
[ParameterType.Mixed]: unknown;
property [ParameterType.ModuleArray]
[ParameterType.ModuleArray]: string[];
property [ParameterType.Number]
[ParameterType.Number]: number;
property [ParameterType.Object]
[ParameterType.Object]: unknown;
property [ParameterType.Path]
[ParameterType.Path]: string;
property [ParameterType.PathArray]
[ParameterType.PathArray]: string[];
property [ParameterType.String]
[ParameterType.String]: string;
interface StringDeclarationOption
interface StringDeclarationOption extends DeclarationOptionBase {}
property defaultValue
defaultValue?: string;
If not specified defaults to the empty string for both
String
andPath
.
property hint
hint?: ParameterHint;
An optional hint for the type of input expected, will be displayed in the help output.
property outputShortcut
outputShortcut?: string;
If specified, when this output is specified TypeDoc will automatically add an output to the
outputs
option whose name is the value of this property with the path set to the value of this option. Should only be used withtype
set to ParameterType.Path.If any output shortcuts are set, the
outputs
option will be ignored.
property type
type?: ParameterType.String | ParameterType.Path;
Specifies the resolution strategy. If
Path
is provided, values will be resolved according to their location in a file. IfString
or no value is provided, values will not be resolved.
property validate
validate?: (value: string, i18n: TranslationProxy) => void;
An optional validation function that validates a potential value of this option. The function must throw an Error if the validation fails and should do nothing otherwise.
interface TypeDocOptionMap
interface TypeDocOptionMap {}
Describes all TypeDoc options. Used internally to provide better types when fetching options. External consumers should likely use TypeDocOptions instead.
If writing a plugin, you may find it useful to use declaration merging to add your options to this interface so that you have autocomplete when using
app.options.getValue
.declare module "typedoc" {export interface TypeDocOptionMap {pluginOption: string[];}}
property alwaysCreateEntryPointModule
alwaysCreateEntryPointModule: boolean;
property basePath
basePath: string;
property blockTags
blockTags: `@${string}`[];
property cacheBust
cacheBust: boolean;
property cascadedModifierTags
cascadedModifierTags: `@${string}`[];
property categorizeByGroup
categorizeByGroup: boolean;
property categoryOrder
categoryOrder: string[];
property cleanOutputDir
cleanOutputDir: boolean;
property cname
cname: string;
property commentStyle
commentStyle: typeof CommentStyle;
property compilerOptions
compilerOptions: unknown;
property customCss
customCss: string;
property customFooterHtml
customFooterHtml: string;
property customFooterHtmlDisableWrapper
customFooterHtmlDisableWrapper: boolean;
property customJs
customJs: string;
property darkHighlightTheme
darkHighlightTheme: ShikiTheme;
property defaultCategory
defaultCategory: string;
property disableGit
disableGit: boolean;
property disableSources
disableSources: boolean;
property emit
emit: typeof EmitStrategy;
property entryPoints
entryPoints: string[];
property entryPointStrategy
entryPointStrategy: typeof EntryPointStrategy;
property exclude
exclude: string[];
property excludeCategories
excludeCategories: string[];
property excludeExternals
excludeExternals: boolean;
property excludeInternal
excludeInternal: boolean;
property excludeNotDocumented
excludeNotDocumented: boolean;
property excludeNotDocumentedKinds
excludeNotDocumentedKinds: ReflectionKind.KindString[];
property excludePrivate
excludePrivate: boolean;
property excludeProtected
excludeProtected: boolean;
property excludeReferences
excludeReferences: boolean;
property excludeTags
excludeTags: `@${string}`[];
property externalPattern
externalPattern: string[];
property externalSymbolLinkMappings
externalSymbolLinkMappings: ManuallyValidatedOption< Record<string, Record<string, string>>>;
property favicon
favicon: string;
property githubPages
githubPages: boolean;
property gitRemote
gitRemote: string;
property gitRevision
gitRevision: string;
property groupOrder
groupOrder: string[];
property groupReferencesByType
groupReferencesByType: boolean;
property headings
headings: { readme: boolean; document: boolean;};
property help
help: boolean;
property hideGenerator
hideGenerator: boolean;
property highlightLanguages
highlightLanguages: string[];
property hostedBaseUrl
hostedBaseUrl: string;
property html
html: string;
property ignoredHighlightLanguages
ignoredHighlightLanguages: string[];
property includeHierarchySummary
includeHierarchySummary: boolean;
property includeVersion
includeVersion: boolean;
property inlineTags
inlineTags: `@${string}`[];
property intentionallyNotExported
intentionallyNotExported: string[];
property jsDocCompatibility
jsDocCompatibility: JsDocCompatibility;
property json
json: string;
property kindSortOrder
kindSortOrder: ReflectionKind.KindString[];
property lang
lang: string;
property lightHighlightTheme
lightHighlightTheme: ShikiTheme;
property locales
locales: ManuallyValidatedOption<Record<string, Record<string, string>>>;
property logLevel
logLevel: typeof LogLevel;
property markdownItLoader
markdownItLoader: ManuallyValidatedOption<(parser: any) => void>;
Will be called when TypeDoc is setting up the markdown parser to use to render markdown. Can be used to add markdown-it plugins to the parser with code like this:
// typedoc.config.mjsimport iterator from "markdown-it-for-inline";export default {/** @param {MarkdownIt} parser *\/markdownItLoader(parser) {parser.use(iterator, "foo_replace", "text", function(tokens, idx) {tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');});}}Note: Unfortunately, markdown-it doesn't ship its own types, so
parser
isn't strictly typed here.
property markdownItOptions
markdownItOptions: ManuallyValidatedOption<Record<string, unknown>>;
property markdownLinkExternal
markdownLinkExternal: boolean;
property maxTypeConversionDepth
maxTypeConversionDepth: number;
property modifierTags
modifierTags: `@${string}`[];
property name
name: string;
property navigation
navigation: { includeCategories: boolean; includeGroups: boolean; includeFolders: boolean; compactFolders: boolean; excludeReferences: boolean;};
property navigationLeaves
navigationLeaves: string[];
property navigationLinks
navigationLinks: ManuallyValidatedOption<Record<string, string>>;
property notRenderedTags
notRenderedTags: `@${string}`[];
property options
options: string;
property out
out: string;
property outputs
outputs: ManuallyValidatedOption<Array<OutputSpecification>>;
property packageOptions
packageOptions: ManuallyValidatedOption<TypeDocOptions>;
property plugin
plugin: string[];
property preserveLinkText
preserveLinkText: boolean;
property preserveWatchOutput
preserveWatchOutput: boolean;
property pretty
pretty: boolean;
property projectDocuments
projectDocuments: string[];
property readme
readme: string;
property requiredToBeDocumented
requiredToBeDocumented: ReflectionKind.KindString[];
property searchCategoryBoosts
searchCategoryBoosts: ManuallyValidatedOption<Record<string, number>>;
property searchGroupBoosts
searchGroupBoosts: ManuallyValidatedOption<Record<string, number>>;
property searchInComments
searchInComments: boolean;
property searchInDocuments
searchInDocuments: boolean;
property showConfig
showConfig: boolean;
property sidebarLinks
sidebarLinks: ManuallyValidatedOption<Record<string, string>>;
property skipErrorChecking
skipErrorChecking: boolean;
property sluggerConfiguration
sluggerConfiguration: { lowercase: boolean;};
property sort
sort: SortStrategy[];
property sortEntryPoints
sortEntryPoints: boolean;
property sourceLinkExternal
sourceLinkExternal: boolean;
property sourceLinkTemplate
sourceLinkTemplate: string;
property suppressCommentWarningsInDeclarationFiles
suppressCommentWarningsInDeclarationFiles: boolean;
property theme
theme: string;
property titleLink
titleLink: string;
property treatValidationWarningsAsErrors
treatValidationWarningsAsErrors: boolean;
property treatWarningsAsErrors
treatWarningsAsErrors: boolean;
property tsconfig
tsconfig: string;
property typePrintWidth
typePrintWidth: number;
property useFirstParagraphOfCommentAsSummary
useFirstParagraphOfCommentAsSummary: boolean;
property useHostedBaseUrlForAbsoluteLinks
useHostedBaseUrlForAbsoluteLinks: boolean;
property useTsLinkResolution
useTsLinkResolution: boolean;
property validation
validation: ValidationOptions;
property version
version: boolean;
property visibilityFilters
visibilityFilters: ManuallyValidatedOption<{ protected?: boolean; private?: boolean; inherited?: boolean; external?: boolean; [tag: `@${string}`]: boolean;}>;
property watch
watch: boolean;
enum ParameterHint
enum ParameterHint { File = 0, Directory = 1,}
enum ParameterType
enum ParameterType { String = 0, Path = 1, Number = 2, Boolean = 3, Map = 4, Mixed = 5, Array = 6, PathArray = 7, ModuleArray = 8, GlobArray = 9, Object = 10, Flags = 11,}
member Array
Array = 6
member Boolean
Boolean = 3
member Flags
Flags = 11
An object with true/false flags
member GlobArray
GlobArray = 9
Resolved according to the config directory unless it starts with
**
, after skipping any leading!
and#
characters.
member Map
Map = 4
member Mixed
Mixed = 5
member ModuleArray
ModuleArray = 8
Resolved according to the config directory if it starts with
.
member Number
Number = 2
member Object
Object = 10
An object which partially merges user-set values into the defaults.
member Path
Path = 1
Resolved according to the config directory.
member PathArray
PathArray = 7
Resolved according to the config directory.
member String
String = 0
type CommentStyle
type CommentStyle = (typeof CommentStyle)[keyof typeof CommentStyle];
type DeclarationOption
type DeclarationOption = | StringDeclarationOption | NumberDeclarationOption | BooleanDeclarationOption | MixedDeclarationOption | ObjectDeclarationOption | MapDeclarationOption<unknown> | ArrayDeclarationOption | FlagsDeclarationOption<Record<string, boolean>>;
type DeclarationOptionToOptionType
type DeclarationOptionToOptionType<T extends DeclarationOption> = T extends MapDeclarationOption<infer U> ? U : T extends FlagsDeclarationOption<infer U> ? U : ParameterTypeToOptionTypeMap[Exclude<T['type'], undefined>];
type EmitStrategy
type EmitStrategy = (typeof EmitStrategy)[keyof typeof EmitStrategy];
type JsDocCompatibility
type JsDocCompatibility = { /** * If set, TypeDoc will treat `@example` blocks as code unless they contain a code block. * On by default, this is how VSCode renders blocks. */ exampleTag: boolean; /** * If set, TypeDoc will treat `@default` blocks as code unless they contain a code block. * On by default, this is how VSCode renders blocks. */ defaultTag: boolean; /** * If set, TypeDoc will warn if a `@inheritDoc` tag is spelled without TSDoc capitalization * (i.e. `@inheritdoc`). On by default. */ inheritDocTag: boolean; /** * If set, TypeDoc will not emit warnings about unescaped `{` and `}` characters encountered * when parsing a comment. On by default. */ ignoreUnescapedBraces: boolean;};
type KeyToDeclaration
type KeyToDeclaration<K extends keyof TypeDocOptionMap> = TypeDocOptionMap[K] extends boolean ? BooleanDeclarationOption : TypeDocOptionMap[K] extends string ? StringDeclarationOption : TypeDocOptionMap[K] extends number ? NumberDeclarationOption : TypeDocOptionMap[K] extends string[] ? ArrayDeclarationOption : unknown extends TypeDocOptionMap[K] ? MixedDeclarationOption | ObjectDeclarationOption : TypeDocOptionMap[K] extends ManuallyValidatedOption<unknown> ? | (MixedDeclarationOption & { validate(value: unknown, i18n: TranslationProxy): void; }) | (ObjectDeclarationOption & { validate(value: unknown, i18n: TranslationProxy): void; }) : TypeDocOptionMap[K] extends Record<string, boolean> ? FlagsDeclarationOption<TypeDocOptionMap[K]> : TypeDocOptionMap[K] extends Record<string | number, infer U> ? MapDeclarationOption<U> : never;
Converts a given TypeDoc option key to the type of the declaration expected.
type ManuallyValidatedOption
type ManuallyValidatedOption<T> = { __validated: T;};
Wrapper type for values in TypeDocOptionMap which are represented with an unknown option type, but have a validation function that checks that they are the given type.
type OutputSpecification
type OutputSpecification = { name: string; path: string; options?: Partial<TypeDocOptions>;};
type TypeDocOptions
type TypeDocOptions = { [K in keyof TypeDocOptionMap]: unknown extends TypeDocOptionMap[K] ? unknown : TypeDocOptionMap[K] extends ManuallyValidatedOption< infer ManuallyValidated > ? ManuallyValidated : TypeDocOptionMap[K] extends string | string[] | number | boolean ? TypeDocOptionMap[K] : TypeDocOptionMap[K] extends Record<string, boolean> ? Partial<TypeDocOptionMap[K]> | boolean : keyof TypeDocOptionMap[K] | TypeDocOptionMap[K][keyof TypeDocOptionMap[K]];};
An interface describing all TypeDoc specific options. Generated from a map which contains more information about each option for better types when defining said options.
type TypeDocOptionValues
type TypeDocOptionValues = { [K in keyof TypeDocOptionMap]: unknown extends TypeDocOptionMap[K] ? unknown : TypeDocOptionMap[K] extends ManuallyValidatedOption< infer ManuallyValidated > ? ManuallyValidated : TypeDocOptionMap[K] extends | string | string[] | number | boolean | Record<string, boolean> ? TypeDocOptionMap[K] : TypeDocOptionMap[K][keyof TypeDocOptionMap[K]];};
Describes all TypeDoc specific options as returned by Options.getValue, this is slightly more restrictive than the TypeDocOptions since it does not allow both keys and values for mapped option types, and does not allow partials of flag values.
type ValidationOptions
type ValidationOptions = { /** * If set, TypeDoc will produce warnings when a symbol is referenced by the documentation, * but is not included in the documentation. */ notExported: boolean; /** * If set, TypeDoc will produce warnings about \{\@link\} tags which will produce broken links. */ invalidLink: boolean; /** * If set, TypeDoc will produce warnings about \{\@link\} tags which do not link directly to their target. */ rewrittenLink: boolean; /** * If set, TypeDoc will produce warnings about declarations that do not have doc comments */ notDocumented: boolean; /** * If set, TypeDoc will produce warnings about `@mergeModuleWith` tags which were not resolved. */ unusedMergeModuleWith: boolean;};
namespace OptionDefaults
module 'dist/lib/utils/options/defaults.d.ts' {}
Defaults values for TypeDoc options
variable blockTags
const blockTags: readonly `@${string}`[];
variable cascadedModifierTags
const cascadedModifierTags: readonly `@${string}`[];
variable excludeNotDocumentedKinds
const excludeNotDocumentedKinds: readonly EnumKeys<typeof ReflectionKind>[];
variable excludeTags
const excludeTags: readonly `@${string}`[];
variable highlightLanguages
const highlightLanguages: readonly BundledLanguage[];
variable ignoredHighlightLanguages
const ignoredHighlightLanguages: readonly string[];
variable inlineTags
const inlineTags: readonly `@${string}`[];
variable kindSortOrder
const kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[];
variable modifierTags
const modifierTags: readonly `@${string}`[];
variable notRenderedTags
const notRenderedTags: readonly `@${string}`[];
variable requiredToBeDocumented
const requiredToBeDocumented: readonly EnumKeys<typeof ReflectionKind>[];
variable sort
const sort: readonly string[];
namespace Internationalization
module 'dist/lib/internationalization/index.d.ts' {}
Internationalization module for localized strings in output. Internationalization module for localized strings in output.
class Internationalization
class Internationalization {}
Simple internationalization module which supports placeholders. See TranslatableStrings for a description of how this module works and how plugins should add translations.
property proxy
proxy: TranslationProxy;
Proxy object which supports dynamically translating all supported keys. This is generally used rather than the translate method so that renaming a key on the
translatable
object that contains all of the default translations will automatically update usage locations.
method addTranslations
addTranslations: ( lang: string, translations: Partial<Record<keyof TranslatableStrings, string>>, override?: boolean) => void;
Add translations for a string which will be displayed to the user.
method flagString
flagString: (flag: ReflectionFlag) => TranslatedString;
method getSupportedLanguages
getSupportedLanguages: () => string[];
Gets a list of all languages with at least one translation.
method hasTranslations
hasTranslations: (lang: string) => boolean;
Checks if we have any translations in the specified language.
method kindPluralString
kindPluralString: (kind: ReflectionKind) => TranslatedString;
method kindSingularString
kindSingularString: (kind: ReflectionKind) => TranslatedString;
method translate
translate: <T extends keyof TranslatableStrings>( key: T, ...args: TranslatableStrings[T]) => TranslatedString;
Get the translation of the specified key, replacing placeholders with the arguments specified.
method translateTagName
translateTagName: (tag: `@${string}`) => TranslatedString;
interface TranslatableStrings
interface TranslatableStrings extends BuiltinTranslatableStringArgs {}
### What is translatable? TypeDoc includes a lot of literal strings. By convention, messages which are displayed to the user at the INFO level or above should be present in this object to be available for translation. Messages at the VERBOSE level need not be translated as they are primarily intended for debugging. ERROR/WARNING deprecation messages related to TypeDoc's API, or requesting users submit a bug report need not be translated.
Errors thrown by TypeDoc are generally *not* considered translatable as they are not displayed to the user. An exception to this is errors thrown by the
validate
method on options, as option readers will use them to report errors to the user.### Interface Keys This object uses a similar convention as TypeScript, where the specified key should indicate where placeholders are present by including a number in the name. This is so that translations can easily tell that they are including the appropriate placeholders. This will also be validated at runtime by the Internationalization class, but it's better to have that hint when editing as well.
This interface defines the available translatable strings, and the number of placeholders that are required to use each string. Plugins may use declaration merging to add members to this interface to use TypeDoc's internationalization module.
Example 1
declare module "typedoc" {interface TranslatableStrings {// Define a translatable string with no argumentsplugin_msg: [];// Define a translatable string requiring one argumentplugin_msg_0: [string];}}
type TranslatedString
type TranslatedString = string & { [TranslatedString]: true;};
type TranslationProxy
type TranslationProxy = { [K in keyof TranslatableStrings]: ( ...args: TranslatableStrings[K] ) => TranslatedString;};
Dynamic proxy type built from TranslatableStrings
namespace JSONOutput
module 'dist/lib/serialization/schema.d.ts' {}
Contains interfaces which describe the JSON output. Each interface is related to a specific type of serializer.
## Plugins Plugins which modify the serialization process can use declaration merging to add custom properties to the exported interfaces. For example, if your custom serializer adds a property to all Reflection objects:
declare module 'typedoc/dist/lib/serialization/schema' {export interface AbstractReflection {myCustomProp: boolean}}If a plugin defines a new Model type, ModelToObject will not pick up the serializer type and the resulting type will not be included in the return type of Serializer.toObject. To fix this, use declaration merging to augment the Serializer class.
declare module 'typedoc/dist/lib/serialization/serializer' {export interface Serializer {toObject(value: CustomModel, obj?: Partial<CustomModel>): CustomOutput}}For documentation on the JSON output properties, view the corresponding model. Contains interfaces which describe the JSON output.
interface ArrayType
interface ArrayType extends Type, S<M.ArrayType, 'type' | 'elementType'> {}
Types
interface Comment
interface Comment extends Partial<S<M.Comment, 'blockTags' | 'label'>> {}
Comments
property modifierTags
modifierTags?: `@${string}`[];
property summary
summary: CommentDisplayPart[];
interface CommentTag
interface CommentTag extends S<M.CommentTag, 'tag' | 'name'> {}
Comments
property content
content: CommentDisplayPart[];
interface ConditionalType
interface ConditionalType extends Type, S< M.ConditionalType, 'type' | 'checkType' | 'extendsType' | 'trueType' | 'falseType' > {}
Types
interface ContainerReflection
interface ContainerReflection extends Reflection, S< M.ContainerReflection, 'children' | 'documents' | 'groups' | 'categories' > {}
Reflections
property childrenIncludingDocuments
childrenIncludingDocuments?: number[];
interface DeclarationReflection
interface DeclarationReflection extends Omit<ContainerReflection, 'variant'>, S< M.DeclarationReflection, | 'variant' | 'packageVersion' | 'sources' | 'relevanceBoost' | 'type' | 'signatures' | 'indexSignatures' | 'defaultValue' | 'overwrites' | 'inheritedFrom' | 'implementationOf' | 'extendedTypes' | 'extendedBy' | 'implementedTypes' | 'implementedBy' | 'getSignature' | 'setSignature' | 'typeParameters' | 'readme' > {}
Reflections
property indexSignature
indexSignature?: SignatureReflection;
Deprecated
moved to indexSignatures with 0.26.
interface DocumentReflection
interface DocumentReflection extends Omit<Reflection, 'variant'>, S< M.DocumentReflection, 'variant' | 'content' | 'relevanceBoost' | 'children' > {}
Reflections
property frontmatter
frontmatter: Record<string, unknown>;
interface FileRegistry
interface FileRegistry {}
property entries
entries: Record<number, string>;
Relative path according to the serialization root
property reflections
reflections: Record<number, number>;
File ID to reflection ID
interface IndexedAccessType
interface IndexedAccessType extends Type, S<M.IndexedAccessType, 'type' | 'indexType' | 'objectType'> {}
Types
interface InferredType
interface InferredType extends Type, S<M.InferredType, 'type' | 'name' | 'constraint'> {}
Types
interface InlineTagDisplayPart
interface InlineTagDisplayPart {}
If
target
is a number, it is a reflection ID. If a string, it is a URL.target
will only be set for@link
,@linkcode
, and@linkplain
tags. Comments
property kind
kind: 'inline-tag';
property tag
tag: `@${string}`;
property target
target?: string | number | ReflectionSymbolId;
property text
text: string;
property tsLinkText
tsLinkText?: string;
interface IntersectionType
interface IntersectionType extends Type, S<M.IntersectionType, 'type' | 'types'> {}
Types
interface IntrinsicType
interface IntrinsicType extends Type, S<M.IntrinsicType, 'type' | 'name'> {}
Types
interface LiteralType
interface LiteralType extends Type, S<M.LiteralType, 'type' | 'value'> {}
Types
interface MappedType
interface MappedType extends Type, S< M.MappedType, | 'type' | 'parameter' | 'parameterType' | 'templateType' | 'readonlyModifier' | 'optionalModifier' | 'nameType' > {}
Types
interface NamedTupleMemberType
interface NamedTupleMemberType extends Type, S<M.NamedTupleMember, 'type' | 'name' | 'isOptional' | 'element'> {}
Types
interface OptionalType
interface OptionalType extends Type, S<M.OptionalType, 'type' | 'elementType'> {}
Types
interface ParameterReflection
interface ParameterReflection extends Omit<Reflection, 'variant'>, S<M.ParameterReflection, 'variant' | 'type' | 'defaultValue'> {}
Reflections
property variant
variant: 'param';
interface PredicateType
interface PredicateType extends Type, S<M.PredicateType, 'type' | 'name' | 'asserts' | 'targetType'> {}
Types
interface ProjectReflection
interface ProjectReflection extends Omit<ContainerReflection, 'variant'>, S< M.ProjectReflection, 'variant' | 'packageName' | 'packageVersion' | 'readme' > {}
Reflections
property files
files: FileRegistry;
property symbolIdMap
symbolIdMap: Record<number, ReflectionSymbolId> | IfInternal<undefined, never>;
interface QueryType
interface QueryType extends Type, S<M.QueryType, 'type' | 'queryType'> {}
Types
interface ReferenceReflection
interface ReferenceReflection extends Omit<DeclarationReflection, 'variant'>, S<M.ReferenceReflection, 'variant'> {}
Reflections
property target
target: number;
-1 if the reference refers to a symbol that does not exist in the documentation. Otherwise, the reflection ID.
interface ReferenceType
interface ReferenceType extends Type, S< M.ReferenceType, 'type' | 'name' | 'typeArguments' | 'package' | 'externalUrl' > {}
Types
property highlightedProperties
highlightedProperties?: Record<string, CommentDisplayPart[]>;
property preferValues
preferValues?: boolean;
property qualifiedName
qualifiedName?: string;
property refersToTypeParameter
refersToTypeParameter?: boolean;
property target
target: number | ReflectionSymbolId;
interface Reflection
interface Reflection extends S<M.Reflection, 'id' | 'variant' | 'name' | 'kind' | 'comment'> {}
Reflections
property flags
flags: ReflectionFlags;
interface ReflectionCategory
interface ReflectionCategory extends S<M.ReflectionCategory, 'title' | 'description'> {}
property children
children?: M.ReflectionCategory['children'][number]['id'][];
interface ReflectionFlags
interface ReflectionFlags extends Partial<S<M.ReflectionFlags, BoolKeys<M.ReflectionFlags>>> {}
interface ReflectionGroup
interface ReflectionGroup extends S<M.ReflectionGroup, 'title' | 'description' | 'categories'> {}
property children
children?: M.ReflectionGroup['children'][number]['id'][];
interface ReflectionSymbolId
interface ReflectionSymbolId {}
property qualifiedName
qualifiedName: string;
property sourceFileName
sourceFileName: string;
interface ReflectionType
interface ReflectionType extends Type, S<M.ReflectionType, 'type' | 'declaration'> {}
Types
interface ReflectionVariantMap
interface ReflectionVariantMap {}
Reflections
property declaration
declaration: DeclarationReflection;
property document
document: DocumentReflection;
property param
param: ParameterReflection;
property project
project: ProjectReflection;
property reference
reference: ReferenceReflection;
property signature
signature: SignatureReflection;
property typeParam
typeParam: TypeParameterReflection;
interface RelativeLinkDisplayPart
interface RelativeLinkDisplayPart {}
This is used for relative links within comments/documents. It is used to mark pieces of text which need to be replaced to make links work properly.
property kind
kind: 'relative-link';
property target
target?: number;
File ID, if present
property targetAnchor
targetAnchor?: string;
Anchor within the target file, if present
property text
text: string;
The original relative text from the parsed comment.
interface RestType
interface RestType extends Type, S<M.RestType, 'type' | 'elementType'> {}
Types
interface SignatureReflection
interface SignatureReflection extends Omit<Reflection, 'variant'>, S< M.SignatureReflection, | 'variant' | 'sources' | 'parameters' | 'typeParameters' | 'type' | 'overwrites' | 'inheritedFrom' | 'implementationOf' > {}
Reflections
property typeParameter
typeParameter?: ModelToObject<M.TypeParameterReflection[]>;
Deprecated
in 0.26, replaced with typeParameters
interface SourceReference
interface SourceReference extends S<M.SourceReference, 'fileName' | 'line' | 'character' | 'url'> {}
interface TemplateLiteralType
interface TemplateLiteralType extends Type, S<M.TemplateLiteralType, 'type' | 'head'> {}
Types
property tail
tail: [SomeType, string][];
interface TupleType
interface TupleType extends Type, S<M.TupleType, 'type'> {}
Types
property elements
elements?: ModelToObject<M.TupleType['elements']>;
interface Type
interface Type {}
Types
interface TypeOperatorType
interface TypeOperatorType extends Type, S<M.TypeOperatorType, 'type' | 'operator' | 'target'> {}
Types
interface TypeParameterReflection
interface TypeParameterReflection extends Omit<Reflection, 'variant'>, S< M.TypeParameterReflection, 'variant' | 'type' | 'default' | 'varianceModifier' > {}
Reflections
interface UnionType
interface UnionType extends Type, S<M.UnionType, 'type' | 'types' | 'elementSummaries'> {}
Types
interface UnknownType
interface UnknownType extends Type, S<M.UnknownType, 'type' | 'name'> {}
Types
type CommentDisplayPart
type CommentDisplayPart = | { kind: 'text'; text: string; } | { kind: 'code'; text: string; } | InlineTagDisplayPart | RelativeLinkDisplayPart;
See Also
M.CommentDisplayPart Comments
type ModelToObject
type ModelToObject<T> = [T] extends [Array<infer U>] ? ModelToObject<U>[] : [M.SomeType] extends [T] ? SomeType : _ModelToObject<T>;
Describes the mapping from Model types to the corresponding JSON output type.
type SomeReflection
type SomeReflection = ReflectionVariantMap[keyof ReflectionVariantMap];
Reflections
type SomeType
type SomeType = TypeKindMap[keyof TypeKindMap];
Types
type TypeKindMap
type TypeKindMap = { array: ArrayType; conditional: ConditionalType; indexedAccess: IndexedAccessType; inferred: InferredType; intersection: IntersectionType; intrinsic: IntrinsicType; literal: LiteralType; mapped: MappedType; optional: OptionalType; predicate: PredicateType; query: QueryType; reference: ReferenceType; reflection: ReflectionType; rest: RestType; templateLiteral: TemplateLiteralType; tuple: TupleType; namedTupleMember: NamedTupleMemberType; typeOperator: TypeOperatorType; union: UnionType; unknown: UnknownType;};
Types
namespace JSX
module 'dist/lib/utils/jsx.d.ts' {}
Custom JSX module designed specifically for TypeDoc's needs. When overriding a default TypeDoc theme output, your implementation must create valid Element instances, which can be most easily done by using TypeDoc's JSX implementation. To use it, set up your tsconfig with the following compiler options:
{"jsx": "react","jsxFactory": "JSX.createElement","jsxFragmentFactory": "JSX.Fragment"}Custom JSX module designed specifically for TypeDoc's needs.
function createElement
createElement: ( tag: string | JsxComponent<any>, props: object | null, ...children: JsxChildren[]) => JsxElement;
JSX factory function to create an "element" that can later be rendered with renderElement
Parameter tag
Parameter props
Parameter children
function Fragment
Fragment: () => never;
function Raw
Raw: (_props: { html: string }) => null;
Used to inject HTML directly into the document.
function renderElement
renderElement: (element: JsxElement | null | undefined) => string;
function setRenderSettings
setRenderSettings: (options: { pretty: boolean }) => void;
interface Element
interface JsxElement {}
type Children
type JsxChildren = JsxElement | string | number | null | undefined | JsxChildren[];
type JsxComponent
type JsxComponent<P> = (props: P) => JsxElement | null | undefined;
namespace JSX.JSX
namespace JSX.JSX {}
TypeScript's rules for looking up the JSX.IntrinsicElements and JSX.Element interfaces are incredibly strange. It will find them if they are included as a namespace under the createElement function, or globally, or, apparently, if a JSX namespace is declared at the same scope as the factory function. Hide this in the docs, hopefully someday TypeScript improves this and allows looking adjacent to the factory function and we can get rid of this phantom namespace.
interface Element
interface JsxElement {}
interface IntrinsicAttributes
interface JsxHtmlGlobalProps {}
The common properties that may appear on any HTML element.
Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#list_of_global_attributes
property accessKey
accessKey?: string;
property autocapitalize
autocapitalize?: string;
property children
children?: JsxChildren;
property class
class?: string;
property contentEditable
contentEditable?: string;
property dir
dir?: string;
property draggable
draggable?: boolean;
property enterKeyHint
enterKeyHint?: string;
property hidden
hidden?: boolean;
property id
id?: string;
property inputMode
inputMode?: string;
property is
is?: string;
property itemId
itemId?: string;
property itemProp
itemProp?: string;
property itemRef
itemRef?: string;
property itemScope
itemScope?: string;
property itemType
itemType?: string;
property lang
lang?: string;
property nonce
nonce?: string;
property part
part?: string;
property popover
popover?: boolean | 'auto' | 'manual';
Default: 'auto'. true and 'auto' are equivalent
See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) for more details
property popovertarget
popovertarget?: string;
It must be the popover element id, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
property popovertargetaction
popovertargetaction?: 'hide' | 'show' | 'toggle';
property role
role?: string;
property slot
slot?: string;
property spellcheck
spellcheck?: boolean;
property style
style?: string;
property tabIndex
tabIndex?: number;
property title
title?: string;
property translate
translate?: boolean;
index signature
[data: `data-${string}`]: string;
interface IntrinsicElements
interface IntrinsicElements {}
property a
a: JsxAElementProps;
property abbr
abbr: JsxHtmlGlobalProps;
property address
address: JsxHtmlGlobalProps;
property area
area: JsxAreaElementProps;
property article
article: JsxHtmlGlobalProps;
property aside
aside: JsxHtmlGlobalProps;
property audio
audio: JsxAudioElementProps;
property b
b: JsxHtmlGlobalProps;
property base
base: JsxBaseElementProps;
property bdi
bdi: JsxHtmlGlobalProps;
property bdo
bdo: JsxHtmlGlobalProps;
property blockquote
blockquote: JsxBlockquoteElementProps;
property body
body: JsxHtmlGlobalProps;
property br
br: JsxBrElementProps;
property button
button: JsxButtonElementProps;
property canvas
canvas: JsxCanvasElementProps;
property caption
caption: JsxHtmlGlobalProps;
property circle
circle: JsxCircleElementProps;
property cite
cite: JsxHtmlGlobalProps;
property code
code: JsxHtmlGlobalProps;
property col
col: JsxColElementProps;
property colgroup
colgroup: JsxColgroupElementProps;
property data
data: JsxDataElementProps;
property datalist
datalist: JsxHtmlGlobalProps;
property dd
dd: JsxHtmlGlobalProps;
property del
del: JsxDelElementProps;
property details
details: JsxDetailsElementProps;
property dfn
dfn: JsxHtmlGlobalProps;
property dialog
dialog: JsxDialogElementProps;
property div
div: JsxHtmlGlobalProps;
property dl
dl: JsxHtmlGlobalProps;
property dt
dt: JsxHtmlGlobalProps;
property ellipse
ellipse: JsxEllipseElementProps;
property em
em: JsxHtmlGlobalProps;
property embed
embed: JsxEmbedElementProps;
property fieldset
fieldset: JsxFieldsetElementProps;
property figcaption
figcaption: JsxHtmlGlobalProps;
property figure
figure: JsxHtmlGlobalProps;
property footer
footer: JsxHtmlGlobalProps;
property form
form: JsxFormElementProps;
property g
g: JsxGElementProps;
property h1
h1: JsxFormElementProps;
property h2
h2: JsxFormElementProps;
property h3
h3: JsxFormElementProps;
property h4
h4: JsxFormElementProps;
property h5
h5: JsxFormElementProps;
property h6
h6: JsxFormElementProps;
property head
head: JsxHtmlGlobalProps;
property header
header: JsxHtmlGlobalProps;
property hgroup
hgroup: JsxHtmlGlobalProps;
property hr
hr: JsxHtmlGlobalProps;
property html
html: JsxHtmlElementProps;
property i
i: JsxHtmlGlobalProps;
property iframe
iframe: JsxIframeElementProps;
property img
img: JsxImgElementProps;
property input
input: JsxInputElementProps;
property ins
ins: JsxInsElementProps;
property kbd
kbd: JsxHtmlGlobalProps;
property label
label: JsxLabelElementProps;
property legend
legend: JsxHtmlGlobalProps;
property li
li: JsxLiElementProps;
property line
line: JsxLineElementProps;
property link
link: JsxLinkElementProps;
property main
main: JsxHtmlGlobalProps;
property map
map: JsxMapElementProps;
property mark
mark: JsxHtmlGlobalProps;
property meta
meta: JsxMetaElementProps;
property meter
meter: JsxMeterElementProps;
property nav
nav: JsxHtmlGlobalProps;
property noscript
noscript: JsxHtmlGlobalProps;
property object
object: JsxObjectElementProps;
property ol
ol: JsxOlElementProps;
property optgroup
optgroup: JsxOptgroupElementProps;
property option
option: JsxOptionElementProps;
property output
output: JsxOutputElementProps;
property p
p: JsxHtmlGlobalProps;
property param
param: JsxParamElementProps;
property path
path: JsxPathElementProps;
property picture
picture: JsxHtmlGlobalProps;
property polygon
polygon: JsxPolygonElementProps;
property polyline
polyline: JsxPolylineElementProps;
property portal
portal: JsxPortalElementProps;
property pre
pre: JsxHtmlGlobalProps;
property progress
progress: JsxProgressElementProps;
property q
q: JsxQElementProps;
property rect
rect: JsxRectElementProps;
property rp
rp: JsxHtmlGlobalProps;
property rt
rt: JsxHtmlGlobalProps;
property ruby
ruby: JsxHtmlGlobalProps;
property s
s: JsxHtmlGlobalProps;
property samp
samp: JsxHtmlGlobalProps;
property script
script: JsxScriptElementProps;
property section
section: JsxHtmlGlobalProps;
property select
select: JsxSelectElementProps;
property slot
slot: JsxSlotElementProps;
property small
small: JsxHtmlGlobalProps;
property source
source: JsxSourceElementProps;
property span
span: JsxHtmlGlobalProps;
property strong
strong: JsxHtmlGlobalProps;
property style
style: JsxStyleElementProps;
property sub
sub: JsxHtmlGlobalProps;
property summary
summary: JsxHtmlGlobalProps;
property sup
sup: JsxHtmlGlobalProps;
property svg
svg: JsxSvgElementProps;
property table
table: JsxHtmlGlobalProps;
property tbody
tbody: JsxHtmlGlobalProps;
property td
td: JsxTdElementProps;
property template
template: JsxHtmlGlobalProps;
property text
text: JsxTextElementProps;
property textarea
textarea: JsxTextareaElementProps;
property tfoot
tfoot: JsxHtmlGlobalProps;
property th
th: JsxThElementProps;
property thead
thead: JsxHtmlGlobalProps;
property time
time: JsxTimeElementProps;
property title
title: JsxHtmlGlobalProps;
property tr
tr: JsxHtmlGlobalProps;
property track
track: JsxTrackElementProps;
property u
u: JsxHtmlGlobalProps;
property ul
ul: JsxHtmlGlobalProps;
property use
use: JsxUseElementProps;
property var
var: JsxHtmlGlobalProps;
property video
video: JsxVideoElementProps;
property wbr
wbr: JsxHtmlGlobalProps;
namespace Models
module 'dist/lib/models/index.d.ts' {}
variable TypeContext
const TypeContext: { readonly none: 'none'; readonly templateLiteralElement: 'templateLiteralElement'; readonly arrayElement: 'arrayElement'; readonly indexedAccessElement: 'indexedAccessElement'; readonly conditionalCheck: 'conditionalCheck'; readonly conditionalExtends: 'conditionalExtends'; readonly conditionalTrue: 'conditionalTrue'; readonly conditionalFalse: 'conditionalFalse'; readonly indexedIndex: 'indexedIndex'; readonly indexedObject: 'indexedObject'; readonly inferredConstraint: 'inferredConstraint'; readonly intersectionElement: 'intersectionElement'; readonly mappedName: 'mappedName'; readonly mappedParameter: 'mappedParameter'; readonly mappedTemplate: 'mappedTemplate'; readonly optionalElement: 'optionalElement'; readonly predicateTarget: 'predicateTarget'; readonly queryTypeTarget: 'queryTypeTarget'; readonly typeOperatorTarget: 'typeOperatorTarget'; readonly referenceTypeArgument: 'referenceTypeArgument'; readonly restElement: 'restElement'; readonly tupleElement: 'tupleElement'; readonly unionElement: 'unionElement';};
Enumeration that can be used when traversing types to track the location of recursion. Used by TypeDoc internally to track when to output parenthesis when rendering.
variable VarianceModifier
const VarianceModifier: { readonly in: 'in'; readonly out: 'out'; readonly inOut: 'in out';};
Modifier flags for type parameters, added in TS 4.7
function makeRecursiveVisitor
makeRecursiveVisitor: (visitor: Partial<TypeVisitor>) => TypeVisitor;
function splitUnquotedString
splitUnquotedString: (input: string, delimiter: string) => string[];
class ArrayType
class ArrayType extends Type {}
Represents an array type.
let value: string[];Types
constructor
constructor(elementType: SomeType);
Parameter elementType
The type of the elements in the array.
property elementType
elementType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ArrayType;
class Comment
class Comment {}
A model that represents a comment.
Instances of this model are created by the CommentPlugin. You can retrieve comments through the DeclarationReflection.comment property. Comments
constructor
constructor( summary?: CommentDisplayPart[], blockTags?: CommentTag[], modifierTags?: Set<`@${string}`>);
Creates a new Comment instance.
property blockTags
blockTags: CommentTag[];
All associated block level tags.
property inheritedFromParentDeclaration
inheritedFromParentDeclaration?: boolean;
If the comment was inherited from a different "parent" declaration (see #2545), then it is desirable to know this as any
@param
tags which do not apply should not cause warnings. This is not serialized, and only set when the comment was created from ats.CommentRange
.
property label
label?: string;
Label associated with this reflection, if any (https://tsdoc.org/pages/tags/label/)
property modifierTags
modifierTags: Set<`@${string}`>;
All modifier tags present on the comment, e.g.
@alpha
,@beta
.
property sourcePath
sourcePath?: string;
Full path to the file where this comment originated from, if any. This field will not be serialized, so will not be present when handling JSON-revived reflections.
Note: This field is non-enumerable to make testing comment contents with
deepEqual
easier.
property summary
summary: CommentDisplayPart[];
The content of the comment which is not associated with a block tag.
method clone
clone: () => Comment;
Create a deep clone of this comment.
method cloneDisplayParts
static cloneDisplayParts: ( parts: readonly CommentDisplayPart[]) => CommentDisplayPart[];
Helper utility to clone Comment.summary or CommentTag.content
method combineDisplayParts
static combineDisplayParts: ( parts: readonly CommentDisplayPart[] | undefined) => string;
Debugging utility for combining parts into a simple string. Not suitable for rendering, but can be useful in tests.
method deserializeDisplayParts
static deserializeDisplayParts: ( de: Deserializer, parts: JSONOutput.CommentDisplayPart[]) => CommentDisplayPart[];
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.Comment) => void;
method getIdentifiedTag
getIdentifiedTag: ( identifier: string, tagName: `@${string}`) => CommentTag | undefined;
method getShortSummary
getShortSummary: (useFirstParagraph: boolean) => readonly CommentDisplayPart[];
Gets either the
@summary
tag, or a short version of the comment summary section for rendering in module/namespace pages.
method getTag
getTag: (tagName: `@${string}`) => CommentTag | undefined;
Return the first tag with the given name.
Parameter tagName
The name of the tag to look for.
Returns
The found tag or undefined.
method getTags
getTags: (tagName: `@${string}`) => CommentTag[];
Get all tags with the given tag name.
method hasModifier
hasModifier: (tagName: `@${string}`) => boolean;
Test whether this comment contains a tag with the given name.
Parameter tagName
The name of the tag to look for.
Returns
TRUE when this comment contains a tag with the given name, otherwise FALSE.
method hasVisibleComponent
hasVisibleComponent: () => boolean;
Has this comment a visible component?
Returns
TRUE when this comment has a visible component.
method removeModifier
removeModifier: (tagName: `@${string}`) => void;
method removeTags
removeTags: (tagName: `@${string}`) => void;
Removes all block tags with the given tag name from the comment.
Parameter tagName
method serializeDisplayParts
static serializeDisplayParts: { ( serializer: Serializer, parts: CommentDisplayPart[] ): JSONOutput.CommentDisplayPart[]; ( serializer: Serializer, parts: CommentDisplayPart[] ): JSONOutput.CommentDisplayPart[];};
no point in showing this signature in api docs
method similarTo
similarTo: (other: Comment) => boolean;
Checks if this comment is roughly equal to the other comment. This isn't exactly equal, but just "roughly equal" by the comment text.
method splitPartsToHeaderAndBody
static splitPartsToHeaderAndBody: (parts: readonly CommentDisplayPart[]) => { header: string; body: CommentDisplayPart[];};
Splits the provided parts into a header (first line, as a string) and body (remaining lines). If the header line contains inline tags they will be serialized to a string.
method toObject
toObject: (serializer: Serializer) => JSONOutput.Comment;
class CommentTag
class CommentTag {}
A model that represents a single TypeDoc comment tag.
Tags are stored in the Comment.blockTags property. Comments
constructor
constructor(tag: string, text: CommentDisplayPart[]);
Create a new CommentTag instance.
property content
content: CommentDisplayPart[];
The actual body text of this tag.
property name
name?: string;
Some tags, (
@typedef
,@param
,@property
, etc.) may have a user defined identifier associated with them. If this tag is one of those, it will be parsed out and included here.
property skipRendering
skipRendering: boolean;
A flag which may be set by plugins to prevent TypeDoc from rendering this tag, if the plugin provides custom rendering. Note: This flag is **not** serialized, it is expected to be set just before the comment is rendered.
property tag
tag: string;
The name of this tag, e.g.
@returns
,@example
method clone
clone: () => CommentTag;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.CommentTag) => void;
method similarTo
similarTo: (other: CommentTag) => boolean;
Checks if this block tag is roughly equal to the other tag. This isn't exactly equal, but just "roughly equal" by the tag text.
method toObject
toObject: (serializer: Serializer) => JSONOutput.CommentTag;
class ConditionalType
class ConditionalType extends Type {}
Represents a conditional type.
let value: Check extends Extends ? True : False;Types
constructor
constructor( checkType: SomeType, extendsType: SomeType, trueType: SomeType, falseType: SomeType);
property checkType
checkType: SomeType;
property extendsType
extendsType: SomeType;
property falseType
falseType: SomeType;
property trueType
trueType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ConditionalType;
class ContainerReflection
abstract class ContainerReflection extends Reflection {}
Reflections
property categories
categories?: ReflectionCategory[];
All children grouped by their category.
property children
children?: DeclarationReflection[];
The children of this reflection. Do not add reflections to this array manually. Instead call addChild.
property childrenIncludingDocuments
childrenIncludingDocuments?: (DeclarationReflection | DocumentReflection)[];
property documents
documents?: DocumentReflection[];
Documents associated with this reflection.
These are not children as including them as children requires code handle both types, despite being mostly unrelated and handled separately.
Including them here in a separate array neatly handles that problem, but also introduces another one for rendering. When rendering, documents should really actually be considered part of the "children" of a reflection. For this reason, we also maintain a list of child declarations with child documents which is used when rendering.
property groups
groups?: ReflectionGroup[];
All children grouped by their kind.
method addChild
addChild: (child: DeclarationReflection | DocumentReflection) => void;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ContainerReflection) => void;
method getChildrenByKind
getChildrenByKind: (kind: ReflectionKind) => DeclarationReflection[];
Return a list of all children of a certain kind.
Parameter kind
The desired kind of children.
Returns
An array containing all children with the desired kind.
method removeChild
removeChild: (child: DeclarationReflection | DocumentReflection) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ContainerReflection;
method traverse
traverse: (callback: TraverseCallback) => void;
class DeclarationReflection
class DeclarationReflection extends ContainerReflection {}
A reflection that represents a single declaration emitted by the TypeScript compiler.
All parts of a project are represented by DeclarationReflection instances. The actual kind of a reflection is stored in its ´kind´ member. Reflections
property defaultValue
defaultValue?: string;
The default value of this reflection.
Applies to function parameters, variables, and properties.
property extendedBy
extendedBy?: ReferenceType[];
A list of all types that extend this reflection (e.g. the subclasses).
property extendedTypes
extendedTypes?: SomeType[];
A list of all types this reflection extends (e.g. the parent classes).
property getSignature
getSignature?: SignatureReflection;
The get signature of this declaration.
property implementationOf
implementationOf?: ReferenceType;
A type that points to the reflection this reflection is the implementation of.
Applies to class members.
property implementedBy
implementedBy?: ReferenceType[];
A list of all types that implement this reflection.
property implementedTypes
implementedTypes?: SomeType[];
A list of all types this reflection implements.
property indexSignatures
indexSignatures?: SignatureReflection[];
The index signature of this declaration.
property inheritedFrom
inheritedFrom?: ReferenceType;
A type that points to the reflection this reflection has been inherited from.
Applies to interface and class members.
property overwrites
overwrites?: ReferenceType;
A type that points to the reflection that has been overwritten by this reflection.
Applies to interface and class members.
property packageVersion
packageVersion?: string;
The version of the module when found.
property readme
readme?: CommentDisplayPart[];
The contents of the readme file of the module when found.
property relevanceBoost
relevanceBoost?: number;
Precomputed boost for search results, may be less than 1 to de-emphasize this member in search results. Does NOT include group/category values as they are computed when building the JS index.
This is preserved for plugins, and may be removed in 0.28 if no plugins have used it yet.
property setSignature
setSignature?: SignatureReflection;
The set signature of this declaration.
property signatures
signatures?: SignatureReflection[];
A list of call signatures attached to this declaration.
TypeDoc creates one declaration per function that may contain one or more signature reflections.
property sources
sources?: SourceReference[];
A list of all source files that contributed to this reflection.
property type
type?: SomeType;
The type of the reflection.
If the reflection represents a variable or a property, this is the value type. If the reflection represents a signature, this is the return type.
property typeHierarchy
typeHierarchy?: DeclarationHierarchy;
Contains a simplified representation of the type hierarchy suitable for being rendered in templates.
property typeParameters
typeParameters?: TypeParameterReflection[];
property variant
readonly variant: 'declaration' | 'reference';
method fromObject
fromObject: ( de: Deserializer, obj: JSONOutput.DeclarationReflection | JSONOutput.ProjectReflection) => void;
method getAllSignatures
getAllSignatures: () => SignatureReflection[];
method getChildOrTypePropertyByName
getChildOrTypePropertyByName: ( path: string[]) => DeclarationReflection | undefined;
method getNonIndexSignatures
getNonIndexSignatures: () => SignatureReflection[];
method getProperties
getProperties: () => DeclarationReflection[];
method hasGetterOrSetter
hasGetterOrSetter: () => boolean;
method isDeclaration
isDeclaration: () => this is DeclarationReflection;
method toObject
toObject: (serializer: Serializer) => JSONOutput.DeclarationReflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method traverse
traverse: (callback: TraverseCallback) => void;
class DocumentReflection
class DocumentReflection extends Reflection {}
Non-TS reflection type which is used to represent markdown documents included in the docs.
constructor
constructor( name: string, parent: Reflection, content: CommentDisplayPart[], frontmatter: Record<string, unknown>);
property children
children?: DocumentReflection[];
Child documents, if any are present.
property content
content: CommentDisplayPart[];
The content to be displayed on the page for this reflection.
property frontmatter
frontmatter: Record<string, unknown>;
Frontmatter included in document
property relevanceBoost
relevanceBoost?: number;
A precomputed boost derived from the searchCategoryBoosts and searchGroupBoosts options, used when boosting search relevance scores at runtime. May be modified by plugins.
property variant
readonly variant: string;
method addChild
addChild: (child: DocumentReflection) => void;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.DocumentReflection) => void;
method isDocument
isDocument: () => this is DocumentReflection;
method toObject
toObject: (serializer: Serializer) => JSONOutput.DocumentReflection;
method traverse
traverse: (callback: TraverseCallback) => void;
class FileRegistry
class FileRegistry {}
property mediaToPath
protected mediaToPath: Map<number, string>;
property mediaToReflection
protected mediaToReflection: Map<number, ReflectionId>;
property names
protected names: Map<number, string>;
property nameUsage
protected nameUsage: Map<string, number>;
property nextId
protected nextId: number;
property pathToMedia
protected pathToMedia: Map<string, number>;
property reflectionToPath
protected reflectionToPath: Map<ReflectionId, string>;
method fromObject
fromObject: (de: Deserializer, obj: JSONFileRegistry) => void;
Revive a file registry from disc. Note that in the packages context this may be called multiple times on a single object, and should merge in files from the other registries.
method getName
getName: (id: number) => string | undefined;
method getNameToAbsoluteMap
getNameToAbsoluteMap: () => ReadonlyMap<string, string>;
method getReflectionPath
getReflectionPath: (reflection: Reflection) => string | undefined;
method register
register: ( sourcePath: string, relativePath: string) => { target: number; anchor: string | undefined } | undefined;
method registerAbsolute
registerAbsolute: (absolute: string) => { target: number; anchor: string | undefined;};
method removeReflection
removeReflection: (reflection: Reflection) => void;
method resolve
resolve: ( id: number, project: ProjectReflection) => string | Reflection | undefined;
method toObject
toObject: (ser: Serializer) => JSONFileRegistry;
class IndexedAccessType
class IndexedAccessType extends Type {}
Represents an indexed access type. Types
constructor
constructor(objectType: SomeType, indexType: SomeType);
property indexType
indexType: SomeType;
property objectType
objectType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.IndexedAccessType;
class InferredType
class InferredType extends Type {}
Represents an inferred type, U in the example below.
type Z = Promise<string> extends Promise<infer U> : neverTypes
constructor
constructor(name: string, constraint?: SomeType);
property constraint
constraint?: SomeType;
property name
name: string;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.InferredType;
class IntersectionType
class IntersectionType extends Type {}
Represents an intersection type.
let value: A & B;Types
constructor
constructor(types: SomeType[]);
property type
readonly type: string;
property types
types: SomeType[];
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.IntersectionType;
class IntrinsicType
class IntrinsicType extends Type {}
Represents an intrinsic type like
string
orboolean
.let value: number;Types
constructor
constructor(name: string);
property name
name: string;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: () => JSONOutput.IntrinsicType;
class LiteralType
class LiteralType extends Type {}
Represents a literal type.
type A = "A"type B = 1Types
constructor
constructor(value: string | number | bigint | boolean);
property type
readonly type: string;
property value
value: string | number | bigint | boolean;
method getTypeString
protected getTypeString: () => string;
Return a string representation of this type.
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: () => JSONOutput.LiteralType;
class MappedType
class MappedType extends Type {}
Represents a mapped type.
{ -readonly [K in Parameter as Name]?: Template }Types
constructor
constructor( parameter: string, parameterType: SomeType, templateType: SomeType, readonlyModifier?: '+' | '-', optionalModifier?: '+' | '-', nameType?: SomeType);
property nameType
nameType?: SomeType;
property optionalModifier
optionalModifier?: '+' | '-';
property parameter
parameter: string;
property parameterType
parameterType: SomeType;
property readonlyModifier
readonlyModifier?: '+' | '-';
property templateType
templateType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.MappedType;
class NamedTupleMember
class NamedTupleMember extends Type {}
Represents a named member of a tuple type.
let value: [name: string];Types
constructor
constructor(name: string, isOptional: boolean, element: SomeType);
property element
element: SomeType;
property isOptional
isOptional: boolean;
property name
name: string;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
Return a string representation of this type.
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.NamedTupleMemberType;
class OptionalType
class OptionalType extends Type {}
Represents an optional type
type Z = [1, 2?]// ^^Types
constructor
constructor(elementType: SomeType);
property elementType
elementType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.OptionalType;
class ParameterReflection
class ParameterReflection extends Reflection {}
Reflections
property defaultValue
defaultValue?: string;
property parent
parent?: SignatureReflection;
property type
type?: SomeType;
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ParameterReflection) => void;
method isParameter
isParameter: () => this is ParameterReflection;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ParameterReflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method traverse
traverse: (callback: TraverseCallback) => void;
class PredicateType
class PredicateType extends Type {}
Represents a type predicate.
function isString(x: unknown): x is string {}function assert(condition: boolean): asserts condition {}Types
constructor
constructor(name: string, asserts: boolean, targetType?: SomeType);
Create a new PredicateType instance.
Parameter name
The identifier name which is tested by the predicate.
Parameter asserts
True if the type is of the form
asserts val is string
, false if the type is of the formval is string
Parameter targetType
The type that the identifier is tested to be. May be undefined if the type is of the form
asserts val
. Will be defined if the type is of the formasserts val is string
orval is string
.
property asserts
asserts: boolean;
property name
name: string;
property targetType
targetType?: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
Return a string representation of this type.
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.PredicateType;
class ProjectReflection
class ProjectReflection extends ContainerReflection {}
A reflection that represents the root of the project.
The project reflection acts as a global index, one may receive all reflections and source files of the processed project through this reflection. Reflections
constructor
constructor(name: string, registry: FileRegistry);
property files
readonly files: FileRegistry;
Object which describes where to find content for relative links.
property packageName
packageName?: string;
The name of the package that this reflection documents according to package.json.
property packageVersion
packageVersion?: string;
The version of the package that this reflection documents according to package.json.
property readme
readme?: CommentDisplayPart[];
The contents of the readme.md file of the project when found.
property reflections
reflections: { [id: number]: Reflection };
A list of all reflections within the project. DO NOT MUTATE THIS OBJECT. All mutation should be done via registerReflection and removeReflection to ensure that links to reflections remain valid.
This may be replaced with a
Map<number, Reflection>
someday.
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ProjectReflection) => void;
method getReflectionById
getReflectionById: (id: number) => Reflection | undefined;
Gets the reflection registered for the given reflection ID, or undefined if it is not present in the project.
method getReflectionsByKind
getReflectionsByKind: (kind: ReflectionKind) => Reflection[];
Return a list of all reflections in this project of a certain kind.
Parameter kind
The desired kind of reflection.
Returns
An array containing all reflections with the desired kind.
method isProject
isProject: () => this is ProjectReflection;
Return whether this reflection is the root / project reflection.
method registerReflection
registerReflection: ( reflection: Reflection, symbol: ts.Symbol | undefined, filePath: string | undefined) => void;
Registers the given reflection so that it can be quickly looked up by helper methods. Should be called for *every* reflection added to the project.
method removeReflection
removeReflection: (reflection: Reflection) => void;
Removes a reflection from the documentation. Can be used by plugins to filter reflections out of the generated documentation. Has no effect if the reflection is not present in the project.
method removeTypeReflections
removeTypeReflections: (type: Type | undefined) => void;
Removes references to reflections contained within the provided type. Plugins which overwrite types on reflections should pass the type to this method before overwriting the property. 0.26.6
method symbolIdHasBeenRemoved
symbolIdHasBeenRemoved: (id: ReflectionSymbolId) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ProjectReflection;
class QueryType
class QueryType extends Type {}
Represents a type that is constructed by querying the type of a reflection.
const x = 1type Z = typeof x // query on reflection for xTypes
constructor
constructor(queryType: ReferenceType);
property queryType
queryType: ReferenceType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.QueryType;
class ReferenceReflection
class ReferenceReflection extends DeclarationReflection {}
Describes a reflection which does not exist at this location, but is referenced. Used for imported reflections.
// a.tsexport const a = 1;// b.tsimport { a } from './a';// Here to avoid extra work we create a reference to the original reflection in module a instead// of copying the reflection.export { a };Reflections
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReferenceReflection) => void;
method getChildByName
getChildByName: (arg: string | string[]) => Reflection | undefined;
method getTargetReflection
getTargetReflection: () => Reflection;
Gets the reflection that is referenced. This may be another reference reflection. To fully resolve any references, use getTargetReflectionDeep.
method getTargetReflectionDeep
getTargetReflectionDeep: () => Reflection;
Gets the reflection that is referenced, this will fully resolve references. To only resolve one reference, use getTargetReflection.
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReferenceReflection;
method tryGetTargetReflection
tryGetTargetReflection: () => Reflection | undefined;
Tries to get the reflection that is referenced. This may be another reference reflection. To fully resolve any references, use tryGetTargetReflectionDeep.
method tryGetTargetReflectionDeep
tryGetTargetReflectionDeep: () => Reflection | undefined;
Tries to get the reflection that is referenced, this will fully resolve references. To only resolve one reference, use tryGetTargetReflection.
class ReferenceType
class ReferenceType extends Type {}
Represents a type that refers to another reflection like a class, interface or enum.
let value: MyClass<T>;Types
property externalUrl
externalUrl?: string;
If this reference type refers to a reflection defined by a project not being rendered, points to the url that this type should be linked to.
property highlightedProperties
highlightedProperties?: Map<string, CommentDisplayPart[]>;
Sometimes a few properties are more important than the rest of the properties within a type. This occurs most often with object parameters, where users want to specify
@param foo.bar
to highlight something about thebar
property.Does NOT support nested properties.
property name
name: string;
The name of the referenced type.
If the symbol cannot be found because it's not part of the documentation this can be used to represent the type.
property package
package?: string;
The package that this type is referencing.
property preferValues
preferValues: boolean;
If set, will prefer reflections with ReflectionKinds which represent values rather than those which represent types.
property qualifiedName
qualifiedName: string;
The fully qualified name of the referenced type, relative to the file it is defined in. This will usually be the same as
name
, unless namespaces are used.
property refersToTypeParameter
refersToTypeParameter: boolean;
If set, no warnings about something not being exported should be created since this may be referring to a type created with
infer X
which will not be registered on the project.
property reflection
readonly reflection: Reflection;
The resolved reflection.
property symbolId
readonly symbolId: ReflectionSymbolId;
If not resolved, the symbol id of the reflection, otherwise undefined.
property type
readonly type: string;
property typeArguments
typeArguments?: SomeType[];
The type arguments of this reference.
method createResolvedReference
static createResolvedReference: ( name: string, target: Reflection | number, project: ProjectReflection | null) => ReferenceType;
method createSymbolReference
static createSymbolReference: ( symbol: ts.Symbol, context: Context, name?: string) => ReferenceType;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReferenceType) => void;
method getTypeString
protected getTypeString: () => string;
method isIntentionallyBroken
isIntentionallyBroken: () => boolean;
Checks if this type is a reference type because it uses a name, but is intentionally not pointing to a reflection. This happens for type parameters and when representing a mapped type.
method needsParenthesis
needsParenthesis: () => boolean;
method toDeclarationReference
toDeclarationReference: () => DeclarationReference;
Convert this reference type to a declaration reference used for resolution of external types.
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReferenceType;
class Reflection
abstract class Reflection {}
Base class for all reflection classes.
While generating a documentation, TypeDoc generates an instance of ProjectReflection as the root for all reflections within the project. All other reflections are represented by the DeclarationReflection class.
This base class exposes the basic properties one may use to traverse the reflection tree. You can use the ContainerReflection.children and parent properties to walk the tree. The ContainerReflection.groups property contains a list of all children grouped and sorted for rendering. Reflections
constructor
constructor(name: string, kind: ReflectionKind, parent?: Reflection);
property anchor
anchor?: string;
The name of the anchor of this child. TODO: Reflections shouldn't know anchors exist. Move this to a serializer.
property comment
comment?: Comment;
The parsed documentation comment attached to this reflection.
property flags
flags: ReflectionFlags;
property hasOwnDocument
hasOwnDocument?: boolean;
Is the url pointing to an individual document?
When FALSE, the url points to an anchor tag on a page of a different reflection. TODO: Reflections shouldn't know how they are rendered. Move this to the correct serializer.
property id
id: Number & { __reflectionIdBrand: never };
Unique id of this reflection.
property kind
kind: ReflectionKind;
The kind of this reflection.
property name
name: string;
The symbol name of this reflection.
property parent
parent?: Reflection;
The reflection this reflection is a child of.
property project
project: ProjectReflection;
property url
url?: string;
The url of this reflection in the generated documentation. TODO: Reflections shouldn't know urls exist. Move this to a serializer.
property variant
abstract readonly variant: keyof ReflectionVariant;
Discriminator representing the type of reflection represented by this object.
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.Reflection) => void;
method getChildByName
getChildByName: (arg: string | string[]) => Reflection | undefined;
Return a child by its name.
Parameter arg
The name hierarchy of the child to look for.
Returns
The found child or undefined.
method getFriendlyFullName
getFriendlyFullName: () => string;
Return the full name of this reflection, with signature names dropped if possible without introducing ambiguity in the name.
method getFullName
getFullName: (separator?: string) => string;
Return the full name of this reflection. Intended for use in debugging. For log messages intended to be displayed to the user for them to fix, prefer getFriendlyFullName instead.
The full name contains the name of this reflection and the names of all parent reflections.
Parameter separator
Separator used to join the names of the reflections.
Returns
The full name of this reflection.
method hasComment
hasComment: () => boolean;
Has this reflection a visible comment?
Returns
TRUE when this reflection has a visible comment.
method hasGetterOrSetter
hasGetterOrSetter: () => boolean;
method isDeclaration
isDeclaration: () => this is DeclarationReflection;
method isDeprecated
isDeprecated: () => boolean;
Check if this reflection or any of its parents have been marked with the
@deprecated
tag.
method isDocument
isDocument: () => this is DocumentReflection;
method isParameter
isParameter: () => this is ParameterReflection;
method isProject
isProject: () => this is ProjectReflection;
Return whether this reflection is the root / project reflection.
method isReference
isReference: () => this is ReferenceReflection;
method kindOf
kindOf: (kind: ReflectionKind | ReflectionKind[]) => boolean;
Test whether this reflection is of the given kind.
method setFlag
setFlag: (flag: ReflectionFlag, value?: boolean) => void;
Set a flag on this reflection.
method toObject
toObject: (serializer: Serializer) => JSONOutput.Reflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method toStringHierarchy
toStringHierarchy: (indent?: string) => string;
Return a string representation of this reflection and all of its children.
Note: This is intended as a debug tool only, output may change between patch versions.
Parameter indent
Used internally to indent child reflections.
method traverse
abstract traverse: (callback: TraverseCallback) => void;
Traverse most potential child reflections of this reflection.
Note: This may not necessarily traverse child reflections contained within the
type
property of the reflection, and should not be relied on for this. Support for checking object types will likely be removed in v0.27.The given callback will be invoked for all children, signatures and type parameters attached to this reflection.
Parameter callback
The callback function that should be applied for each child reflection.
method visit
visit: (visitor: ReflectionVisitor) => void;
class ReflectionCategory
class ReflectionCategory {}
A category of reflections.
Reflection categories are created by the ´CategoryPlugin´ in the resolving phase of the dispatcher. The main purpose of categories is to be able to more easily render human readable children lists in templates.
constructor
constructor(title: string);
Create a new ReflectionCategory instance.
Parameter title
The title of this category.
property children
children: (DeclarationReflection | DocumentReflection)[];
All reflections of this category.
property description
description?: CommentDisplayPart[];
The user specified description, if any, set with
@categoryDescription
property title
title: string;
The title, a string representation of this category.
method allChildrenHaveOwnDocument
allChildrenHaveOwnDocument: () => boolean;
Do all children of this category have a separate document?
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReflectionCategory) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReflectionCategory;
class ReflectionFlags
class ReflectionFlags {}
This must extend Array in order to work with Handlebar's each helper.
property isAbstract
readonly isAbstract: boolean;
property isConst
readonly isConst: boolean;
property isExternal
readonly isExternal: boolean;
Is this a declaration from an external document?
property isInherited
readonly isInherited: boolean;
property isOptional
readonly isOptional: boolean;
Whether this reflection is an optional component or not.
Applies to function parameters and object members.
property isPrivate
readonly isPrivate: boolean;
Is this a private member?
property isProtected
readonly isProtected: boolean;
Is this a protected member?
property isPublic
readonly isPublic: boolean;
Is this a public member?
property isReadonly
readonly isReadonly: boolean;
property isRest
readonly isRest: boolean;
Whether it's a rest parameter, like
foo(...params);
.
property isStatic
readonly isStatic: boolean;
Is this a static member?
method fromObject
fromObject: (obj: JSONOutput.ReflectionFlags) => void;
method getFlagStrings
getFlagStrings: (i18n: Internationalization) => TranslatedString[];
method hasFlag
hasFlag: (flag: ReflectionFlag) => boolean;
method setFlag
setFlag: (flag: ReflectionFlag, set: boolean) => void;
method toObject
toObject: () => JSONOutput.ReflectionFlags;
class ReflectionGroup
class ReflectionGroup {}
A group of reflections. All reflections in a group are of the same kind.
Reflection groups are created by the ´GroupHandler´ in the resolving phase of the dispatcher. The main purpose of groups is to be able to more easily render human readable children lists in templates.
constructor
constructor(title: string, owningReflection: Reflection);
Create a new ReflectionGroup instance.
Parameter title
The title of this group.
Parameter owningReflection
The reflection containing this group, useful for changing rendering based on a comment on a reflection.
property categories
categories?: ReflectionCategory[];
Categories contained within this group.
property children
children: (DeclarationReflection | DocumentReflection)[];
All reflections of this group.
property description
description?: CommentDisplayPart[];
User specified description via
@groupDescription
, if specified.
property owningReflection
readonly owningReflection: Reflection;
property title
title: string;
The title, a string representation of the typescript kind, of this group.
method allChildrenHaveOwnDocument
allChildrenHaveOwnDocument: () => boolean;
Do all children of this group have a separate document?
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.ReflectionGroup) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReflectionGroup;
class ReflectionSymbolId
class ReflectionSymbolId {}
This exists so that TypeDoc can store a unique identifier for a
ts.Symbol
without keeping a reference to thets.Symbol
itself. This identifier should be stable across runs so long as the symbol is exported from the same file.
constructor
constructor(symbol: ts.Symbol, declaration?: ts.Declaration);
constructor
constructor(json: JSONOutput.ReflectionSymbolId);
property fileName
readonly fileName: string;
property pos
pos: number;
Note: This is **not** serialized. It exists for sorting by declaration order, but should not be needed when deserializing from JSON. Will be set to
Infinity
if the ID was deserialized from JSON.
property qualifiedName
readonly qualifiedName: string;
property transientId
transientId: number;
Note: This is **not** serialized. It exists to support detection of the differences between symbols which share declarations, but are instantiated with different type parameters. This will be
NaN
if the symbol reference is not transient. Note: This can only be non-NaN if pos is finite.
method getStableKey
getStableKey: () => ReflectionSymbolIdString;
method toDeclarationReference
toDeclarationReference: () => DeclarationReference;
method toObject
toObject: (serializer: Serializer) => { sourceFileName: string; qualifiedName: string;};
class ReflectionType
class ReflectionType extends Type {}
Represents a type which has it's own reflection like literal types. This type will likely go away at some point and be replaced by a dedicated
ObjectType
. Allowing reflections to be nested within types causes much pain in the rendering code.let value: { a: string, b: number };Types
constructor
constructor(declaration: DeclarationReflection);
property declaration
declaration: DeclarationReflection;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.ReflectionType;
class RestType
class RestType extends Type {}
Represents a rest type
type Z = [1, ...2[]]// ^^^^^^Types
constructor
constructor(elementType: SomeType);
property elementType
elementType: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.RestType;
class SignatureReflection
class SignatureReflection extends Reflection {}
Reflections
constructor
constructor( name: string, kind: | ReflectionKind.CallSignature | ReflectionKind.IndexSignature | ReflectionKind.ConstructorSignature | ReflectionKind.GetSignature | ReflectionKind.SetSignature, parent: DeclarationReflection);
property implementationOf
implementationOf?: ReferenceType;
A type that points to the reflection this reflection is the implementation of.
Applies to class members.
property inheritedFrom
inheritedFrom?: ReferenceType;
A type that points to the reflection this reflection has been inherited from.
Applies to interface and class members.
property kind
kind: | ReflectionKind.CallSignature | ReflectionKind.IndexSignature | ReflectionKind.ConstructorSignature | ReflectionKind.GetSignature | ReflectionKind.SetSignature;
property overwrites
overwrites?: ReferenceType;
A type that points to the reflection that has been overwritten by this reflection.
Applies to interface and class members.
property parameters
parameters?: ParameterReflection[];
property parent
parent: DeclarationReflection;
property sources
sources?: SourceReference[];
A list of all source files that contributed to this reflection.
property type
type?: SomeType;
property typeParameters
typeParameters?: TypeParameterReflection[];
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.SignatureReflection) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.SignatureReflection;
method toString
toString: () => string;
Return a string representation of this reflection.
method traverse
traverse: (callback: TraverseCallback) => void;
class SourceReference
class SourceReference {}
Represents references of reflections to their defining source files.
See Also
constructor
constructor(fileName: string, line: number, character: number);
property character
character: number;
The index of the character that emitted the declaration.
property fileName
fileName: string;
The filename of the source file.
property line
line: number;
The one based number of the line that emitted the declaration.
property url
url?: string;
URL for displaying the source file.
method equals
equals: (other: SourceReference) => boolean;
method fromObject
fromObject: (_de: Deserializer, obj: JSONSourceReference) => void;
method toObject
toObject: () => JSONSourceReference;
class TemplateLiteralType
class TemplateLiteralType extends Type {}
TS 4.1 template literal types
type Z = `${'a' | 'b'}${'a' | 'b'}`Types
constructor
constructor(head: string, tail: [SomeType, string][]);
property head
head: string;
property tail
tail: [SomeType, string][];
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TemplateLiteralType;
class TupleType
class TupleType extends Type {}
Represents a tuple type.
let value: [string, boolean];Types
constructor
constructor(elements: SomeType[]);
Parameter elements
The ordered type elements of the tuple type.
property elements
elements: SomeType[];
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: () => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TupleType;
class Type
abstract class Type {}
Base class of all type definitions. Types
property type
abstract readonly type: keyof TypeKindMap;
The type name identifier.
method estimatePrintWidth
estimatePrintWidth: () => number;
Return the estimated size of the type if it was all printed on one line.
method fromObject
fromObject: (_de: Deserializer, _obj: JSONOutput.SomeType) => void;
method getTypeString
protected abstract getTypeString: () => string;
Implementation method for
toString
.needsParenthesis
will be used to determine if the returned string should be wrapped in parenthesis.
method needsParenthesis
abstract needsParenthesis: (context: TypeContext) => boolean;
method stringify
stringify: (context: TypeContext) => string;
method toObject
abstract toObject: (serializer: Serializer) => JSONOutput.SomeType;
method toString
toString: () => string;
Return a string representation of this type.
method visit
visit: { <T, A extends any[] = []>(visitor: TypeVisitor<T, A>, ...args: A): T; <T, A extends any[] = []>( visitor: Partial<TypeVisitor<T, A>>, ...args: A ): T;};
Visit this type, returning the value returned by the visitor.
class TypeOperatorType
class TypeOperatorType extends Type {}
Represents a type operator type.
class A {}class B<T extends keyof A> {}Types
constructor
constructor(target: SomeType, operator: 'readonly' | 'keyof' | 'unique');
property operator
operator: 'readonly' | 'keyof' | 'unique';
property target
target: SomeType;
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TypeOperatorType;
class TypeParameterReflection
class TypeParameterReflection extends Reflection {}
Reflections
constructor
constructor( name: string, parent: Reflection, varianceModifier: VarianceModifier);
property default
default?: SomeType;
property parent
parent?: DeclarationReflection | SignatureReflection;
property type
type?: SomeType;
property varianceModifier
varianceModifier?: VarianceModifier;
property variant
readonly variant: string;
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.TypeParameterReflection) => void;
method toObject
toObject: (serializer: Serializer) => JSONOutput.TypeParameterReflection;
method traverse
traverse: (_callback: TraverseCallback) => void;
class UnionType
class UnionType extends Type {}
Represents an union type.
let value: string | string[];Types
constructor
constructor(types: SomeType[]);
property elementSummaries
elementSummaries?: CommentDisplayPart[][];
If present, there should be as many items in this array as there are items in the types array.
This member is only valid on unions which are on with a ReflectionKind
kind
ofTypeAlias
. Specifying it on any other union is undefined behavior.
property type
readonly type: string;
property types
types: SomeType[];
method fromObject
fromObject: (de: Deserializer, obj: JSONOutput.UnionType) => void;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
method toObject
toObject: (serializer: Serializer) => JSONOutput.UnionType;
class UnknownType
class UnknownType extends Type {}
Represents all unknown types that cannot be converted by TypeDoc. Types
constructor
constructor(name: string);
property name
name: string;
A string representation of the type as returned from TypeScript compiler.
property type
readonly type: string;
method getTypeString
protected getTypeString: () => string;
method needsParenthesis
needsParenthesis: (context: TypeContext) => boolean;
Always returns true if not at the root level, we have no idea what's in here, so wrap it in parenthesis to be extra safe.
method toObject
toObject: () => JSONOutput.UnknownType;
class ValidatingFileRegistry
class ValidatingFileRegistry extends FileRegistry {}
method fromObject
fromObject: (de: Deserializer, obj: JSONFileRegistry) => void;
method register
register: ( sourcePath: string, relativePath: string) => { target: number; anchor: string | undefined } | undefined;
interface DeclarationHierarchy
interface DeclarationHierarchy {}
Stores hierarchical type data.
See Also
interface InlineTagDisplayPart
interface InlineTagDisplayPart {}
Represents an inline tag like
{@link Foo}
The
@link
,@linkcode
, and@linkplain
tags may have atarget
property set indicating which reflection/url they link to. They may also have atsLinkText
property which includes the part of thetext
which TypeScript thinks should be displayed as the link text. Comments
property kind
kind: 'inline-tag';
property tag
tag: `@${string}`;
property target
target?: Reflection | string | ReflectionSymbolId;
property text
text: string;
property tsLinkText
tsLinkText?: string;
interface ReflectionVariant
interface ReflectionVariant {}
A map of known Reflection concrete subclasses. This is used during deserialization to reconstruct serialized objects.
property declaration
declaration: DeclarationReflection;
property document
document: DocumentReflection;
property param
param: ParameterReflection;
property project
project: ProjectReflection;
property reference
reference: ReferenceReflection;
property signature
signature: SignatureReflection;
property typeParam
typeParam: TypeParameterReflection;
interface RelativeLinkDisplayPart
interface RelativeLinkDisplayPart {}
Represents a reference to a path relative to where the comment resides. This is used to detect and copy relative image links.
Use FileRegistry to determine what path on disc this refers to.
This is used for relative links within comments/documents. It is used to mark pieces of text which need to be replaced to make links work properly. Comments
property kind
kind: 'relative-link';
property target
target: number | undefined;
A link to either some document outside of the project or a reflection. This may be
undefined
if the relative path does not exist.
property targetAnchor
targetAnchor: string | undefined;
Anchor within the target page, validated after rendering if possible
property text
text: string;
The original relative text from the parsed comment.
interface TraverseCallback
interface TraverseCallback {}
call signature
(reflection: Reflection, property: TraverseProperty): | boolean | NeverIfInternal<void>;
May return false to bail out of any further iteration. To preserve backwards compatibility, if a function returns undefined, iteration must continue.
interface TypeKindMap
interface TypeKindMap {}
Types
property array
array: ArrayType;
property conditional
conditional: ConditionalType;
property indexedAccess
indexedAccess: IndexedAccessType;
property inferred
inferred: InferredType;
property intersection
intersection: IntersectionType;
property intrinsic
intrinsic: IntrinsicType;
property literal
literal: LiteralType;
property mapped
mapped: MappedType;
property namedTupleMember
namedTupleMember: NamedTupleMember;
property optional
optional: OptionalType;
property predicate
predicate: PredicateType;
property query
query: QueryType;
property reference
reference: ReferenceType;
property reflection
reflection: ReflectionType;
property rest
rest: RestType;
property templateLiteral
templateLiteral: TemplateLiteralType;
property tuple
tuple: TupleType;
property typeOperator
typeOperator: TypeOperatorType;
property union
union: UnionType;
property unknown
unknown: UnknownType;
enum ReflectionFlag
enum ReflectionFlag { None = 0, Private = 1, Protected = 2, Public = 4, Static = 8, External = 16, Optional = 32, Rest = 64, Abstract = 128, Const = 256, Readonly = 512, Inherited = 1024,}
member Abstract
Abstract = 128
member Const
Const = 256
member External
External = 16
member Inherited
Inherited = 1024
member None
None = 0
member Optional
Optional = 32
member Private
Private = 1
member Protected
Protected = 2
member Public
Public = 4
member Readonly
Readonly = 512
member Rest
Rest = 64
member Static
Static = 8
enum ReflectionKind
enum ReflectionKind { Project = 1, Module = 2, Namespace = 4, Enum = 8, EnumMember = 16, Variable = 32, Function = 64, Class = 128, Interface = 256, Constructor = 512, Property = 1024, Method = 2048, CallSignature = 4096, IndexSignature = 8192, ConstructorSignature = 16384, Parameter = 32768, TypeLiteral = 65536, TypeParameter = 131072, Accessor = 262144, GetSignature = 524288, SetSignature = 1048576, TypeAlias = 2097152, Reference = 4194304, Document = 8388608,}
Defines the available reflection kinds. Reflections
member Accessor
Accessor = 262144
member CallSignature
CallSignature = 4096
member Class
Class = 128
member Constructor
Constructor = 512
member ConstructorSignature
ConstructorSignature = 16384
member Document
Document = 8388608
Generic non-ts content to be included in the generated docs as its own page.
member Enum
Enum = 8
member EnumMember
EnumMember = 16
member Function
Function = 64
member GetSignature
GetSignature = 524288
member IndexSignature
IndexSignature = 8192
member Interface
Interface = 256
member Method
Method = 2048
member Module
Module = 2
member Namespace
Namespace = 4
member Parameter
Parameter = 32768
member Project
Project = 1
member Property
Property = 1024
member Reference
Reference = 4194304
member SetSignature
SetSignature = 1048576
member TypeAlias
TypeAlias = 2097152
member TypeLiteral
TypeLiteral = 65536
member TypeParameter
TypeParameter = 131072
member Variable
Variable = 32
enum TraverseProperty
enum TraverseProperty { Children = 0, Documents = 1, Parameters = 2, TypeLiteral = 3, TypeParameter = 4, Signatures = 5, IndexSignature = 6, GetSignature = 7, SetSignature = 8,}
member Children
Children = 0
member Documents
Documents = 1
member GetSignature
GetSignature = 7
member IndexSignature
IndexSignature = 6
member Parameters
Parameters = 2
member SetSignature
SetSignature = 8
member Signatures
Signatures = 5
member TypeLiteral
TypeLiteral = 3
member TypeParameter
TypeParameter = 4
type CommentDisplayPart
type CommentDisplayPart = /** * Represents a plain text portion of the comment, may contain markdown */ | { kind: 'text'; text: string; } /** * Represents a code block separated out form the plain text entry so * that TypeDoc knows to skip it when parsing relative links and inline tags. **/ | { kind: 'code'; text: string; } | InlineTagDisplayPart | RelativeLinkDisplayPart;
Represents a parsed piece of a comment. Comments
See Also
type ReflectionId
type ReflectionId = number & { __reflectionIdBrand: never;};
type ReflectionSymbolIdString
type ReflectionSymbolIdString = string & { readonly __reflectionSymbolId: unique symbol;};
type ReflectionVisitor
type ReflectionVisitor = { [K in keyof ReflectionVariant]?: (refl: ReflectionVariant[K]) => void;};
type SomeReflection
type SomeReflection = ReflectionVariant[keyof ReflectionVariant];
type SomeType
type SomeType = TypeKindMap[keyof TypeKindMap];
Types
type TypeContext
type TypeContext = (typeof TypeContext)[keyof typeof TypeContext];
type TypeKind
type TypeKind = keyof TypeKindMap;
Types
type TypeVisitor
type TypeVisitor<T = void, A extends any[] = []> = { [K in TypeKind]: (type: TypeKindMap[K], ...args: A) => T;};
type VarianceModifier
type VarianceModifier = (typeof VarianceModifier)[keyof typeof VarianceModifier];
namespace Models.ReflectionKind
namespace Models.ReflectionKind {}
Reflections
function classString
classString: (kind: ReflectionKind) => string;
function pluralString
pluralString: (kind: ReflectionKind) => string;
Get a non-localized kind string. For the localized string, use
app.internationalization.kindPluralString(kind)
function singularString
singularString: (kind: ReflectionKind) => string;
Get a non-localized kind string. For the localized string, use
app.internationalization.kindSingularString(kind)
type KindString
type KindString = EnumKeys<typeof ReflectionKind>;
namespace OptionDefaults
module 'dist/lib/utils/options/defaults.d.ts' {}
Defaults values for TypeDoc options
variable blockTags
const blockTags: readonly `@${string}`[];
variable cascadedModifierTags
const cascadedModifierTags: readonly `@${string}`[];
variable excludeNotDocumentedKinds
const excludeNotDocumentedKinds: readonly EnumKeys<typeof ReflectionKind>[];
variable excludeTags
const excludeTags: readonly `@${string}`[];
variable highlightLanguages
const highlightLanguages: readonly BundledLanguage[];
variable ignoredHighlightLanguages
const ignoredHighlightLanguages: readonly string[];
variable inlineTags
const inlineTags: readonly `@${string}`[];
variable kindSortOrder
const kindSortOrder: readonly EnumKeys<typeof ReflectionKind>[];
variable modifierTags
const modifierTags: readonly `@${string}`[];
variable notRenderedTags
const notRenderedTags: readonly `@${string}`[];
variable requiredToBeDocumented
const requiredToBeDocumented: readonly EnumKeys<typeof ReflectionKind>[];
variable sort
const sort: readonly string[];
namespace ReflectionKind
namespace ReflectionKind {}
Reflections
function classString
classString: (kind: ReflectionKind) => string;
function pluralString
pluralString: (kind: ReflectionKind) => string;
Get a non-localized kind string. For the localized string, use
app.internationalization.kindPluralString(kind)
function singularString
singularString: (kind: ReflectionKind) => string;
Get a non-localized kind string. For the localized string, use
app.internationalization.kindSingularString(kind)
type KindString
type KindString = EnumKeys<typeof ReflectionKind>;
Package Files (60)
- dist/index.d.ts
- dist/lib/application.d.ts
- dist/lib/converter/comments/declarationReference.d.ts
- dist/lib/converter/comments/index.d.ts
- dist/lib/converter/comments/linkResolver.d.ts
- dist/lib/converter/context.d.ts
- dist/lib/converter/converter.d.ts
- dist/lib/internationalization/index.d.ts
- dist/lib/internationalization/internationalization.d.ts
- dist/lib/models/FileRegistry.d.ts
- dist/lib/models/ReflectionCategory.d.ts
- dist/lib/models/ReflectionGroup.d.ts
- dist/lib/models/comments/comment.d.ts
- dist/lib/models/index.d.ts
- dist/lib/models/reflections/ReflectionSymbolId.d.ts
- dist/lib/models/reflections/abstract.d.ts
- dist/lib/models/reflections/container.d.ts
- dist/lib/models/reflections/declaration.d.ts
- dist/lib/models/reflections/document.d.ts
- dist/lib/models/reflections/kind.d.ts
- dist/lib/models/reflections/parameter.d.ts
- dist/lib/models/reflections/project.d.ts
- dist/lib/models/reflections/reference.d.ts
- dist/lib/models/reflections/signature.d.ts
- dist/lib/models/reflections/type-parameter.d.ts
- dist/lib/models/reflections/utils.d.ts
- dist/lib/models/reflections/variant.d.ts
- dist/lib/models/sources/file.d.ts
- dist/lib/models/types.d.ts
- dist/lib/output/events.d.ts
- dist/lib/output/models/UrlMapping.d.ts
- dist/lib/output/output.d.ts
- dist/lib/output/renderer.d.ts
- dist/lib/output/theme.d.ts
- dist/lib/output/themes/default/DefaultTheme.d.ts
- dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts
- dist/lib/output/themes/default/Slugger.d.ts
- dist/lib/serialization/components.d.ts
- dist/lib/serialization/deserializer.d.ts
- dist/lib/serialization/events.d.ts
- dist/lib/serialization/schema.d.ts
- dist/lib/serialization/serializer.d.ts
- dist/lib/utils/entry-point.d.ts
- dist/lib/utils/enum.d.ts
- dist/lib/utils/events.d.ts
- dist/lib/utils/hooks.d.ts
- dist/lib/utils/jsx.d.ts
- dist/lib/utils/jsx.elements.d.ts
- dist/lib/utils/loggers.d.ts
- dist/lib/utils/minimalSourceFile.d.ts
- dist/lib/utils/options/declaration.d.ts
- dist/lib/utils/options/defaults.d.ts
- dist/lib/utils/options/index.d.ts
- dist/lib/utils/options/options.d.ts
- dist/lib/utils/options/readers/arguments.d.ts
- dist/lib/utils/options/readers/package-json.d.ts
- dist/lib/utils/options/readers/tsconfig.d.ts
- dist/lib/utils/options/readers/typedoc.d.ts
- dist/lib/utils/paths.d.ts
- dist/lib/utils/sort.d.ts
Dependencies (5)
Dev Dependencies (15)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/typedoc
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/typedoc)
- HTML<a href="https://www.jsdocs.io/package/typedoc"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 19875 ms. - Missing or incorrect documentation? Open an issue for this package.