@microsoft/tsdoc
- Version 0.15.1
- Published
- 2.71 MB
- No dependencies
- MIT license
Install
npm i @microsoft/tsdoc
yarn add @microsoft/tsdoc
pnpm add @microsoft/tsdoc
Overview
A parser for the TypeScript doc comment syntax
Index
Classes
TSDocConfiguration
- addTagDefinition()
- addTagDefinitions()
- allTsdocMessageIds
- clear()
- docNodeManager
- isHtmlElementSupported()
- isKnownMessageId()
- isTagSupported()
- setSupportedHtmlElements()
- setSupportForTag()
- setSupportForTags()
- supportedHtmlElements
- supportedTagDefinitions
- tagDefinitions
- tryGetTagDefinition()
- tryGetTagDefinitionWithUpperCase()
- validation
Interfaces
IDocParamBlockParsedParameters
- hyphenExcerpt
- parameterName
- parameterNameExcerpt
- spacingAfterHyphenExcerpt
- spacingAfterParameterNameExcerpt
- spacingBeforeParameterNameExcerpt
- unsupportedJsdocOptionalNameOpenBracketExcerpt
- unsupportedJsdocOptionalNameRestExcerpt
- unsupportedJsdocTypeAfterHyphenExcerpt
- unsupportedJsdocTypeAfterParameterNameExcerpt
- unsupportedJsdocTypeBeforeParameterNameExcerpt
Enums
ExcerptKind
- BlockTag
- CodeSpan_ClosingDelimiter
- CodeSpan_Code
- CodeSpan_OpeningDelimiter
- DeclarationReference_ImportHash
- DeclarationReference_ImportPath
- DeclarationReference_PackageName
- DocMemberSymbol_LeftBracket
- DocMemberSymbol_RightBracket
- ErrorText
- EscapedText
- FencedCode_ClosingFence
- FencedCode_Code
- FencedCode_Language
- FencedCode_OpeningFence
- HtmlAttribute_Equals
- HtmlAttribute_Name
- HtmlAttribute_Value
- HtmlEndTag_ClosingDelimiter
- HtmlEndTag_Name
- HtmlEndTag_OpeningDelimiter
- HtmlStartTag_ClosingDelimiter
- HtmlStartTag_Name
- HtmlStartTag_OpeningDelimiter
- InlineTag_ClosingDelimiter
- InlineTag_OpeningDelimiter
- InlineTag_TagContent
- InlineTag_TagName
- LinkTag_LinkText
- LinkTag_Pipe
- LinkTag_UrlDestination
- MemberIdentifier_Identifier
- MemberIdentifier_LeftQuote
- MemberIdentifier_RightQuote
- MemberReference_Colon
- MemberReference_Dot
- MemberReference_LeftParenthesis
- MemberReference_RightParenthesis
- MemberSelector
- NonstandardText
- ParamBlock_Hyphen
- ParamBlock_ParameterName
- PlainText
- SoftBreak
- Spacing
TSDocMessageId
- AtSignInWord
- AtSignWithoutTagName
- CharactersAfterBlockTag
- CharactersAfterInlineTag
- CodeFenceClosingIndent
- CodeFenceClosingSyntax
- CodeFenceMissingDelimiter
- CodeFenceOpeningIndent
- CodeFenceSpecifierSyntax
- CodeSpanEmpty
- CodeSpanMissingDelimiter
- CommentMissingClosingDelimiter
- CommentNotFound
- CommentOpeningDelimiterSyntax
- ConfigFileCyclicExtends
- ConfigFileDuplicateTagName
- ConfigFileInvalidTagName
- ConfigFileNotFound
- ConfigFileSchemaError
- ConfigFileUndefinedTag
- ConfigFileUnresolvedExtends
- ConfigFileUnsupportedSchema
- ConfigInvalidJson
- EscapeGreaterThan
- EscapeRightBrace
- ExtraInheritDocTag
- HtmlStringMissingQuote
- HtmlTagMissingEquals
- HtmlTagMissingGreaterThan
- HtmlTagMissingString
- InheritDocIncompatibleSummary
- InheritDocIncompatibleTag
- InheritDocTagSyntax
- InlineTagMissingBraces
- InlineTagMissingRightBrace
- InlineTagUnescapedBrace
- LinkTagDestinationSyntax
- LinkTagEmpty
- LinkTagInvalidUrl
- LinkTagUnescapedText
- MalformedHtmlName
- MalformedInlineTag
- MalformedTagName
- MissingDeprecationMessage
- MissingHtmlEndTag
- MissingReference
- MissingTag
- ParamTagMissingHyphen
- ParamTagWithInvalidName
- ParamTagWithInvalidOptionalName
- ParamTagWithInvalidType
- ReferenceEmptyIdentifier
- ReferenceHashSyntax
- ReferenceMalformedImportPath
- ReferenceMalformedPackageName
- ReferenceMissingColon
- ReferenceMissingDot
- ReferenceMissingHash
- ReferenceMissingIdentifier
- ReferenceMissingLabel
- ReferenceMissingQuote
- ReferenceMissingRightBracket
- ReferenceMissingRightParen
- ReferenceSelectorMissingParens
- ReferenceSelectorSyntax
- ReferenceSymbolSyntax
- ReferenceUnquotedIdentifier
- TagShouldNotHaveBraces
- TextAfterHtmlString
- UndefinedTag
- UnnecessaryBackslash
- UnsupportedHtmlElementName
- UnsupportedTag
Type Aliases
Classes
class DocBlock
class DocBlock extends DocNode {}
Represents a section that is introduced by a TSDoc block tag. For example, an
@example
block.
property blockTag
readonly blockTag: DocBlockTag;
The TSDoc tag that introduces this section.
property content
readonly content: DocSection;
The TSDoc tag that introduces this section.
property kind
readonly kind: string;
Modifiers
@override
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocBlockTag
class DocBlockTag extends DocNode {}
Represents a TSDoc block tag such as
@param
or@public
.
property kind
readonly kind: string;
Modifiers
@override
property tagName
readonly tagName: string;
The TSDoc tag name. TSDoc tag names start with an at-sign (
@
) followed by ASCII letters using "camelCase" capitalization.
property tagNameWithUpperCase
readonly tagNameWithUpperCase: string;
The TSDoc tag name in all capitals, which is used for performing case-insensitive comparisons or lookups.
method getTokenSequence
getTokenSequence: () => TokenSequence;
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocCodeSpan
class DocCodeSpan extends DocNode {}
Represents CommonMark-style code span, i.e. code surrounded by backtick characters.
property code
readonly code: string;
The text that should be rendered as code, excluding the backtick delimiters.
property kind
readonly kind: string;
Modifiers
@override
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocComment
class DocComment extends DocNode {}
Represents an entire documentation comment conforming to the TSDoc structure. This is the root of the DocNode tree.
property customBlocks
readonly customBlocks: readonly DocBlock[];
The collection of all DocBlock nodes belonging to this doc comment.
property deprecatedBlock
deprecatedBlock: DocBlock;
If present, this block indicates that an API item is no loner supported and may be removed in a future release. The
@deprecated
tag must be followed by a sentence describing the recommended alternative. Deprecation recursively applies to members of a container. For example, if a class is deprecated, then so are all of its members.
property inheritDocTag
inheritDocTag: DocInheritDocTag;
If this doc comment contains an
@inheritDoc
tag, it will be extracted and associated with the DocComment.
property kind
readonly kind: string;
Modifiers
@override
property modifierTagSet
readonly modifierTagSet: StandardModifierTagSet;
The modifier tags for this DocComment.
property params
readonly params: DocParamCollection;
The collection of parsed
@param
blocks for this doc comment.
property privateRemarks
privateRemarks: DocBlock;
The
@privateRemarks
tag starts a block of additional commentary that is not meant for an external audience. A documentation tool must omit this content from an API reference web site. It should also be omitted when generating a normalized *.d.ts file intended for third-party developers.Remarks
A similar effect could be accomplished by enclosing content inside CommonMark
<!-- -->
comments, or by moving the content into a separate//
TypeScript comment. However, the@privateRemarks
tag is a more formal convention.
property remarksBlock
remarksBlock: DocBlock;
The main documentation for an API item is separated into a brief "summary" section optionally followed by an
@remarks
block containing additional details.Remarks
Unlike the summary, the remarks block may contain lengthy documentation content. The remarks should not restate information from the summary, since the summary section will always be displayed wherever the remarks section appears. Other sections (e.g. an
@example
block) will be shown after the remarks section.
property returnsBlock
returnsBlock: DocBlock;
The
@returns
block for this doc comment, or undefined if there is not one.
property seeBlocks
readonly seeBlocks: readonly DocBlock[];
The collection of all
@see
DockBlockTag nodes belonging to this doc comment.
property summarySection
summarySection: DocSection;
The main documentation for an API item is separated into a brief "summary" section, optionally followed by an
@remarks
block containing additional details.Remarks
The summary section should be brief. On a documentation web site, it will be shown on a page that lists summaries for many different API items. On a detail page for a single item, the summary will be shown followed by the remarks section (if any).
property typeParams
readonly typeParams: DocParamCollection;
The collection of parsed
@typeParam
blocks for this doc comment.
method appendCustomBlock
appendCustomBlock: (block: DocBlock) => void;
Append an item to the customBlocks collection.
method emitAsTsdoc
emitAsTsdoc: () => string;
Generates a doc comment corresponding to the
DocComment
tree. The output is in a normalized form, and may ignore formatting/spacing from the original input.Remarks
After parsing a string, and possibly modifying the result,
emitAsTsdoc()
can be used to render the result as a doc comment in a normalized format. It can also be used to emit aDocComment
tree that was constructed manually.This method is provided as convenience for simple use cases. To customize the output, or if you need to render into a
StringBuilder
, use the TSDocEmitter class instead.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocDeclarationReference
class DocDeclarationReference extends DocNode {}
Represents a declaration reference.
Remarks
Declaration references are TSDoc expressions used by tags such as
{@link}
or{@inheritDoc}
that need to refer to another declaration.
property importPath
readonly importPath: string;
The optional import path. If a package name is provided, then if an import path is provided, the path must start with a "/" delimiter; otherwise paths are resolved relative to the source file containing the reference.
Example:
"/path1/path2"
Example:"./path1/path2"
Example:"../path2/path2"
property kind
readonly kind: string;
Modifiers
@override
property memberReferences
readonly memberReferences: readonly DocMemberReference[];
The chain of member references that indicate the declaration being referenced. If this list is empty, then either the packageName or importPath must be provided, because the reference refers to a module.
property packageName
readonly packageName: string;
The optional package name, which may optionally include an NPM scope.
Example:
"@scope/my-package"
method emitAsTsdoc
emitAsTsdoc: () => string;
Generates the TSDoc representation of this declaration reference.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocErrorText
class DocErrorText extends DocNode {}
Represents a span of text that contained invalid markup. The characters should be rendered as plain text.
property errorLocation
readonly errorLocation: TokenSequence;
The range of characters that caused the error. In general these may be somewhat farther ahead in the input stream from the DocErrorText node itself.
Remarks
For example, for the malformed HTML tag
<a href="123" @ /a>
, the DocErrorText node will correspond to the<
character that looked like an HTML tag, whereas the error location might be the@
character that caused the trouble.
property errorMessage
readonly errorMessage: string;
A description of why the character could not be parsed.
property kind
readonly kind: string;
Modifiers
@override
property messageId
readonly messageId: TSDocMessageId;
The TSDoc error message identifier.
property text
readonly text: string;
The characters that should be rendered as plain text because they could not be parsed successfully.
property textExcerpt
readonly textExcerpt: TokenSequence;
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocEscapedText
class DocEscapedText extends DocNode {}
Represents a text character that should be escaped as a TSDoc symbol.
Remarks
Note that renders will normally apply appropriate escaping when rendering DocPlainText in a format such as HTML or TSDoc. The DocEscapedText node forces a specific escaping that may not be the default.
property decodedText
readonly decodedText: string;
The text without escaping.
property encodedText
readonly encodedText: string;
The text sequence including escapes.
property escapeStyle
readonly escapeStyle: number;
The style of escaping to be performed.
property kind
readonly kind: string;
Modifiers
@override
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocExcerpt
class DocExcerpt extends DocNode {}
Represents a parsed token sequence.
Remarks
When a
DocNode
is created by parsing a doc comment, it will haveDocExcerpt
child nodes corresponding to the parsed syntax elements such as names, keywords, punctuation, and spaces. These excerpts indicate the original coordinates of the syntax element, and thus can be used for syntax highlighting and precise error reporting. They could also be used to rewrite specific words in a source file (e.g. renaming a parameter) without disturbing any other characters in the file.Every parsed character will correspond to at most one DocExcerpt object. In other words, excerpts never overlap. A given excerpt can span multiple comment lines, and it may contain gaps, for example to skip the
*
character that starts a new TSDoc comment line.
property content
readonly content: TokenSequence;
The input token sequence corresponding to this excerpt.
Remarks
Note that a token sequence can span multiple input lines and may contain gaps, for example to skip the
*
character that starts a new TSDoc comment line.
property excerptKind
readonly excerptKind: ExcerptKind;
Indicates the kind of DocExcerpt.
property kind
readonly kind: string;
Modifiers
@override
class DocFencedCode
class DocFencedCode extends DocNode {}
Represents CommonMark-style code fence, i.e. a block of program code that starts and ends with a line comprised of three backticks. The opening delimiter can also specify a language for a syntax highlighter.
property code
readonly code: string;
The text that should be rendered as code.
property kind
readonly kind: string;
Modifiers
@override
property language
readonly language: string;
A name that can optionally be included after the opening code fence delimiter, on the same line as the three backticks. This name indicates the programming language for the code, which a syntax highlighter may use to style the code block.
Remarks
The TSDoc standard requires that the language "ts" should be interpreted to mean TypeScript. Other languages names may be supported, but this is implementation dependent.
CommonMark refers to this field as the "info string".
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocHtmlAttribute
class DocHtmlAttribute extends DocNode {}
Represents an HTML attribute inside a DocHtmlStartTag or DocHtmlEndTag.
Example:
href="#"
inside<a href="#" />
property kind
readonly kind: string;
Modifiers
@override
property name
readonly name: string;
The HTML attribute name.
property spacingAfterEquals
readonly spacingAfterEquals: string;
Explicit whitespace that a renderer should insert after the "=". If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
property spacingAfterName
readonly spacingAfterName: string;
Explicit whitespace that a renderer should insert after the HTML attribute name. If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
property spacingAfterValue
readonly spacingAfterValue: string;
Explicit whitespace that a renderer should insert after the HTML attribute name. If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
property value
readonly value: string;
The HTML attribute value.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocHtmlEndTag
class DocHtmlEndTag extends DocNode {}
Represents an HTML end tag. Example:
</a>
property kind
readonly kind: string;
Modifiers
@override
property name
readonly name: string;
The HTML element name.
method emitAsHtml
emitAsHtml: () => string;
Generates the HTML for this tag.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocHtmlStartTag
class DocHtmlStartTag extends DocNode {}
Represents an HTML start tag, which may or may not be self-closing.
Example:
<a href="#" />
property htmlAttributes
readonly htmlAttributes: readonly DocHtmlAttribute[];
The HTML attributes belonging to this HTML element.
property kind
readonly kind: string;
Modifiers
@override
property name
readonly name: string;
The HTML element name.
property selfClosingTag
readonly selfClosingTag: boolean;
If true, then the HTML tag ends with
/>
instead of>
.
property spacingAfterName
readonly spacingAfterName: string;
Explicit whitespace that a renderer should insert after the HTML element name. If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
method emitAsHtml
emitAsHtml: () => string;
Generates the HTML for this tag.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocInheritDocTag
class DocInheritDocTag extends DocInlineTagBase {}
Represents an
{@inheritDoc}
tag.
property declarationReference
readonly declarationReference: DocDeclarationReference;
The declaration that the documentation will be inherited from. If omitted, the documentation will be inherited from the parent class.
property kind
readonly kind: string;
Modifiers
@override
method getChildNodesForContent
protected getChildNodesForContent: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocInlineTag
class DocInlineTag extends DocInlineTagBase {}
Represents a generic TSDoc inline tag, including custom tags.
Remarks
NOTE: Certain tags such as
{@link}
and{@inheritDoc}
have specialized structures and parser rules, and thus are represented using DocLinkTag or DocInheritDocTag instead. However, if the specialized parser rule encounters a syntax error, but the outer framing is correct, then the parser constructs a genericDocInlineTag
instead ofDocErrorText
. This means, for example, that it is possible sometimes forDocInlineTag.tagName
to be"@link"
.
property kind
readonly kind: string;
Modifiers
@override
property tagContent
readonly tagContent: string;
The tag content.
Remarks
For example, if the tag is
{@myTag x=12.34 y=56.78 }
then the tag content would bex=12.34 y=56.78
, including the trailing space but not the leading space.
method getChildNodesForContent
protected getChildNodesForContent: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocInlineTagBase
abstract class DocInlineTagBase extends DocNode {}
The abstract base class for DocInlineTag, DocLinkTag, and DocInheritDocTag.
property tagName
readonly tagName: string;
The TSDoc tag name. TSDoc tag names start with an at-sign (
@
) followed by ASCII letters using "camelCase" capitalization.Remarks
For example, if the inline tag is
{@link Guid.toString | the toString() method}
then the tag name would be@link
.
property tagNameWithUpperCase
readonly tagNameWithUpperCase: string;
The TSDoc tag name in all capitals, which is used for performing case-insensitive comparisons or lookups.
method getChildNodesForContent
protected abstract getChildNodesForContent: () => ReadonlyArray< DocNode | undefined>;
Allows child classes to replace the tagContentParticle with a more detailed set of nodes.
Modifiers
@virtual
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
@sealed
class DocLinkTag
class DocLinkTag extends DocInlineTagBase {}
Represents an
{@link}
tag.
property codeDestination
readonly codeDestination: DocDeclarationReference;
If the link tag refers to a declaration, this returns the declaration reference object; otherwise this property is undefined.
Remarks
Either the
codeDestination
or theurlDestination
property will be defined, but never both.
property kind
readonly kind: string;
Modifiers
@override
property linkText
readonly linkText: string;
An optional text string that is the hyperlink text. If omitted, the documentation renderer will use a default string based on the link itself (e.g. the URL text or the declaration identifier).
Remarks
In HTML, the hyperlink can include leading/trailing space characters around the link text. For example, this HTML will cause a web browser to
y
and also the space character before and after it:x<a href="#Button"> y </a> zUnlike HTML, TSDoc trims leading/trailing spaces. For example, this TSDoc will be displayed
xy z
and underline only they
character:x{@link Button | y } z
property urlDestination
readonly urlDestination: string;
If the link tag was an ordinary URI, this returns the URL string; otherwise this property is undefined.
Remarks
Either the
codeDestination
or theurlDestination
property will be defined, but never both.
method getChildNodesForContent
protected getChildNodesForContent: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocMemberIdentifier
class DocMemberIdentifier extends DocNode {}
A member identifier is part of a DocMemberReference.
property hasQuotes
readonly hasQuotes: boolean;
Returns true if the identifier will be rendered as a quoted string literal instead of as a programming language identifier. This is required if the
identifier
property is not a valid ECMAScript identifier.
property identifier
readonly identifier: string;
The identifier string without any quote encoding.
Remarks
If the value is not a valid ECMAScript identifier, it will be quoted as a string literal during rendering.
property kind
readonly kind: string;
Modifiers
@override
method isValidIdentifier
static isValidIdentifier: (identifier: string) => boolean;
Tests whether the input string can be used without quotes as a member identifier in a declaration reference. If not, DocMemberIdentifier.hasQuotes will be required.
Remarks
In order to be used without quotes, the string must follow the identifier syntax for ECMAScript / TypeScript, and it must not be one of the reserved words used for system selectors (such as
instance
,static
,constructor
, etc).
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocMemberReference
class DocMemberReference extends DocNode {}
A declaration reference includes a chain of member references represented using
DocMemberReference
nodes.Remarks
For example,
example-library#ui.controls.Button.(render:static)
is a declaration reference that contains three member references:ui
,.controls
, and.Button
, and.(render:static)
.
property hasDot
readonly hasDot: boolean;
True if this member reference is preceded by a dot (".") token. It should be false only for the first member in the chain.
property kind
readonly kind: string;
Modifiers
@override
property memberIdentifier
readonly memberIdentifier: DocMemberIdentifier;
The identifier for the referenced member.
Remarks
Either
memberIdentifier
ormemberSymbol
may be specified, but not both.
property memberSymbol
readonly memberSymbol: DocMemberSymbol;
The ECMAScript 6 symbol expression, which may be used instead of an identifier to indicate the referenced member.
Remarks
Either
memberIdentifier
ormemberSymbol
may be specified, but not both.
property selector
readonly selector: DocMemberSelector;
A TSDoc selector, which may be optionally when the identifier or symbol is insufficient to unambiguously determine the referenced declaration.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocMemberSelector
class DocMemberSelector extends DocNode {}
property errorMessage
readonly errorMessage: string;
If the
selectorKind
isSelectorKind.Error
, this string will be defined and provide more detail about why the string was not valid.
property kind
readonly kind: string;
Modifiers
@override
property selector
readonly selector: string;
The text representation of the selector.
Remarks
For system selectors, it will be a predefined lower case name. For label selectors, it will be an upper case name defined using the
{@label}
tag. For index selectors, it will be a positive integer.
property selectorKind
readonly selectorKind: SelectorKind;
Indicates the kind of selector.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocMemberSymbol
class DocMemberSymbol extends DocNode {}
Represents a reference to an ECMAScript 6 symbol that is used to identify a member declaration.
Example 1
In the declaration reference
{@link MyClass.([MySymbols.example]:instance)}
, the member symbol[MySymbols.example]
might be used to reference a property of the class.
property kind
readonly kind: string;
Modifiers
@override
property symbolReference
readonly symbolReference: DocDeclarationReference;
The declaration reference for the ECMAScript 6 symbol that will act as the identifier for the member.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocNode
abstract class DocNode {}
The base class for the parser's Abstract Syntax Tree nodes.
constructor
constructor(parameters: IDocNodeParameters | IDocNodeParsedParameters);
property configuration
readonly configuration: TSDocConfiguration;
property kind
readonly kind: string;
Returns a text string that uniquely identifies the child class type. This is used for example by switch statements to efficiently determine the kind of node.
method getChildNodes
getChildNodes: () => ReadonlyArray<DocNode>;
Returns the list of child nodes for this node. This is useful for visitors that want to scan the tree looking for nodes of a specific type, without having to process intermediary nodes.
method isParsedParameters
static isParsedParameters: ( parameters: IDocNodeParameters | IDocNodeParsedParameters) => parameters is IDocNodeParsedParameters;
A type guard that returns true if the input uses the
IDocNodeParsedParameters
(parser scenario).Remarks
There are two scenarios for constructing
DocNode
objects. The "builder scenario" constructs the object based on literal strings, does NOT create DocExcerpt child nodes, and generally uses the IDocNodeParameters hierarchy for its constructor parameters. The "parser scenario" constructs the object by parsing a TypeScript source file, does create DocExcerpt child nodes, and generally uses the IDocNodeParsedParameters hierarchy.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Overridden by child classes to implement DocNode.getChildNodes.
Modifiers
@virtual
class DocNodeContainer
abstract class DocNodeContainer extends DocNode {}
DocNodeContainer is the base class for DocNode classes that allow arbitrary child nodes to be added by the consumer. The child classes are DocParagraph and DocSection.
property nodes
readonly nodes: readonly DocNode[];
The nodes that were added to this container.
method appendNode
appendNode: (docNode: DocNode) => void;
Append a node to the container.
method appendNodes
appendNodes: (docNodes: ReadonlyArray<DocNode>) => void;
Append nodes to the container.
method clearNodes
clearNodes: () => void;
Remove all nodes from the container.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocNodeManager
class DocNodeManager {}
Part of the TSDocConfiguration object.
Remarks
If you define your own custom subclasses of
DocNode
, they must be registered with theDocNodeManager
. Use DocNodeManager.registerAllowableChildren to specify which DocNodeContainer subclasses are allowed to contain your nodes.
method isAllowedChild
isAllowedChild: (parentKind: string, childKind: string) => boolean;
Returns true if the specified DocNode kind has been registered as an allowable child of the specified parent DocNode kind.
method registerAllowableChildren
registerAllowableChildren: ( parentKind: string, childKinds: ReadonlyArray<string>) => void;
For the given parent DocNode kind, registers the specified DocNode kinds as being allowable children of the parent.
Remarks
To prevent mistakes,
DocNodeContainer
will report an error if you try to add node that was not registered as an allowable child of the container.
method registerDocNodes
registerDocNodes: ( packageName: string, definitions: ReadonlyArray<IDocNodeDefinition>) => void;
Registers a list of IDocNodeDefinition objects to be used with the associated TSDocConfiguration object.
method throwIfNotRegisteredKind
throwIfNotRegisteredKind: (docNodeKind: string) => void;
Reports an error if the specified DocNode kind has not been registered.
class DocNodeTransforms
class DocNodeTransforms {}
Helper functions that transform DocNode trees.
method trimSpacesInParagraph
static trimSpacesInParagraph: (docParagraph: DocParagraph) => DocParagraph;
trimSpacesInParagraphNodes() collapses extra spacing characters from plain text nodes.
Parameter docParagraph
a DocParagraph containing nodes to be transformed
Returns
The transformed child nodes.
Remarks
This is useful when emitting HTML, where any number of spaces are equivalent to a single space. It's also useful when emitting Markdown, where spaces can be misinterpreted as an indented code block.
For example, we might transform this:
nodes: [{ kind: PlainText, text: " Here are some " },{ kind: SoftBreak }{ kind: PlainText, text: " words" },{ kind: SoftBreak }{ kind: InlineTag, text: "{\@inheritDoc}" },{ kind: PlainText, text: "to process." },{ kind: PlainText, text: " " },{ kind: PlainText, text: " " }]...to this:
nodes: [{ kind: PlainText, text: "Here are some " },{ kind: PlainText, text: "words " },{ kind: InlineTag, text: "{\@inheritDoc}" },{ kind: PlainText, text: "to process." }]Note that in this example,
"words "
is not merged with the preceding node because its DocPlainText.excerpt cannot span multiple lines.
class DocParagraph
class DocParagraph extends DocNodeContainer {}
Represents a paragraph of text, similar to a
<p>
element in HTML. Like CommonMark, the TSDoc syntax uses blank lines to delineate paragraphs instead of explicitly notating them.
property kind
readonly kind: string;
Modifiers
@override
class DocParamBlock
class DocParamBlock extends DocBlock {}
Represents a parsed
@param
or@typeParam
block, which provides a description for a function parameter.
property kind
readonly kind: string;
Modifiers
@override
property parameterName
readonly parameterName: string;
The name of the parameter that is being documented. For example "width" in
@param width - the width of the object
.
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocParamCollection
class DocParamCollection extends DocNode {}
Represents a collection of DocParamBlock objects and provides efficient operations for looking up the documentation for a specified parameter name.
property blocks
readonly blocks: readonly DocParamBlock[];
Returns the blocks in this collection.
property count
readonly count: number;
Returns the number of blocks in this collection.
property kind
readonly kind: string;
Modifiers
@override
method [Symbol.iterator]
[Symbol.iterator]: () => IterableIterator<DocParamBlock>;
Provide an iterator for callers that support it.
method add
add: (docParamBlock: DocParamBlock) => void;
Adds a new block to the collection.
method clear
clear: () => void;
Removes all blocks from the collection
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
method tryGetBlockByName
tryGetBlockByName: (parameterName: string) => DocParamBlock | undefined;
Returns the first block whose
parameterName
matches the specified string.Remarks
If the collection was parsed from an input containing errors, there could potentially be more than one DocParamBlock with the same name. In this situation, tryGetBlockByName() will return the first match that it finds.
This lookup is optimized using a dictionary.
class DocPlainText
class DocPlainText extends DocNode {}
Represents a span of comment text that is considered by the parser to contain no special symbols or meaning.
Remarks
The text content must not contain newline characters. Use DocSoftBreak to represent manual line splitting.
property kind
readonly kind: string;
Modifiers
@override
property text
readonly text: string;
The text content.
property textExcerpt
readonly textExcerpt: TokenSequence;
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class DocSection
class DocSection extends DocNodeContainer {}
Represents a general block of rich text.
property kind
readonly kind: string;
Modifiers
@override
method appendNodeInParagraph
appendNodeInParagraph: (docNode: DocNode) => void;
If the last item in DocSection.nodes is not a DocParagraph, a new paragraph is started. Either way, the provided docNode will be appended to the paragraph.
method appendNodesInParagraph
appendNodesInParagraph: (docNodes: ReadonlyArray<DocNode>) => void;
class DocSoftBreak
class DocSoftBreak extends DocNode {}
Instructs a renderer to insert an explicit newline in the output. (Normally the renderer uses a formatting rule to determine where lines should wrap.)
Remarks
In HTML, a soft break is represented as an ASCII newline character (which does not affect the web browser's view), whereas the hard break is the
<br />
element (which starts a new line in the web browser's view).TSDoc follows the same conventions, except the renderer avoids emitting two empty lines (because that could start a new CommonMark paragraph).
property kind
readonly kind: string;
Modifiers
@override
method onGetChildNodes
protected onGetChildNodes: () => ReadonlyArray<DocNode | undefined>;
Modifiers
@override
class ModifierTagSet
class ModifierTagSet {}
Represents a set of modifier tags that were extracted from a doc comment.
Remarks
TSDoc modifier tags are block tags that do not have any associated rich text content. Instead, their presence or absence acts as an on/off switch, indicating some aspect of the underlying API item. For example, the
@internal
modifier indicates that a signature is internal (i.e. not part of the public API contract).
property nodes
readonly nodes: readonly DocBlockTag[];
The original block tag nodes that defined the modifiers in this set, excluding duplicates.
method addTag
addTag: (blockTag: DocBlockTag) => boolean;
Adds a new modifier tag to the set. If a tag already exists with the same name, then no change is made, and the return value is false.
method hasTag
hasTag: (modifierTagDefinition: TSDocTagDefinition) => boolean;
Returns true if the set contains a DocBlockTag matching the specified tag definition. Note that synonyms are not considered. The comparison is case-insensitive. The TSDocTagDefinition must be a modifier tag.
Parameter tagName
The name of the tag, including the
@
prefix For example,@internal
method hasTagName
hasTagName: (modifierTagName: string) => boolean;
Returns true if the set contains a DocBlockTag with the specified tag name. Note that synonyms are not considered. The comparison is case-insensitive.
Parameter modifierTagName
The name of the tag, including the
@
prefix For example,@internal
method tryGetTag
tryGetTag: ( modifierTagDefinition: TSDocTagDefinition) => DocBlockTag | undefined;
Returns a DocBlockTag matching the specified tag definition, or undefined if no such tag was added to the set. If there were multiple instances, returned object will be the first one to be added.
class ParserContext
class ParserContext {}
An internal data structure that tracks all the state being built up by the various parser stages.
constructor
constructor(configuration: TSDocConfiguration, sourceRange: TextRange);
property commentRange
commentRange: TextRange;
The text range starting from the opening
/**
and ending with the closing*\/
delimiter.
property configuration
readonly configuration: TSDocConfiguration;
The configuration that was provided for the TSDocParser.
property docComment
readonly docComment: DocComment;
The parsed doc comment object. This is the primary output of the parser.
property lines
lines: TextRange[];
The text ranges corresponding to the lines of content inside the comment.
property log
readonly log: ParserMessageLog;
A queryable log that reports warnings and error messages that occurred during parsing.
property sourceRange
readonly sourceRange: TextRange;
The
sourceRange
indicates the start and end of the original input that was parsed.
property tokens
tokens: Token[];
A complete list of all tokens that were extracted from the input lines.
class ParserMessage
class ParserMessage {}
Represents an error or warning that occurred during parsing.
constructor
constructor(parameters: IParserMessageParameters);
property docNode
readonly docNode: DocNode;
property messageId
readonly messageId: TSDocMessageId;
A string that uniquely identifies the messages reported by the TSDoc parser.
property text
readonly text: string;
The message text.
property textRange
readonly textRange: TextRange;
property tokenSequence
readonly tokenSequence: TokenSequence;
property unformattedText
readonly unformattedText: string;
The message text without the default prefix that shows line/column information.
method toString
toString: () => string;
class ParserMessageLog
class ParserMessageLog {}
Used to report errors and warnings that occurred during parsing.
property messages
readonly messages: readonly ParserMessage[];
The unfiltered list of all messages.
method addMessage
addMessage: (parserMessage: ParserMessage) => void;
Append a message to the log.
method addMessageForDocErrorText
addMessageForDocErrorText: (docErrorText: DocErrorText) => void;
Append a message associated with a TokenSequence.
method addMessageForTextRange
addMessageForTextRange: ( messageId: TSDocMessageId, messageText: string, textRange: TextRange) => void;
Append a message associated with a TextRange.
method addMessageForTokenSequence
addMessageForTokenSequence: ( messageId: TSDocMessageId, messageText: string, tokenSequence: TokenSequence, docNode?: DocNode) => void;
Append a message associated with a TokenSequence.
class PlainTextEmitter
class PlainTextEmitter {}
Renders a DocNode tree as plain text, without any rich text formatting or markup.
method hasAnyTextContent
static hasAnyTextContent: { (node: DocNode, requiredCharacters?: number): boolean; (nodes: readonly DocNode[], requiredCharacters?: number): boolean;};
Returns true if the specified node contains any text content.
Parameter node
this node and all its children will be considered
Parameter requiredCharacters
The test returns true if at least this many non-spacing characters are found. The default value is 1.
Remarks
A documentation tool can use this test to report warnings when a developer neglected to write a code comment for a declaration.
Returns true if the specified collection of nodes contains any text content.
Parameter nodes
the collection of nodes to be tested
Parameter requiredCharacters
The test returns true if at least this many non-spacing characters are found. The default value is 1.
Remarks
A documentation tool can use this test to report warnings when a developer neglected to write a code comment for a declaration.
class StandardModifierTagSet
class StandardModifierTagSet extends ModifierTagSet {}
Extends the ModifierTagSet base class with getters for modifiers that are part of the standardized core tags for TSDoc.
method isAlpha
isAlpha: () => boolean;
Returns true if the
@alpha
modifier tag was specified.
method isBeta
isBeta: () => boolean;
Returns true if the
@beta
modifier tag was specified.
method isEventProperty
isEventProperty: () => boolean;
Returns true if the
@eventProperty
modifier tag was specified.
method isExperimental
isExperimental: () => boolean;
Returns true if the
@experimental
modifier tag was specified.
method isInternal
isInternal: () => boolean;
Returns true if the
@internal
modifier tag was specified.
method isOverride
isOverride: () => boolean;
Returns true if the
@override
modifier tag was specified.
method isPackageDocumentation
isPackageDocumentation: () => boolean;
Returns true if the
@packageDocumentation
modifier tag was specified.
method isPublic
isPublic: () => boolean;
Returns true if the
@public
modifier tag was specified.
method isReadonly
isReadonly: () => boolean;
Returns true if the
@readonly
modifier tag was specified.
method isSealed
isSealed: () => boolean;
Returns true if the
@sealed
modifier tag was specified.
method isVirtual
isVirtual: () => boolean;
Returns true if the
@virtual
modifier tag was specified.
class StandardTags
class StandardTags {}
Tags whose meaning is defined by the TSDoc standard.
property allDefinitions
static allDefinitions: readonly TSDocTagDefinition[];
Returns the full list of all core tags.
property alpha
static readonly alpha: TSDocTagDefinition;
(Discretionary)
Suggested meaning: Designates that an API item's release stage is "alpha". It is intended to be used by third-party developers eventually, but has not yet been released. The tooling may trim the declaration from a public release.
Remarks
Example implementations: API Extractor
property beta
static readonly beta: TSDocTagDefinition;
(Discretionary)
Suggested meaning: Designates that an API item's release stage is "beta". It has been released to third-party developers experimentally for the purpose of collecting feedback. The API should not be used in production, because its contract may change without notice. The tooling may trim the declaration from a public release, but may include it in a developer preview release.
Remarks
Example implementations: API Extractor
Synonyms:
@experimental
property decorator
static readonly decorator: TSDocTagDefinition;
(Extended)
ECMAScript decorators are sometimes an important part of an API contract. However, today the TypeScript compiler does not represent decorators in the .d.ts output files used by API consumers. The
@decorator
tag provides a workaround, enabling a decorator expressions to be quoted in a doc comment.Example 1
class Book {/*** The title of the book.* @decorator `@jsonSerialized`* @decorator `@jsonFormat(JsonFormats.Url)`*+/@jsonSerialized@jsonFormat(JsonFormats.Url)public website: string;}
property defaultValue
static readonly defaultValue: TSDocTagDefinition;
(Extended)
This block tag is used to document the default value for a field or property, if a value is not assigned explicitly.
Remarks
This tag should only be used with fields or properties that are members of a class or interface.
property deprecated
static readonly deprecated: TSDocTagDefinition;
(Core)
This block tag communicates that an API item is no longer supported and may be removed in a future release. The
@deprecated
tag is followed by a sentence describing the recommended alternative. It recursively applies to members of the container. For example, if a class is deprecated, then so are all of its members.
property eventProperty
static readonly eventProperty: TSDocTagDefinition;
(Extended)
When applied to a class or interface property, this indicates that the property returns an event object that event handlers can be attached to. The event-handling API is implementation-defined, but typically the property return type would be a class with members such as
addHandler()
andremoveHandler()
. A documentation tool can display such properties under an "Events" heading instead of the usual "Properties" heading.
property example
static readonly example: TSDocTagDefinition;
(Extended)
Indicates a documentation section that should be presented as an example illustrating how to use the API. It may include a code sample.
property experimental
static readonly experimental: TSDocTagDefinition;
(Discretionary)
Suggested meaning: Same semantics as
@beta
, but used by tools that don't support an@alpha
release stage.Remarks
Example implementations: Angular API documenter
Synonyms:
@beta
property inheritDoc
static readonly inheritDoc: TSDocTagDefinition;
(Extended)
This inline tag is used to automatically generate an API item's documentation by copying it from another API item. The inline tag parameter contains a reference to the other item, which may be an unrelated class, or even an import from a separate NPM package.
Remarks
What gets copied
The
@inheritDoc
tag does not copy the entire comment body. Only the following components are copied: - summary section -@remarks
block -@params
blocks -@typeParam
blocks -@returns
block Other tags such as@defaultValue
or@example
are not copied, and need to be explicitly included after the@inheritDoc
tag.TODO: The notation for API item references is still being standardized. See this issue: https://github.com/microsoft/tsdoc/issues/9
property internal
static readonly internal: TSDocTagDefinition;
(Discretionary)
Suggested meaning: Designates that an API item is not planned to be used by third-party developers. The tooling may trim the declaration from a public release. In some implementations, certain designated packages may be allowed to consume internal API items, e.g. because the packages are components of the same product.
Remarks
Example implementations: API Extractor
property label
static readonly label: TSDocTagDefinition;
(Core)
The
{@label}
inline tag is used to label a declaration, so that it can be referenced using a selector in the TSDoc declaration reference notation.Remarks
TODO: The
{@label}
notation is still being standardized. See this issue: https://github.com/microsoft/tsdoc/issues/9
property link
static readonly link: TSDocTagDefinition;
(Core)
The
{@link}
inline tag is used to create hyperlinks to other pages in a documentation system or general internet URLs. In particular, it supports expressions for referencing API items.Remarks
TODO: The
{@link}
notation is still being standardized. See this issue: https://github.com/microsoft/tsdoc/issues/9
property override
static readonly override: TSDocTagDefinition;
(Extended)
This modifier has similar semantics to the
override
keyword in C# or Java. For a member function or property, explicitly indicates that this definition is overriding (i.e. redefining) the definition inherited from the base class. The base class definition would normally be marked asvirtual
.Remarks
A documentation tool may enforce that the
@virtual
,@override
, and/or@sealed
modifiers are consistently applied, but this is not required by the TSDoc standard.
property packageDocumentation
static readonly packageDocumentation: TSDocTagDefinition;
(Core)
Used to indicate a doc comment that describes an entire NPM package (as opposed to an individual API item belonging to that package). The
@packageDocumentation
comment is found in the *.d.ts file that acts as the entry point for the package, and it should be the first/**
comment encountered in that file. A comment containing a@packageDocumentation
tag should never be used to describe an individual API item.
property param
static readonly param: TSDocTagDefinition;
(Core)
Used to document a function parameter. The
@param
tag is followed by a parameter name, followed by a hyphen, followed by a description. The TSDoc parser recognizes this syntax and will extract it into a DocParamBlock node.
property privateRemarks
static readonly privateRemarks: TSDocTagDefinition;
(Core)
Starts a section of additional documentation content that is not intended for a public audience. A tool must omit this entire section from the API reference web site, generated *.d.ts file, and any other outputs incorporating the content.
property public
static readonly public: TSDocTagDefinition;
(Discretionary)
Suggested meaning: Designates that an API item's release stage is "public". It has been officially released to third-party developers, and its signature is guaranteed to be stable (e.g. following Semantic Versioning rules).
Remarks
Example implementations: API Extractor
property readonly
static readonly readonly: TSDocTagDefinition;
(Extended)
This modifier tag indicates that an API item should be documented as being read-only, even if the TypeScript type system may indicate otherwise. For example, suppose a class property has a setter function that always throws an exception explaining that the property cannot be assigned; in this situation, the
@readonly
modifier can be added so that the property is shown as read-only in the documentation.Remarks
Example implementations: API Extractor
property remarks
static readonly remarks: TSDocTagDefinition;
(Core)
The main documentation for an API item is separated into a brief "summary" section, optionally followed by a more detailed "remarks" section. On a documentation web site, index pages (e.g. showing members of a class) will show only the brief summaries, whereas a detail pages (e.g. describing a single member) will show the summary followed by the remarks. The
@remarks
block tag ends the summary section, and begins the remarks section for a doc comment.
property returns
static readonly returns: TSDocTagDefinition;
(Core)
Used to document the return value for a function.
property sealed
static readonly sealed: TSDocTagDefinition;
(Extended)
This modifier has similar semantics to the
sealed
keyword in C# or Java. For a class, indicates that subclasses must not inherit from the class. For a member function or property, indicates that subclasses must not override (i.e. redefine) the member.Remarks
A documentation tool may enforce that the
@virtual
,@override
, and/or@sealed
modifiers are consistently applied, but this is not required by the TSDoc standard.
property see
static readonly see: TSDocTagDefinition;
(Extended)
Used to build a list of references to an API item or other resource that may be related to the current item.
Remarks
For example:
/*** Parses a string containing a Uniform Resource Locator (URL).* @see {@link ParsedUrl} for the returned data structure* @see {@link https://tools.ietf.org/html/rfc1738|RFC 1738}* for syntax* @see your developer SDK for code samples* @param url - the string to be parsed* @returns the parsed result*/function parseURL(url: string): ParsedUrl;@see
is a block tag. Each block becomes an item in the list of references. For example, a documentation system might render the above blocks as follows:`function parseURL(url: string): ParsedUrl;`Parses a string containing a Uniform Resource Locator (URL).## See Also- ParsedUrl for the returned data structure- RFC 1738 for syntax- your developer SDK for code samplesNOTE: JSDoc attempts to automatically hyperlink the text immediately after
@see
. Because this is ambiguous with plain text, TSDoc instead requires an explicit{@link}
tag to make hyperlinks.
property throws
static readonly throws: TSDocTagDefinition;
(Extended)
Used to document an exception type that may be thrown by a function or property.
Remarks
A separate
@throws
block should be used to document each exception type. This tag is for informational purposes only, and does not restrict other types from being thrown. It is suggested, but not required, for the@throws
block to start with a line containing only the name of the exception.For example:
/*** Retrieves metadata about a book from the catalog.** @param isbnCode - the ISBN number for the book* @returns the retrieved book object** @throws {@link IsbnSyntaxError}* This exception is thrown if the input is not a valid ISBN number.** @throws {@link book-lib#BookNotFoundError}* Thrown if the ISBN number is valid, but no such book exists in the catalog.** @public*/function fetchBookByIsbn(isbnCode: string): Book;
property typeParam
static readonly typeParam: TSDocTagDefinition;
(Core)
Used to document a generic parameter. The
@typeParam
tag is followed by a parameter name, followed by a hyphen, followed by a description. The TSDoc parser recognizes this syntax and will extract it into a DocParamBlock node.
property virtual
static readonly virtual: TSDocTagDefinition;
(Extended)
This modifier has similar semantics to the
virtual
keyword in C# or Java. For a member function or property, explicitly indicates that subclasses may override (i.e. redefine) the member.Remarks
A documentation tool may enforce that the
@virtual
,@override
, and/or@sealed
modifiers are consistently applied, but this is not required by the TSDoc standard.
class StringBuilder
class StringBuilder implements IStringBuilder {}
This class allows a large text string to be constructed incrementally by appending small chunks. The final string can be obtained by calling StringBuilder.toString().
Remarks
A naive approach might use the
+=
operator to append strings: This would have the downside of copying the entire string each time a chunk is appended, resulting inO(n^2)
bytes of memory being allocated (and later freed by the garbage collector), and many of the allocations could be very large objects. StringBuilder avoids this overhead by accumulating the chunks in an array, and efficiently joining them whengetText()
is finally called.
constructor
constructor();
method append
append: (text: string) => void;
See documentation for IStringBuilder.append.
method toString
toString: () => string;
See documentation for IStringBuilder.toString.
class TextRange
class TextRange {}
Efficiently references a range of text from a string buffer.
property buffer
readonly buffer: string;
The string buffer that the
pos
andend
indexes refer to.
property empty
static readonly empty: TextRange;
Used to represent an empty or unknown range.
property end
readonly end: number;
The (non-inclusive) ending index for the associated text buffer.
Remarks
The text range corresponds to the
range.buffer.substring(range.pos, range.end)
.
property length
readonly length: number;
Returns the length of the text range.
Remarks
This value is calculated as the
end
property minus thepos
property.
property pos
readonly pos: number;
The starting index into the associated text buffer.
Remarks
The text range corresponds to the
range.buffer.substring(range.pos, range.end)
.
method fromString
static fromString: (buffer: string) => TextRange;
Constructs a TextRange that corresponds to an entire string object.
method fromStringRange
static fromStringRange: (buffer: string, pos: number, end: number) => TextRange;
Constructs a TextRange that corresponds to an entire string object.
method getDebugDump
getDebugDump: (posDelimiter: string, endDelimiter: string) => string;
Returns a debugging dump of the range, indicated via custom delimiters.
Remarks
For example if the delimiters are "[" and "]", and the range is 3..5 inside "1234567", then the output would be "12[345]67".
method getLocation
getLocation: (index: number) => ITextLocation;
Calculates the line and column number for the specified offset into the buffer.
Parameter index
an integer offset
Parameter buffer
the buffer
Remarks
This is a potentially expensive operation.
method getNewRange
getNewRange: (pos: number, end: number) => TextRange;
Constructs a TextRange that corresponds to a different range of an existing buffer.
method isEmpty
isEmpty: () => boolean;
Returns true if the length of the range is zero. Note that the object reference may not be equal to
TextRange.empty
, and the buffer may be different.
method toString
toString: () => string;
Returns the range from the associated string buffer.
class Token
class Token {}
Represents a contiguous range of characters extracted from one of the doc comment lines being processed by the Tokenizer. There is a token representing a newline, but otherwise a single token cannot span multiple lines.
constructor
constructor(kind: TokenKind, range: TextRange, line: TextRange);
property kind
readonly kind: TokenKind;
The kind of token
property line
readonly line: TextRange;
The doc comment "line" that this Token was extracted from.
property range
readonly range: TextRange;
The contiguous input range corresponding to the token. This range will never contain a newline character.
method toString
toString: () => string;
class TokenSequence
class TokenSequence {}
Represents a sequence of tokens extracted from
ParserContext.tokens
. This sequence is defined by a starting index and ending index into that array.
constructor
constructor(parameters: ITokenSequenceParameters);
property endIndex
readonly endIndex: number;
The (non-inclusive) ending index into the associated
ParserContext.tokens
list.
property parserContext
readonly parserContext: ParserContext;
The associated parser context that the tokens come from.
property startIndex
readonly startIndex: number;
The starting index into the associated
ParserContext.tokens
list.
property tokens
readonly tokens: readonly Token[];
method createEmpty
static createEmpty: (parserContext: ParserContext) => TokenSequence;
Constructs a TokenSequence object with no tokens.
method getContainingTextRange
getContainingTextRange: () => TextRange;
Returns a TextRange that includes all tokens in the sequence (including any additional characters between doc comment lines).
method getNewSequence
getNewSequence: (startIndex: number, endIndex: number) => TokenSequence;
Constructs a TokenSequence that corresponds to a different range of tokens, e.g. a subrange.
method isEmpty
isEmpty: () => boolean;
method toString
toString: () => string;
Returns the concatenated text of all the tokens.
class TSDocConfiguration
class TSDocConfiguration {}
Configuration for the TSDocParser.
constructor
constructor();
property allTsdocMessageIds
readonly allTsdocMessageIds: readonly TSDocMessageId[];
Returns the list of TSDocMessageId strings that are implemented by this release of the TSDoc parser.
property docNodeManager
readonly docNodeManager: DocNodeManager;
Register custom DocNode subclasses.
property supportedHtmlElements
readonly supportedHtmlElements: string[];
The HTML element names that are supported in this configuration. Used in conjunction with the
reportUnsupportedHtmlElements
setting.
property supportedTagDefinitions
readonly supportedTagDefinitions: readonly TSDocTagDefinition[];
Returns the subset of TSDocConfiguration.tagDefinitions that are supported in this configuration.
Remarks
This property is only used when TSDocValidationConfiguration.reportUnsupportedTags is enabled.
property tagDefinitions
readonly tagDefinitions: readonly TSDocTagDefinition[];
The TSDoc tags that are defined in this configuration.
Remarks
The subset of "supported" tags is tracked by TSDocConfiguration.supportedTagDefinitions.
property validation
readonly validation: TSDocValidationConfiguration;
Enable/disable validation checks performed by the parser.
method addTagDefinition
addTagDefinition: (tagDefinition: TSDocTagDefinition) => void;
Define a new TSDoc tag to be recognized by the TSDocParser, and mark it as unsupported. Use TSDocConfiguration.setSupportForTag to mark it as supported.
Remarks
If a tag is "defined" this means that the parser recognizes it and understands its syntax. Whereas if a tag is "supported", this means it is defined AND the application implements the tag.
method addTagDefinitions
addTagDefinitions: ( tagDefinitions: ReadonlyArray<TSDocTagDefinition>, supported?: boolean | undefined) => void;
Calls TSDocConfiguration.addTagDefinition for a list of definitions, and optionally marks them as supported.
Parameter tagDefinitions
the definitions to be added
Parameter supported
if specified, calls the TSDocConfiguration.setSupportForTag method to mark the definitions as supported or unsupported
method clear
clear: (noStandardTags?: boolean) => void;
Resets the
TSDocConfiguration
object to its initial empty state.Parameter noStandardTags
The
TSDocConfiguration
constructor normally adds definitions for the standard TSDoc tags. SetnoStandardTags
to true for a completely emptytagDefinitions
collection.
method isHtmlElementSupported
isHtmlElementSupported: (htmlTag: string) => boolean;
Returns true if the html element is supported in this configuration.
method isKnownMessageId
isKnownMessageId: (messageId: TSDocMessageId | string) => boolean;
Returns true if the specified TSDocMessageId string is implemented by this release of the TSDoc parser. This can be used to detect misspelled identifiers.
method isTagSupported
isTagSupported: (tagDefinition: TSDocTagDefinition) => boolean;
Returns true if the tag is supported in this configuration.
method setSupportedHtmlElements
setSupportedHtmlElements: (htmlTags: string[]) => void;
Assigns the
supportedHtmlElements
property, replacing any previous elements. This operation sets TSDocValidationConfiguration.reportUnsupportedHtmlElements totrue
.
method setSupportForTag
setSupportForTag: ( tagDefinition: TSDocTagDefinition, supported: boolean) => void;
Specifies whether the tag definition is supported in this configuration. The parser may issue warnings for unsupported tags.
Remarks
If a tag is "defined" this means that the parser recognizes it and understands its syntax. Whereas if a tag is "supported", this means it is defined AND the application implements the tag.
This function automatically sets TSDocValidationConfiguration.reportUnsupportedTags to true.
method setSupportForTags
setSupportForTags: ( tagDefinitions: ReadonlyArray<TSDocTagDefinition>, supported: boolean) => void;
Specifies whether the tag definition is supported in this configuration. This operation sets TSDocValidationConfiguration.reportUnsupportedTags to
true
.Remarks
The parser may issue warnings for unsupported tags. If a tag is "defined" this means that the parser recognizes it and understands its syntax. Whereas if a tag is "supported", this means it is defined AND the application implements the tag.
method tryGetTagDefinition
tryGetTagDefinition: (tagName: string) => TSDocTagDefinition | undefined;
Return the tag that was defined with the specified name, or undefined if not found.
method tryGetTagDefinitionWithUpperCase
tryGetTagDefinitionWithUpperCase: ( alreadyUpperCaseTagName: string) => TSDocTagDefinition | undefined;
Return the tag that was defined with the specified name, or undefined if not found.
class TSDocEmitter
class TSDocEmitter {}
Renders a DocNode tree as a code comment.
property eol
readonly eol: string;
method renderComment
renderComment: (output: IStringBuilder, docComment: DocComment) => void;
method renderDeclarationReference
renderDeclarationReference: ( output: IStringBuilder, declarationReference: DocDeclarationReference) => void;
method renderHtmlTag
renderHtmlTag: ( output: IStringBuilder, htmlTag: DocHtmlStartTag | DocHtmlEndTag) => void;
class TSDocParser
class TSDocParser {}
The main API for parsing TSDoc comments.
constructor
constructor(configuration?: TSDocConfiguration);
property configuration
readonly configuration: TSDocConfiguration;
The configuration that was provided for the TSDocParser.
method parseRange
parseRange: (range: TextRange) => ParserContext;
method parseString
parseString: (text: string) => ParserContext;
class TSDocTagDefinition
class TSDocTagDefinition {}
Defines a TSDoc tag that will be understood by the TSDocParser.
constructor
constructor(parameters: ITSDocTagDefinitionParameters);
property allowMultiple
readonly allowMultiple: boolean;
If true, then this TSDoc tag may appear multiple times in a doc comment. By default, a tag may only appear once.
property standardization
readonly standardization: Standardization;
Indicates the level of support expected from documentation tools that implement the standard.
property syntaxKind
readonly syntaxKind: TSDocTagSyntaxKind;
Specifies the expected syntax for this tag.
property tagName
readonly tagName: string;
The TSDoc tag name. TSDoc tag names start with an at-sign (
@
) followed by ASCII letters using "camelCase" capitalization.
property tagNameWithUpperCase
readonly tagNameWithUpperCase: string;
The TSDoc tag name in all capitals, which is used for performing case-insensitive comparisons or lookups.
method validateTSDocTagName
static validateTSDocTagName: (tagName: string) => void;
Throws an exception if
tagName
is not a valid TSDoc tag name.
class TSDocValidationConfiguration
class TSDocValidationConfiguration {}
Part of the TSDocConfiguration object.
property ignoreUndefinedTags
ignoreUndefinedTags: boolean;
Set
ignoreUndefinedTags
to true to silently ignore unrecognized tags, instead of reporting a warning.Remarks
Normally the parser will issue errors when it encounters tag names that do not have a corresponding definition in TSDocConfiguration.tagDefinitions. This helps to catch common mistakes such as a misspelled tag.
property reportUnsupportedHtmlElements
reportUnsupportedHtmlElements: boolean;
Set
reportUnsupportedHtmlElements
to true to issue a warning for HTML elements which are not defined in your TSDoc configuration'ssupportedHtmlElements
field.
property reportUnsupportedTags
reportUnsupportedTags: boolean;
Set
reportUnsupportedTags
to true to issue a warning for tags that are not supported by your tool.Remarks
The TSDoc standard defines may tags. By default it assumes that if your tool does not implement one of these tags, then it will simply ignore it. But sometimes this may be misleading for developers. (For example, they might write an
@example
block and then be surprised if it doesn't appear in the documentation output.).For a better experience, you can tell the parser which tags you support, and then it will issue warnings wherever unsupported tags are used. This is done using TSDocConfiguration.setSupportForTag. Note that calling that function automatically sets
reportUnsupportedTags
to true.
Interfaces
interface IDocBlockParameters
interface IDocBlockParameters extends IDocNodeParameters {}
Constructor parameters for DocBlock.
property blockTag
blockTag: DocBlockTag;
interface IDocBlockParsedParameters
interface IDocBlockParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocBlock.
property blockTag
blockTag: DocBlockTag;
interface IDocBlockTagParameters
interface IDocBlockTagParameters extends IDocNodeParameters {}
Constructor parameters for DocBlockTag.
property tagName
tagName: string;
interface IDocBlockTagParsedParameters
interface IDocBlockTagParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocBlockTag.
property tagName
tagName: string;
property tagNameExcerpt
tagNameExcerpt: TokenSequence;
interface IDocCodeSpanParameters
interface IDocCodeSpanParameters extends IDocNodeParameters {}
Constructor parameters for DocCodeSpan.
property code
code: string;
interface IDocCodeSpanParsedParameters
interface IDocCodeSpanParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocCodeSpan.
property closingDelimiterExcerpt
closingDelimiterExcerpt: TokenSequence;
property codeExcerpt
codeExcerpt: TokenSequence;
property openingDelimiterExcerpt
openingDelimiterExcerpt: TokenSequence;
interface IDocCommentParameters
interface IDocCommentParameters extends IDocNodeParameters {}
Constructor parameters for DocComment.
interface IDocDeclarationReferenceParameters
interface IDocDeclarationReferenceParameters extends IDocNodeParameters {}
Constructor parameters for DocDeclarationReference.
property importPath
importPath?: string;
property memberReferences
memberReferences?: DocMemberReference[];
property packageName
packageName?: string;
interface IDocDeclarationReferenceParsedParameters
interface IDocDeclarationReferenceParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocDeclarationReference.
property importHashExcerpt
importHashExcerpt?: TokenSequence;
property importPathExcerpt
importPathExcerpt?: TokenSequence;
property memberReferences
memberReferences?: DocMemberReference[];
property packageNameExcerpt
packageNameExcerpt?: TokenSequence;
property spacingAfterImportHashExcerpt
spacingAfterImportHashExcerpt?: TokenSequence;
interface IDocErrorTextParsedParameters
interface IDocErrorTextParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocErrorText.
property errorLocation
errorLocation: TokenSequence;
property errorMessage
errorMessage: string;
property messageId
messageId: TSDocMessageId;
property textExcerpt
textExcerpt: TokenSequence;
interface IDocEscapedTextParsedParameters
interface IDocEscapedTextParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocEscapedText.
property decodedText
decodedText: string;
property encodedTextExcerpt
encodedTextExcerpt: TokenSequence;
property escapeStyle
escapeStyle: EscapeStyle;
interface IDocExcerptParameters
interface IDocExcerptParameters extends IDocNodeParameters {}
Constructor parameters for DocExcerpt.
property content
content: TokenSequence;
property excerptKind
excerptKind: ExcerptKind;
interface IDocFencedCodeParameters
interface IDocFencedCodeParameters extends IDocNodeParameters {}
Constructor parameters for DocFencedCode.
interface IDocFencedCodeParsedParameters
interface IDocFencedCodeParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocFencedCode.
property closingFenceExcerpt
closingFenceExcerpt: TokenSequence;
property codeExcerpt
codeExcerpt: TokenSequence;
property languageExcerpt
languageExcerpt?: TokenSequence;
property openingFenceExcerpt
openingFenceExcerpt: TokenSequence;
property spacingAfterClosingFenceExcerpt
spacingAfterClosingFenceExcerpt?: TokenSequence;
property spacingAfterLanguageExcerpt
spacingAfterLanguageExcerpt?: TokenSequence;
property spacingAfterOpeningFenceExcerpt
spacingAfterOpeningFenceExcerpt?: TokenSequence;
property spacingBeforeClosingFenceExcerpt
spacingBeforeClosingFenceExcerpt?: TokenSequence;
interface IDocHtmlAttributeParameters
interface IDocHtmlAttributeParameters extends IDocNodeParameters {}
Constructor parameters for DocHtmlAttribute.
property name
name: string;
property spacingAfterEquals
spacingAfterEquals?: string;
property spacingAfterName
spacingAfterName?: string;
property spacingAfterValue
spacingAfterValue?: string;
property value
value: string;
interface IDocHtmlAttributeParsedParameters
interface IDocHtmlAttributeParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocHtmlAttribute.
property equalsExcerpt
equalsExcerpt: TokenSequence;
property nameExcerpt
nameExcerpt: TokenSequence;
property spacingAfterEqualsExcerpt
spacingAfterEqualsExcerpt?: TokenSequence;
property spacingAfterNameExcerpt
spacingAfterNameExcerpt?: TokenSequence;
property spacingAfterValueExcerpt
spacingAfterValueExcerpt?: TokenSequence;
property valueExcerpt
valueExcerpt: TokenSequence;
interface IDocHtmlEndTagParameters
interface IDocHtmlEndTagParameters extends IDocNodeParameters {}
Constructor parameters for DocHtmlEndTag.
property name
name: string;
interface IDocHtmlEndTagParsedParameters
interface IDocHtmlEndTagParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocHtmlEndTag.
property closingDelimiterExcerpt
closingDelimiterExcerpt: TokenSequence;
property nameExcerpt
nameExcerpt: TokenSequence;
property openingDelimiterExcerpt
openingDelimiterExcerpt: TokenSequence;
property spacingAfterNameExcerpt
spacingAfterNameExcerpt?: TokenSequence;
interface IDocHtmlStartTagParameters
interface IDocHtmlStartTagParameters extends IDocNodeParameters {}
Constructor parameters for DocHtmlStartTag.
property htmlAttributes
htmlAttributes?: DocHtmlAttribute[];
property name
name: string;
property selfClosingTag
selfClosingTag?: boolean;
property spacingAfterName
spacingAfterName?: string;
interface IDocHtmlStartTagParsedParameters
interface IDocHtmlStartTagParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocHtmlStartTag.
property closingDelimiterExcerpt
closingDelimiterExcerpt: TokenSequence;
property htmlAttributes
htmlAttributes: DocHtmlAttribute[];
property nameExcerpt
nameExcerpt: TokenSequence;
property openingDelimiterExcerpt
openingDelimiterExcerpt: TokenSequence;
property selfClosingTag
selfClosingTag: boolean;
property spacingAfterNameExcerpt
spacingAfterNameExcerpt?: TokenSequence;
interface IDocInheritDocTagParameters
interface IDocInheritDocTagParameters extends IDocInlineTagBaseParameters {}
Constructor parameters for DocInheritDocTag.
property declarationReference
declarationReference?: DocDeclarationReference;
interface IDocInheritDocTagParsedParameters
interface IDocInheritDocTagParsedParameters extends IDocInlineTagBaseParsedParameters {}
Constructor parameters for DocInheritDocTag.
property declarationReference
declarationReference?: DocDeclarationReference;
interface IDocInlineTagBaseParameters
interface IDocInlineTagBaseParameters extends IDocNodeParameters {}
Constructor parameters for DocInlineTagBase.
property tagName
tagName: string;
interface IDocInlineTagBaseParsedParameters
interface IDocInlineTagBaseParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocInlineTagBase.
property closingDelimiterExcerpt
closingDelimiterExcerpt: TokenSequence;
property openingDelimiterExcerpt
openingDelimiterExcerpt: TokenSequence;
property spacingAfterTagNameExcerpt
spacingAfterTagNameExcerpt?: TokenSequence;
property tagName
tagName: string;
property tagNameExcerpt
tagNameExcerpt: TokenSequence;
interface IDocInlineTagParameters
interface IDocInlineTagParameters extends IDocInlineTagBaseParameters {}
Constructor parameters for DocInlineTag.
property tagContent
tagContent: string;
interface IDocInlineTagParsedParameters
interface IDocInlineTagParsedParameters extends IDocInlineTagBaseParsedParameters {}
Constructor parameters for DocInlineTag.
property tagContentExcerpt
tagContentExcerpt?: TokenSequence;
interface IDocLinkTagParameters
interface IDocLinkTagParameters extends IDocInlineTagBaseParameters {}
Constructor parameters for DocLinkTag.
property codeDestination
codeDestination?: DocDeclarationReference;
property linkText
linkText?: string;
property urlDestination
urlDestination?: string;
interface IDocLinkTagParsedParameters
interface IDocLinkTagParsedParameters extends IDocInlineTagBaseParsedParameters {}
Constructor parameters for DocLinkTag.
property codeDestination
codeDestination?: DocDeclarationReference;
property linkTextExcerpt
linkTextExcerpt?: TokenSequence;
property pipeExcerpt
pipeExcerpt?: TokenSequence;
property spacingAfterDestinationExcerpt
spacingAfterDestinationExcerpt?: TokenSequence;
property spacingAfterLinkTextExcerpt
spacingAfterLinkTextExcerpt?: TokenSequence;
property spacingAfterPipeExcerpt
spacingAfterPipeExcerpt?: TokenSequence;
property urlDestinationExcerpt
urlDestinationExcerpt?: TokenSequence;
interface IDocMemberIdentifierParameters
interface IDocMemberIdentifierParameters extends IDocNodeParameters {}
Constructor parameters for DocMemberIdentifier.
property identifier
identifier: string;
interface IDocMemberIdentifierParsedParameters
interface IDocMemberIdentifierParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocMemberIdentifier.
property identifierExcerpt
identifierExcerpt: TokenSequence;
property leftQuoteExcerpt
leftQuoteExcerpt?: TokenSequence;
property rightQuoteExcerpt
rightQuoteExcerpt?: TokenSequence;
interface IDocMemberReferenceParameters
interface IDocMemberReferenceParameters extends IDocNodeParameters {}
Constructor parameters for DocMemberReference.
property hasDot
hasDot: boolean;
property memberIdentifier
memberIdentifier?: DocMemberIdentifier;
property memberSymbol
memberSymbol?: DocMemberSymbol;
property selector
selector?: DocMemberSelector;
interface IDocMemberReferenceParsedParameters
interface IDocMemberReferenceParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocMemberReference.
property colonExcerpt
colonExcerpt?: TokenSequence;
property dotExcerpt
dotExcerpt?: TokenSequence;
property leftParenthesisExcerpt
leftParenthesisExcerpt?: TokenSequence;
property memberIdentifier
memberIdentifier?: DocMemberIdentifier;
property memberSymbol
memberSymbol?: DocMemberSymbol;
property rightParenthesisExcerpt
rightParenthesisExcerpt?: TokenSequence;
property selector
selector?: DocMemberSelector;
property spacingAfterColonExcerpt
spacingAfterColonExcerpt?: TokenSequence;
property spacingAfterDotExcerpt
spacingAfterDotExcerpt?: TokenSequence;
property spacingAfterLeftParenthesisExcerpt
spacingAfterLeftParenthesisExcerpt?: TokenSequence;
property spacingAfterMemberExcerpt
spacingAfterMemberExcerpt?: TokenSequence;
property spacingAfterRightParenthesisExcerpt
spacingAfterRightParenthesisExcerpt?: TokenSequence;
property spacingAfterSelectorExcerpt
spacingAfterSelectorExcerpt?: TokenSequence;
interface IDocMemberSelectorParameters
interface IDocMemberSelectorParameters extends IDocNodeParameters {}
Constructor parameters for DocMemberSelector.
property selector
selector: string;
interface IDocMemberSelectorParsedParameters
interface IDocMemberSelectorParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocMemberSelector.
property selectorExcerpt
selectorExcerpt: TokenSequence;
interface IDocMemberSymbolParameters
interface IDocMemberSymbolParameters extends IDocNodeParameters {}
Constructor parameters for DocMemberSymbol.
property symbolReference
symbolReference: DocDeclarationReference;
interface IDocMemberSymbolParsedParameters
interface IDocMemberSymbolParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocMemberSymbol.
property leftBracketExcerpt
leftBracketExcerpt: TokenSequence;
property rightBracketExcerpt
rightBracketExcerpt: TokenSequence;
property spacingAfterLeftBracketExcerpt
spacingAfterLeftBracketExcerpt?: TokenSequence;
property symbolReference
symbolReference: DocDeclarationReference;
interface IDocNodeContainerParameters
interface IDocNodeContainerParameters extends IDocNodeParameters {}
Constructor parameters for DocNodeContainer.
interface IDocNodeContainerParsedParameters
interface IDocNodeContainerParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocNodeContainer.
interface IDocNodeDefinition
interface IDocNodeDefinition {}
property constructor
constructor: DocNodeConstructor;
property docNodeKind
docNodeKind: string;
interface IDocNodeParameters
interface IDocNodeParameters {}
Constructor parameters for DocNode.
Remarks
There are two scenarios for constructing
DocNode
objects. The "builder scenario" constructs the object based on literal strings, does NOT create DocExcerpt child nodes, and generally uses theIDocNodeParameters
hierarchy for its constructor parameters. The "parser scenario" constructs the object by parsing a TypeScript source file, does create DocExcerpt child nodes, and generally uses the IDocNodeParsedParameters hierarchy.
property configuration
configuration: TSDocConfiguration;
interface IDocNodeParsedParameters
interface IDocNodeParsedParameters {}
Constructor parameters for DocNode.
Remarks
There are two scenarios for constructing
DocNode
objects. The "builder scenario" constructs the object based on literal strings, does NOT create DocExcerpt child nodes, and generally uses the IDocNodeParameters hierarchy for its constructor parameters. The "parser scenario" constructs the object by parsing a TypeScript source file, does create DocExcerpt child nodes, and generally uses theIDocNodeParsedParameters
hierarchy.
property configuration
configuration: TSDocConfiguration;
property parsed
parsed: true;
This is a marker used by DocNode.isParsedParameters to determine whether the constructor was invoked using
IDocNodeParameters
(builder scenario) orIDocNodeParsedParameters
(parser scenario).
interface IDocParagraphParameters
interface IDocParagraphParameters extends IDocNodeContainerParameters {}
Constructor parameters for DocParagraph.
interface IDocParamBlockParameters
interface IDocParamBlockParameters extends IDocBlockParameters {}
Constructor parameters for DocParamBlock.
property parameterName
parameterName: string;
interface IDocParamBlockParsedParameters
interface IDocParamBlockParsedParameters extends IDocBlockParsedParameters {}
Constructor parameters for DocParamBlock.
property hyphenExcerpt
hyphenExcerpt?: TokenSequence;
property parameterName
parameterName: string;
property parameterNameExcerpt
parameterNameExcerpt: TokenSequence;
property spacingAfterHyphenExcerpt
spacingAfterHyphenExcerpt?: TokenSequence;
property spacingAfterParameterNameExcerpt
spacingAfterParameterNameExcerpt?: TokenSequence;
property spacingBeforeParameterNameExcerpt
spacingBeforeParameterNameExcerpt?: TokenSequence;
property unsupportedJsdocOptionalNameOpenBracketExcerpt
unsupportedJsdocOptionalNameOpenBracketExcerpt?: TokenSequence;
property unsupportedJsdocOptionalNameRestExcerpt
unsupportedJsdocOptionalNameRestExcerpt?: TokenSequence;
property unsupportedJsdocTypeAfterHyphenExcerpt
unsupportedJsdocTypeAfterHyphenExcerpt?: TokenSequence;
property unsupportedJsdocTypeAfterParameterNameExcerpt
unsupportedJsdocTypeAfterParameterNameExcerpt?: TokenSequence;
property unsupportedJsdocTypeBeforeParameterNameExcerpt
unsupportedJsdocTypeBeforeParameterNameExcerpt?: TokenSequence;
interface IDocParamCollectionParameters
interface IDocParamCollectionParameters extends IDocNodeParameters {}
Constructor parameters for DocParamCollection.
interface IDocPlainTextParameters
interface IDocPlainTextParameters extends IDocNodeParameters {}
Constructor parameters for DocPlainText.
property text
text: string;
interface IDocPlainTextParsedParameters
interface IDocPlainTextParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocPlainText.
property textExcerpt
textExcerpt: TokenSequence;
interface IDocSectionParameters
interface IDocSectionParameters extends IDocNodeContainerParameters {}
Constructor parameters for DocSection.
interface IDocSectionParsedParameters
interface IDocSectionParsedParameters extends IDocNodeContainerParsedParameters {}
Constructor parameters for DocSection.
interface IDocSoftBreakParameters
interface IDocSoftBreakParameters extends IDocNodeParameters {}
Constructor parameters for DocSoftBreak.
interface IDocSoftBreakParsedParameters
interface IDocSoftBreakParsedParameters extends IDocNodeParsedParameters {}
Constructor parameters for DocSoftBreak.
property softBreakExcerpt
softBreakExcerpt: TokenSequence;
interface IParserMessageParameters
interface IParserMessageParameters {}
Constructor parameters for ParserMessage.
property docNode
docNode?: DocNode;
property messageId
messageId: TSDocMessageId;
property messageText
messageText: string;
property textRange
textRange: TextRange;
property tokenSequence
tokenSequence?: TokenSequence;
interface IStringBuilder
interface IStringBuilder {}
An interface for a builder object that allows a large text string to be constructed incrementally by appending small chunks.
Remarks
StringBuilder is the default implementation of this contract.
interface ITextLocation
interface ITextLocation {}
Text coordinates represented as a line number and column number.
Remarks
The first character in a file is considered to be in column 1 of line 1. The location with column 0 and line 0 is used to represent an empty, unspecified, or unknown location.
interface ITokenSequenceParameters
interface ITokenSequenceParameters {}
Constructor parameters for TokenSequence
property endIndex
endIndex: number;
property parserContext
parserContext: ParserContext;
property startIndex
startIndex: number;
interface ITSDocTagDefinitionParameters
interface ITSDocTagDefinitionParameters {}
Constructor parameters for TSDocTagDefinition
property allowMultiple
allowMultiple?: boolean;
property syntaxKind
syntaxKind: TSDocTagSyntaxKind;
property tagName
tagName: string;
Enums
enum DocNodeKind
enum DocNodeKind { Block = 'Block', BlockTag = 'BlockTag', Excerpt = 'Excerpt', FencedCode = 'FencedCode', CodeSpan = 'CodeSpan', Comment = 'Comment', DeclarationReference = 'DeclarationReference', ErrorText = 'ErrorText', EscapedText = 'EscapedText', HtmlAttribute = 'HtmlAttribute', HtmlEndTag = 'HtmlEndTag', HtmlStartTag = 'HtmlStartTag', InheritDocTag = 'InheritDocTag', InlineTag = 'InlineTag', LinkTag = 'LinkTag', MemberIdentifier = 'MemberIdentifier', MemberReference = 'MemberReference', MemberSelector = 'MemberSelector', MemberSymbol = 'MemberSymbol', Paragraph = 'Paragraph', ParamBlock = 'ParamBlock', ParamCollection = 'ParamCollection', PlainText = 'PlainText', Section = 'Section', SoftBreak = 'SoftBreak',}
Indicates the type of DocNode.
Remarks
When creating custom subclasses of
DocNode
, it's recommended to create your own enum to identify them. To avoid naming conflicts between projects, the enum value should be a string comprised of your full NPM package name, followed by a "#" symbol, followed by the class name (without the "Doc" prefix).
member Block
Block = 'Block'
member BlockTag
BlockTag = 'BlockTag'
member CodeSpan
CodeSpan = 'CodeSpan'
member Comment
Comment = 'Comment'
member DeclarationReference
DeclarationReference = 'DeclarationReference'
member ErrorText
ErrorText = 'ErrorText'
member EscapedText
EscapedText = 'EscapedText'
member Excerpt
Excerpt = 'Excerpt'
member FencedCode
FencedCode = 'FencedCode'
member HtmlAttribute
HtmlAttribute = 'HtmlAttribute'
member HtmlEndTag
HtmlEndTag = 'HtmlEndTag'
member HtmlStartTag
HtmlStartTag = 'HtmlStartTag'
member InheritDocTag
InheritDocTag = 'InheritDocTag'
member InlineTag
InlineTag = 'InlineTag'
member LinkTag
LinkTag = 'LinkTag'
member MemberIdentifier
MemberIdentifier = 'MemberIdentifier'
member MemberReference
MemberReference = 'MemberReference'
member MemberSelector
MemberSelector = 'MemberSelector'
member MemberSymbol
MemberSymbol = 'MemberSymbol'
member Paragraph
Paragraph = 'Paragraph'
member ParamBlock
ParamBlock = 'ParamBlock'
member ParamCollection
ParamCollection = 'ParamCollection'
member PlainText
PlainText = 'PlainText'
member Section
Section = 'Section'
member SoftBreak
SoftBreak = 'SoftBreak'
enum EscapeStyle
enum EscapeStyle { CommonMarkBackslash = 0,}
The style of escaping to be used with DocEscapedText.
member CommonMarkBackslash
CommonMarkBackslash = 0
Use a backslash symbol to escape the character.
enum ExcerptKind
enum ExcerptKind { Spacing = 'Spacing', BlockTag = 'BlockTag', CodeSpan_OpeningDelimiter = 'CodeSpan_OpeningDelimiter', CodeSpan_Code = 'CodeSpan_Code', CodeSpan_ClosingDelimiter = 'CodeSpan_ClosingDelimiter', DeclarationReference_PackageName = 'DeclarationReference_PackageName', DeclarationReference_ImportPath = 'DeclarationReference_ImportPath', DeclarationReference_ImportHash = 'DeclarationReference_ImportHash', ErrorText = 'ErrorText', NonstandardText = 'NonstandardText', EscapedText = 'EscapedText', FencedCode_OpeningFence = 'FencedCode_OpeningFence', FencedCode_Language = 'FencedCode_Language', FencedCode_Code = 'FencedCode_Code', FencedCode_ClosingFence = 'FencedCode_ClosingFence', HtmlAttribute_Name = 'HtmlAttribute_Name', HtmlAttribute_Equals = 'HtmlAttribute_Equals', HtmlAttribute_Value = 'HtmlAttribute_Value', HtmlEndTag_OpeningDelimiter = 'HtmlEndTag_OpeningDelimiter', HtmlEndTag_Name = 'HtmlEndTag_Name', HtmlEndTag_ClosingDelimiter = 'HtmlEndTag_ClosingDelimiter', HtmlStartTag_OpeningDelimiter = 'HtmlStartTag_OpeningDelimiter', HtmlStartTag_Name = 'HtmlStartTag_Name', HtmlStartTag_ClosingDelimiter = 'HtmlStartTag_ClosingDelimiter', InlineTag_OpeningDelimiter = 'InlineTag_OpeningDelimiter', InlineTag_TagName = 'InlineTag_TagName', InlineTag_TagContent = 'InlineTag_TagContent', InlineTag_ClosingDelimiter = 'InlineTag_ClosingDelimiter', LinkTag_UrlDestination = 'LinkTag_UrlDestination', LinkTag_Pipe = 'LinkTag_Pipe', LinkTag_LinkText = 'LinkTag_LinkText', MemberIdentifier_LeftQuote = 'MemberIdentifier_LeftQuote', MemberIdentifier_Identifier = 'MemberIdentifier_Identifier', MemberIdentifier_RightQuote = 'MemberIdentifier_RightQuote', MemberReference_Dot = 'MemberReference_Dot', MemberReference_LeftParenthesis = 'MemberReference_LeftParenthesis', MemberReference_Colon = 'MemberReference_Colon', MemberReference_RightParenthesis = 'MemberReference_RightParenthesis', MemberSelector = 'MemberSelector', DocMemberSymbol_LeftBracket = 'DocMemberSymbol_LeftBracket', DocMemberSymbol_RightBracket = 'DocMemberSymbol_RightBracket', ParamBlock_ParameterName = 'ParamBlock_ParameterName', ParamBlock_Hyphen = 'ParamBlock_Hyphen', PlainText = 'PlainText', SoftBreak = 'SoftBreak',}
Indicates the type of DocExcerpt.
member BlockTag
BlockTag = 'BlockTag'
member CodeSpan_ClosingDelimiter
CodeSpan_ClosingDelimiter = 'CodeSpan_ClosingDelimiter'
member CodeSpan_Code
CodeSpan_Code = 'CodeSpan_Code'
member CodeSpan_OpeningDelimiter
CodeSpan_OpeningDelimiter = 'CodeSpan_OpeningDelimiter'
member DeclarationReference_ImportHash
DeclarationReference_ImportHash = 'DeclarationReference_ImportHash'
member DeclarationReference_ImportPath
DeclarationReference_ImportPath = 'DeclarationReference_ImportPath'
member DeclarationReference_PackageName
DeclarationReference_PackageName = 'DeclarationReference_PackageName'
member DocMemberSymbol_LeftBracket
DocMemberSymbol_LeftBracket = 'DocMemberSymbol_LeftBracket'
member DocMemberSymbol_RightBracket
DocMemberSymbol_RightBracket = 'DocMemberSymbol_RightBracket'
member ErrorText
ErrorText = 'ErrorText'
Input characters that were reported as an error and do not appear to be part of a valid expression. A syntax highlighter might display them with an error color (e.g. red).
member EscapedText
EscapedText = 'EscapedText'
member FencedCode_ClosingFence
FencedCode_ClosingFence = 'FencedCode_ClosingFence'
member FencedCode_Code
FencedCode_Code = 'FencedCode_Code'
member FencedCode_Language
FencedCode_Language = 'FencedCode_Language'
member FencedCode_OpeningFence
FencedCode_OpeningFence = 'FencedCode_OpeningFence'
member HtmlAttribute_Equals
HtmlAttribute_Equals = 'HtmlAttribute_Equals'
member HtmlAttribute_Name
HtmlAttribute_Name = 'HtmlAttribute_Name'
member HtmlAttribute_Value
HtmlAttribute_Value = 'HtmlAttribute_Value'
member HtmlEndTag_ClosingDelimiter
HtmlEndTag_ClosingDelimiter = 'HtmlEndTag_ClosingDelimiter'
member HtmlEndTag_Name
HtmlEndTag_Name = 'HtmlEndTag_Name'
member HtmlEndTag_OpeningDelimiter
HtmlEndTag_OpeningDelimiter = 'HtmlEndTag_OpeningDelimiter'
member HtmlStartTag_ClosingDelimiter
HtmlStartTag_ClosingDelimiter = 'HtmlStartTag_ClosingDelimiter'
member HtmlStartTag_Name
HtmlStartTag_Name = 'HtmlStartTag_Name'
member HtmlStartTag_OpeningDelimiter
HtmlStartTag_OpeningDelimiter = 'HtmlStartTag_OpeningDelimiter'
member InlineTag_ClosingDelimiter
InlineTag_ClosingDelimiter = 'InlineTag_ClosingDelimiter'
member InlineTag_OpeningDelimiter
InlineTag_OpeningDelimiter = 'InlineTag_OpeningDelimiter'
member InlineTag_TagContent
InlineTag_TagContent = 'InlineTag_TagContent'
member InlineTag_TagName
InlineTag_TagName = 'InlineTag_TagName'
member LinkTag_LinkText
LinkTag_LinkText = 'LinkTag_LinkText'
member LinkTag_Pipe
LinkTag_Pipe = 'LinkTag_Pipe'
member LinkTag_UrlDestination
LinkTag_UrlDestination = 'LinkTag_UrlDestination'
member MemberIdentifier_Identifier
MemberIdentifier_Identifier = 'MemberIdentifier_Identifier'
member MemberIdentifier_LeftQuote
MemberIdentifier_LeftQuote = 'MemberIdentifier_LeftQuote'
member MemberIdentifier_RightQuote
MemberIdentifier_RightQuote = 'MemberIdentifier_RightQuote'
member MemberReference_Colon
MemberReference_Colon = 'MemberReference_Colon'
member MemberReference_Dot
MemberReference_Dot = 'MemberReference_Dot'
member MemberReference_LeftParenthesis
MemberReference_LeftParenthesis = 'MemberReference_LeftParenthesis'
member MemberReference_RightParenthesis
MemberReference_RightParenthesis = 'MemberReference_RightParenthesis'
member MemberSelector
MemberSelector = 'MemberSelector'
member NonstandardText
NonstandardText = 'NonstandardText'
Input characters that do not conform to the TSDoc specification, but were recognized by the parser, for example as a known JSDoc pattern. A syntax highlighter should not display them with an error color (e.g. red) because the error reporting may be suppressed for "lax" parsing of legacy source code.
member ParamBlock_Hyphen
ParamBlock_Hyphen = 'ParamBlock_Hyphen'
member ParamBlock_ParameterName
ParamBlock_ParameterName = 'ParamBlock_ParameterName'
member PlainText
PlainText = 'PlainText'
member SoftBreak
SoftBreak = 'SoftBreak'
member Spacing
Spacing = 'Spacing'
enum SelectorKind
enum SelectorKind { Error = 'error', System = 'system', Index = 'index', Label = 'label',}
Kinds of TSDoc selectors.
member Error
Error = 'error'
Used in cases where the parser encounters a string that is incorrect but valid enough that a DocMemberSelector node was created.
member Index
Index = 'index'
Index selectors are integer numbers. They provide an alternative way of referencing overloaded functions, based on the order in which the declarations appear in a source file.
Remarks
Warning: Index selectors are not recommended; they are intended to provide a temporary workaround for situations where an external library neglected to declare a
{@label}
tag and cannot be easily fixed.
member Label
Label = 'label'
Label selectors refer to labels created using the
{@label}
TSDoc tag. The labels are always comprised of upper-case letters or numbers separated by underscores, and the first character cannot be a number.
member System
System = 'system'
System selectors are always all lower-case and belong to a set of predefined label names.
enum Standardization
enum Standardization { Core = 'Core', Extended = 'Extended', Discretionary = 'Discretionary', None = 'None',}
Used to group the StandardTags definitions according to the level of support expected from documentation tools that implement the standard.
member Core
Core = 'Core'
TSDoc tags in the "Core" standardization group are considered essential. Their meaning is standardized, and every documentation tool is expected to recognize them. The TSDoc parser library typically provides dedicated APIs for accessing these tags.
member Discretionary
Discretionary = 'Discretionary'
TSDoc tags in the "Discretionary" standardization group are optional. Although the syntax is specified, the semantics for these tags are implementation-specific (and sometimes difficult to describe completely without referring to a specific implementation). Discretionary tags are included in the TSDoc standard to ensure that if two different popular tools use the same tag name, developers can expect the syntax to be the same, and the semantics to be somewhat similar.
member Extended
Extended = 'Extended'
TSDoc tags in the "Extended" standardization group are optional. Documentation tools may or may not support them. If they do, the syntax and semantics should conform to the TSDoc standard definitions.
member None
None = 'None'
The tag is not part of the TSDoc standard. All used-defined tags are assigned to this group.
enum TokenKind
enum TokenKind { EndOfInput = 2001, Newline = 2002, Spacing = 2003, AsciiWord = 2004, OtherPunctuation = 2005, Other = 2006, Backslash = 2007, LessThan = 2008, GreaterThan = 2009, Equals = 2010, SingleQuote = 2011, DoubleQuote = 2012, Slash = 2013, Hyphen = 2014, AtSign = 2015, LeftCurlyBracket = 2016, RightCurlyBracket = 2017, Backtick = 2018, Period = 2019, Colon = 2020, Comma = 2021, LeftSquareBracket = 2022, RightSquareBracket = 2023, Pipe = 2024, LeftParenthesis = 2025, RightParenthesis = 2026, PoundSymbol = 2027, Plus = 2028, DollarSign = 2029,}
Distinguishes different types of Token objects.
member AsciiWord
AsciiWord = 2004
A token representing one or more ASCII letters, numbers, and underscores.
member AtSign
AtSign = 2015
The at-sign character
@
. The Token.range will always be a string of length 1.
member Backslash
Backslash = 2007
The backslash character
\
. The Token.range will always be a string of length 1.
member Backtick
Backtick = 2018
The backtick character. The Token.range will always be a string of length 1.
member Colon
Colon = 2020
The colon character. The Token.range will always be a string of length 1.
member Comma
Comma = 2021
The comma character. The Token.range will always be a string of length 1.
member DollarSign
DollarSign = 2029
The dollar sign character ("$"). The Token.range will always be a string of length 1.
member DoubleQuote
DoubleQuote = 2012
The double-quote character
"
. The Token.range will always be a string of length 1.
member EndOfInput
EndOfInput = 2001
A token representing the end of the input. The Token.range will be an empty range at the end of the provided input.
member Equals
Equals = 2010
The equals character
=
. The Token.range will always be a string of length 1.
member GreaterThan
GreaterThan = 2009
The greater-than character
>
. The Token.range will always be a string of length 1.
member Hyphen
Hyphen = 2014
The hyphen character
-
. The Token.range will always be a string of length 1.
member LeftCurlyBracket
LeftCurlyBracket = 2016
The left curly bracket character
{
. The Token.range will always be a string of length 1.
member LeftParenthesis
LeftParenthesis = 2025
The left parenthesis character. The Token.range will always be a string of length 1.
member LeftSquareBracket
LeftSquareBracket = 2022
The left square bracket character. The Token.range will always be a string of length 1.
member LessThan
LessThan = 2008
The less-than character
<
. The Token.range will always be a string of length 1.
member Newline
Newline = 2002
A token representing a virtual newline. The Token.range will be an empty range, because the actual newline character may be noncontiguous due to the doc comment delimiter trimming.
member Other
Other = 2006
A token representing a sequence of non-ASCII printable characters that are not punctuation.
member OtherPunctuation
OtherPunctuation = 2005
A single ASCII character that behaves like punctuation, e.g. doesn't need whitespace around it when adjacent to a letter. The Token.range will always be a string of length 1.
member Period
Period = 2019
The period character. The Token.range will always be a string of length 1.
member Pipe
Pipe = 2024
The pipe character
|
. The Token.range will always be a string of length 1.
member Plus
Plus = 2028
The plus character ("+"). The Token.range will always be a string of length 1.
member PoundSymbol
PoundSymbol = 2027
The pound character ("#"). The Token.range will always be a string of length 1.
member RightCurlyBracket
RightCurlyBracket = 2017
The right curly bracket character
}
. The Token.range will always be a string of length 1.
member RightParenthesis
RightParenthesis = 2026
The right parenthesis character. The Token.range will always be a string of length 1.
member RightSquareBracket
RightSquareBracket = 2023
The right square bracket character. The Token.range will always be a string of length 1.
member SingleQuote
SingleQuote = 2011
The single-quote character
'
. The Token.range will always be a string of length 1.
member Slash
Slash = 2013
The slash character
/
. The Token.range will always be a string of length 1.
member Spacing
Spacing = 2003
A token representing one or more spaces and tabs (but not newlines or end of input).
enum TSDocMessageId
enum TSDocMessageId { ConfigFileNotFound = 'tsdoc-config-file-not-found', ConfigInvalidJson = 'tsdoc-config-invalid-json', ConfigFileUnsupportedSchema = 'tsdoc-config-unsupported-schema', ConfigFileSchemaError = 'tsdoc-config-schema-error', ConfigFileCyclicExtends = 'tsdoc-config-cyclic-extends', ConfigFileUnresolvedExtends = 'tsdoc-config-unresolved-extends', ConfigFileUndefinedTag = 'tsdoc-config-undefined-tag', ConfigFileDuplicateTagName = 'tsdoc-config-duplicate-tag-name', ConfigFileInvalidTagName = 'tsdoc-config-invalid-tag-name', CommentNotFound = 'tsdoc-comment-not-found', CommentOpeningDelimiterSyntax = 'tsdoc-comment-missing-opening-delimiter', CommentMissingClosingDelimiter = 'tsdoc-comment-missing-closing-delimiter', ExtraInheritDocTag = 'tsdoc-extra-inheritdoc-tag', EscapeRightBrace = 'tsdoc-escape-right-brace', EscapeGreaterThan = 'tsdoc-escape-greater-than', MissingDeprecationMessage = 'tsdoc-missing-deprecation-message', InheritDocIncompatibleTag = 'tsdoc-inheritdoc-incompatible-tag', InheritDocIncompatibleSummary = 'tsdoc-inheritdoc-incompatible-summary', InlineTagMissingBraces = 'tsdoc-inline-tag-missing-braces', TagShouldNotHaveBraces = 'tsdoc-tag-should-not-have-braces', UnsupportedTag = 'tsdoc-unsupported-tag', UndefinedTag = 'tsdoc-undefined-tag', ParamTagWithInvalidType = 'tsdoc-param-tag-with-invalid-type', ParamTagWithInvalidOptionalName = 'tsdoc-param-tag-with-invalid-optional-name', ParamTagWithInvalidName = 'tsdoc-param-tag-with-invalid-name', ParamTagMissingHyphen = 'tsdoc-param-tag-missing-hyphen', UnnecessaryBackslash = 'tsdoc-unnecessary-backslash', MissingTag = 'tsdoc-missing-tag', AtSignInWord = 'tsdoc-at-sign-in-word', AtSignWithoutTagName = 'tsdoc-at-sign-without-tag-name', MalformedInlineTag = 'tsdoc-malformed-inline-tag', CharactersAfterBlockTag = 'tsdoc-characters-after-block-tag', MalformedTagName = 'tsdoc-malformed-tag-name', CharactersAfterInlineTag = 'tsdoc-characters-after-inline-tag', InlineTagMissingRightBrace = 'tsdoc-inline-tag-missing-right-brace', InlineTagUnescapedBrace = 'tsdoc-inline-tag-unescaped-brace', InheritDocTagSyntax = 'tsdoc-inheritdoc-tag-syntax', LinkTagEmpty = 'tsdoc-link-tag-empty', LinkTagUnescapedText = 'tsdoc-link-tag-unescaped-text', LinkTagDestinationSyntax = 'tsdoc-link-tag-destination-syntax', LinkTagInvalidUrl = 'tsdoc-link-tag-invalid-url', ReferenceMissingHash = 'tsdoc-reference-missing-hash', ReferenceHashSyntax = 'tsdoc-reference-hash-syntax', ReferenceMalformedPackageName = 'tsdoc-reference-malformed-package-name', ReferenceMalformedImportPath = 'tsdoc-reference-malformed-import-path', MissingReference = 'tsdoc-missing-reference', ReferenceMissingDot = 'tsdoc-reference-missing-dot', ReferenceSelectorMissingParens = 'tsdoc-reference-selector-missing-parens', ReferenceMissingColon = 'tsdoc-reference-missing-colon', ReferenceMissingRightParen = 'tsdoc-reference-missing-right-paren', ReferenceSymbolSyntax = 'tsdoc-reference-symbol-syntax', ReferenceMissingRightBracket = 'tsdoc-reference-missing-right-bracket', ReferenceMissingQuote = 'tsdoc-reference-missing-quote', ReferenceEmptyIdentifier = 'tsdoc-reference-empty-identifier', ReferenceMissingIdentifier = 'tsdoc-reference-missing-identifier', ReferenceUnquotedIdentifier = 'tsdoc-reference-unquoted-identifier', ReferenceMissingLabel = 'tsdoc-reference-missing-label', ReferenceSelectorSyntax = 'tsdoc-reference-selector-syntax', HtmlTagMissingGreaterThan = 'tsdoc-html-tag-missing-greater-than', HtmlTagMissingEquals = 'tsdoc-html-tag-missing-equals', HtmlTagMissingString = 'tsdoc-html-tag-missing-string', HtmlStringMissingQuote = 'tsdoc-html-string-missing-quote', TextAfterHtmlString = 'tsdoc-text-after-html-string', MissingHtmlEndTag = 'tsdoc-missing-html-end-tag', MalformedHtmlName = 'tsdoc-malformed-html-name', UnsupportedHtmlElementName = 'tsdoc-unsupported-html-name', CodeFenceOpeningIndent = 'tsdoc-code-fence-opening-indent', CodeFenceSpecifierSyntax = 'tsdoc-code-fence-specifier-syntax', CodeFenceClosingIndent = 'tsdoc-code-fence-closing-indent', CodeFenceMissingDelimiter = 'tsdoc-code-fence-missing-delimiter', CodeFenceClosingSyntax = 'tsdoc-code-fence-closing-syntax', CodeSpanEmpty = 'tsdoc-code-span-empty', CodeSpanMissingDelimiter = 'tsdoc-code-span-missing-delimiter',}
Unique identifiers for messages reported by the TSDoc parser.
Remarks
These strings are possible values for the ParserMessage.messageId property. These identifiers can be used to suppress or configure the reporting of individual messages. They are also useful when searching for help about a particular error.
Modifiers
@public
member AtSignInWord
AtSignInWord = 'tsdoc-at-sign-in-word'
The
@
character looks like part of a TSDoc tag; use a backslash to escape it.
member AtSignWithoutTagName
AtSignWithoutTagName = 'tsdoc-at-sign-without-tag-name'
Expecting a TSDoc tag name after
@
; if it is not a tag, use a backslash to escape this character.
member CharactersAfterBlockTag
CharactersAfterBlockTag = 'tsdoc-characters-after-block-tag'
The token ___ looks like a TSDoc tag but contains an invalid character ___; if it is not a tag, use a backslash to escape the
@
.
member CharactersAfterInlineTag
CharactersAfterInlineTag = 'tsdoc-characters-after-inline-tag'
The character ___ cannot appear after the TSDoc tag name; expecting a space.
member CodeFenceClosingIndent
CodeFenceClosingIndent = 'tsdoc-code-fence-closing-indent'
The closing delimiter for a code fence must not be indented.
member CodeFenceClosingSyntax
CodeFenceClosingSyntax = 'tsdoc-code-fence-closing-syntax'
Unexpected characters after closing delimiter for code fence.
member CodeFenceMissingDelimiter
CodeFenceMissingDelimiter = 'tsdoc-code-fence-missing-delimiter'
Missing closing delimiter.
member CodeFenceOpeningIndent
CodeFenceOpeningIndent = 'tsdoc-code-fence-opening-indent'
The opening backtick for a code fence must appear at the start of the line.
member CodeFenceSpecifierSyntax
CodeFenceSpecifierSyntax = 'tsdoc-code-fence-specifier-syntax'
The language specifier cannot contain backtick characters.
member CodeSpanEmpty
CodeSpanEmpty = 'tsdoc-code-span-empty'
A code span must contain at least one character between the backticks.
member CodeSpanMissingDelimiter
CodeSpanMissingDelimiter = 'tsdoc-code-span-missing-delimiter'
The code span is missing its closing backtick.
member CommentMissingClosingDelimiter
CommentMissingClosingDelimiter = 'tsdoc-comment-missing-closing-delimiter'
Unexpected end of input.
member CommentNotFound
CommentNotFound = 'tsdoc-comment-not-found'
Expecting a
/**
comment. Unexpected end of input.
member CommentOpeningDelimiterSyntax
CommentOpeningDelimiterSyntax = 'tsdoc-comment-missing-opening-delimiter'
Expecting a leading
/**
member ConfigFileCyclicExtends
ConfigFileCyclicExtends = 'tsdoc-config-cyclic-extends'
Circular reference encountered for "extends" field of "___"
Remarks
Reported by the
@microsoft/tsdoc-config
package when the "extends" field creates a chain of references that causes a file to indirectly extend itself.
member ConfigFileDuplicateTagName
ConfigFileDuplicateTagName = 'tsdoc-config-duplicate-tag-name'
The "tagDefinitions" field specifies more than one tag with the name "___".
Remarks
Reported by the
@microsoft/tsdoc-config
package when loading the tsdoc.json config file.
member ConfigFileInvalidTagName
ConfigFileInvalidTagName = 'tsdoc-config-invalid-tag-name'
A TSDoc tag name must start with a letter and contain only letters and numbers.
Remarks
Reported by the
@microsoft/tsdoc-config
package when loading the tsdoc.json config file.
member ConfigFileNotFound
ConfigFileNotFound = 'tsdoc-config-file-not-found'
File not found
Remarks
Reported by the
@microsoft/tsdoc-config
package when it failed to find atsdoc.json
file.
member ConfigFileSchemaError
ConfigFileSchemaError = 'tsdoc-config-schema-error'
Error loading config file: ___
Remarks
Reported by the
@microsoft/tsdoc-config
package when the config file doesn't conform to its schema.
member ConfigFileUndefinedTag
ConfigFileUndefinedTag = 'tsdoc-config-undefined-tag'
The "supportForTags" field refers to an undefined tag "___".
Remarks
Reported by the
@microsoft/tsdoc-config
package when loading the tsdoc.json config file.
member ConfigFileUnresolvedExtends
ConfigFileUnresolvedExtends = 'tsdoc-config-unresolved-extends'
Unable to resolve "extends" reference to "___"
Remarks
Reported by the
@microsoft/tsdoc-config
package when module resolution fails for the "extends" field.
member ConfigFileUnsupportedSchema
ConfigFileUnsupportedSchema = 'tsdoc-config-unsupported-schema'
Unsupported JSON "$schema" value
Remarks
Reported by the
@microsoft/tsdoc-config
package when the file format is not supported.
member ConfigInvalidJson
ConfigInvalidJson = 'tsdoc-config-invalid-json'
Error parsing JSON input: ___
Remarks
Reported by the
@microsoft/tsdoc-config
package when thetsdoc.json
file has invalid JSON syntax.
member EscapeGreaterThan
EscapeGreaterThan = 'tsdoc-escape-greater-than'
The
>
character should be escaped using a backslash to avoid confusion with an HTML tag.
member EscapeRightBrace
EscapeRightBrace = 'tsdoc-escape-right-brace'
The
}
character should be escaped using a backslash to avoid confusion with a TSDoc inline tag.
member ExtraInheritDocTag
ExtraInheritDocTag = 'tsdoc-extra-inheritdoc-tag'
A doc comment cannot have more than one
@inheritDoc
tag
member HtmlStringMissingQuote
HtmlStringMissingQuote = 'tsdoc-html-string-missing-quote'
The HTML string is missing its closing quote.
member HtmlTagMissingEquals
HtmlTagMissingEquals = 'tsdoc-html-tag-missing-equals'
Expecting
=
after HTML attribute name.
member HtmlTagMissingGreaterThan
HtmlTagMissingGreaterThan = 'tsdoc-html-tag-missing-greater-than'
Expecting an attribute or
>
or/>
.
member HtmlTagMissingString
HtmlTagMissingString = 'tsdoc-html-tag-missing-string'
Expecting an HTML string starting with a single-quote or double-quote character.
member InheritDocIncompatibleSummary
InheritDocIncompatibleSummary = 'tsdoc-inheritdoc-incompatible-summary'
The summary section must not have any content, because that content is provided by the
@inheritDoc
tag.
member InheritDocIncompatibleTag
InheritDocIncompatibleTag = 'tsdoc-inheritdoc-incompatible-tag'
A ___ block must not be used, because that content is provided by the
@inheritDoc
tag.
member InheritDocTagSyntax
InheritDocTagSyntax = 'tsdoc-inheritdoc-tag-syntax'
Unexpected character after declaration reference.
member InlineTagMissingBraces
InlineTagMissingBraces = 'tsdoc-inline-tag-missing-braces'
The TSDoc tag ___ is an inline tag; it must be enclosed in
{ }
braces.
member InlineTagMissingRightBrace
InlineTagMissingRightBrace = 'tsdoc-inline-tag-missing-right-brace'
The TSDoc inline tag name is missing its closing
}
.
member InlineTagUnescapedBrace
InlineTagUnescapedBrace = 'tsdoc-inline-tag-unescaped-brace'
The
{
character must be escaped with a backslash when used inside a TSDoc inline tag.
member LinkTagDestinationSyntax
LinkTagDestinationSyntax = 'tsdoc-link-tag-destination-syntax'
Unexpected character after link destination.
member LinkTagEmpty
LinkTagEmpty = 'tsdoc-link-tag-empty'
The
@link
tag content is missing.
member LinkTagInvalidUrl
LinkTagInvalidUrl = 'tsdoc-link-tag-invalid-url'
The URL cannot be empty. OR An
@link
URL must begin with a scheme comprised only of letters and numbers followed by://
. OR An@link
URL must have at least one character after://
.
member LinkTagUnescapedText
LinkTagUnescapedText = 'tsdoc-link-tag-unescaped-text'
The ___ character may not be used in the link text without escaping it.
member MalformedHtmlName
MalformedHtmlName = 'tsdoc-malformed-html-name'
A space is not allowed here. OR Expecting an HTML name. OR An HTML name must be a sequence of letters separated by hyphens.
member MalformedInlineTag
MalformedInlineTag = 'tsdoc-malformed-inline-tag'
Expecting a TSDoc tag starting with
{@
. OR Expecting a TSDoc inline tag name after the{@
characters.
member MalformedTagName
MalformedTagName = 'tsdoc-malformed-tag-name'
A TSDoc tag name must start with a letter and contain only letters and numbers.
member MissingDeprecationMessage
MissingDeprecationMessage = 'tsdoc-missing-deprecation-message'
The ___ block must include a deprecation message, e.g. describing the recommended alternative.
member MissingHtmlEndTag
MissingHtmlEndTag = 'tsdoc-missing-html-end-tag'
Expecting an HTML tag starting with
</
.
member MissingReference
MissingReference = 'tsdoc-missing-reference'
Expecting a declaration reference.
member MissingTag
MissingTag = 'tsdoc-missing-tag'
Expecting a TSDoc tag starting with
@
. OR Expecting a TSDoc tag starting with{
.
member ParamTagMissingHyphen
ParamTagMissingHyphen = 'tsdoc-param-tag-missing-hyphen'
The
@param
block should be followed by a parameter name and then a hyphen.
member ParamTagWithInvalidName
ParamTagWithInvalidName = 'tsdoc-param-tag-with-invalid-name'
The
@param
block should be followed by a parameter name.
member ParamTagWithInvalidOptionalName
ParamTagWithInvalidOptionalName = 'tsdoc-param-tag-with-invalid-optional-name'
The
@param
block should not include a JSDoc-style optional name; it must not be enclosed in[ ]
brackets.
member ParamTagWithInvalidType
ParamTagWithInvalidType = 'tsdoc-param-tag-with-invalid-type'
The
@param
block should not include a JSDoc-style{type}
.
member ReferenceEmptyIdentifier
ReferenceEmptyIdentifier = 'tsdoc-reference-empty-identifier'
The quoted identifier cannot be empty.
member ReferenceHashSyntax
ReferenceHashSyntax = 'tsdoc-reference-hash-syntax'
The hash character must be preceded by a package name or import path.
member ReferenceMalformedImportPath
ReferenceMalformedImportPath = 'tsdoc-reference-malformed-import-path'
An import path must not contain
//
. OR An import path must not end with/
. OR An import path must not start with/
unless prefixed by a package name.
member ReferenceMalformedPackageName
ReferenceMalformedPackageName = 'tsdoc-reference-malformed-package-name'
The package name cannot be an empty string. OR The package name ___ is not a valid package name.
member ReferenceMissingColon
ReferenceMissingColon = 'tsdoc-reference-missing-colon'
Expecting a colon after the identifier because the expression is in parentheses.
member ReferenceMissingDot
ReferenceMissingDot = 'tsdoc-reference-missing-dot'
Expecting a period before the next component of a declaration reference
member ReferenceMissingHash
ReferenceMissingHash = 'tsdoc-reference-missing-hash'
The declaration reference appears to contain a package name or import path, but it is missing the
#
delimiter.
member ReferenceMissingIdentifier
ReferenceMissingIdentifier = 'tsdoc-reference-missing-identifier'
Syntax error in declaration reference: expecting a member identifier.
member ReferenceMissingLabel
ReferenceMissingLabel = 'tsdoc-reference-missing-label'
Expecting a selector label after the colon.
member ReferenceMissingQuote
ReferenceMissingQuote = 'tsdoc-reference-missing-quote'
Unexpected end of input inside quoted member identifier.
member ReferenceMissingRightBracket
ReferenceMissingRightBracket = 'tsdoc-reference-missing-right-bracket'
Missing closing square bracket for symbol reference
member ReferenceMissingRightParen
ReferenceMissingRightParen = 'tsdoc-reference-missing-right-paren'
Expecting a matching right parenthesis.
member ReferenceSelectorMissingParens
ReferenceSelectorMissingParens = 'tsdoc-reference-selector-missing-parens'
Syntax error in declaration reference: the member selector must be enclosed in parentheses.
member ReferenceSelectorSyntax
ReferenceSelectorSyntax = 'tsdoc-reference-selector-syntax'
The selector cannot be an empty string. OR If the selector begins with a number, it must be a positive integer value. OR A label selector must be comprised of upper case letters, numbers, and underscores and must not start with a number. OR The selector ___ is not a recognized TSDoc system selector name.
member ReferenceSymbolSyntax
ReferenceSymbolSyntax = 'tsdoc-reference-symbol-syntax'
Missing declaration reference in symbol reference
member ReferenceUnquotedIdentifier
ReferenceUnquotedIdentifier = 'tsdoc-reference-unquoted-identifier'
The identifier cannot be an empty string. OR The identifier cannot non-word characters. OR The identifier must not start with a number. OR The identifier ___ must be quoted because it is a TSDoc system selector name.
member TagShouldNotHaveBraces
TagShouldNotHaveBraces = 'tsdoc-tag-should-not-have-braces'
The TSDoc tag ___ is not an inline tag; it must not be enclosed in
{ }
braces.
member TextAfterHtmlString
TextAfterHtmlString = 'tsdoc-text-after-html-string'
The next character after a closing quote must be spacing or punctuation.
member UndefinedTag
UndefinedTag = 'tsdoc-undefined-tag'
The TSDoc tag ___ is not defined in this configuration.
member UnnecessaryBackslash
UnnecessaryBackslash = 'tsdoc-unnecessary-backslash'
A backslash must precede another character that is being escaped. OR A backslash can only be used to escape a punctuation character.
member UnsupportedHtmlElementName
UnsupportedHtmlElementName = 'tsdoc-unsupported-html-name'
This HTML element name is not defined by your TSDoc configuration.
member UnsupportedTag
UnsupportedTag = 'tsdoc-unsupported-tag'
The TSDoc tag ___ is not supported by this tool.
enum TSDocTagSyntaxKind
enum TSDocTagSyntaxKind { InlineTag = 0, BlockTag = 1, ModifierTag = 2,}
Determines the type of syntax for a TSDocTagDefinition
member BlockTag
BlockTag = 1
The tag is intended to be a block tag that starts a new documentation section. For example:
@remarks
member InlineTag
InlineTag = 0
The tag is intended to be an inline tag. For example:
{@link}
.
member ModifierTag
ModifierTag = 2
The tag is intended to be a modifier tag whose presence indicates an aspect of the associated API item. For example:
@internal
Type Aliases
type DocNodeConstructor
type DocNodeConstructor = new (...args: any[]) => DocNode;
Package Files (49)
- lib/configuration/DocNodeManager.d.ts
- lib/configuration/TSDocConfiguration.d.ts
- lib/configuration/TSDocTagDefinition.d.ts
- lib/configuration/TSDocValidationConfiguration.d.ts
- lib/details/ModifierTagSet.d.ts
- lib/details/StandardModifierTagSet.d.ts
- lib/details/StandardTags.d.ts
- lib/details/Standardization.d.ts
- lib/emitters/PlainTextEmitter.d.ts
- lib/emitters/StringBuilder.d.ts
- lib/emitters/TSDocEmitter.d.ts
- lib/index.d.ts
- lib/nodes/DocBlock.d.ts
- lib/nodes/DocBlockTag.d.ts
- lib/nodes/DocCodeSpan.d.ts
- lib/nodes/DocComment.d.ts
- lib/nodes/DocDeclarationReference.d.ts
- lib/nodes/DocErrorText.d.ts
- lib/nodes/DocEscapedText.d.ts
- lib/nodes/DocExcerpt.d.ts
- lib/nodes/DocFencedCode.d.ts
- lib/nodes/DocHtmlAttribute.d.ts
- lib/nodes/DocHtmlEndTag.d.ts
- lib/nodes/DocHtmlStartTag.d.ts
- lib/nodes/DocInheritDocTag.d.ts
- lib/nodes/DocInlineTag.d.ts
- lib/nodes/DocInlineTagBase.d.ts
- lib/nodes/DocLinkTag.d.ts
- lib/nodes/DocMemberIdentifier.d.ts
- lib/nodes/DocMemberReference.d.ts
- lib/nodes/DocMemberSelector.d.ts
- lib/nodes/DocMemberSymbol.d.ts
- lib/nodes/DocNode.d.ts
- lib/nodes/DocNodeContainer.d.ts
- lib/nodes/DocParagraph.d.ts
- lib/nodes/DocParamBlock.d.ts
- lib/nodes/DocParamCollection.d.ts
- lib/nodes/DocPlainText.d.ts
- lib/nodes/DocSection.d.ts
- lib/nodes/DocSoftBreak.d.ts
- lib/parser/ParserContext.d.ts
- lib/parser/ParserMessage.d.ts
- lib/parser/ParserMessageLog.d.ts
- lib/parser/TSDocMessageId.d.ts
- lib/parser/TSDocParser.d.ts
- lib/parser/TextRange.d.ts
- lib/parser/Token.d.ts
- lib/parser/TokenSequence.d.ts
- lib/transforms/DocNodeTransforms.d.ts
Dependencies (0)
No dependencies.
Dev Dependencies (5)
Peer Dependencies (0)
No peer dependencies.
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/@microsoft/tsdoc
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@microsoft/tsdoc)
- HTML<a href="https://www.jsdocs.io/package/@microsoft/tsdoc"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 9825 ms. - Missing or incorrect documentation? Open an issue for this package.