A class representing a TSDoc block comment.

Hierarchy

  • TsDoc

Constructors

  • Creates a new TSDoc comment.

    Parameters

    • Optional code: string

      The TSDoc block comment soruce code.

    • Optional options: TsDocOptions

      Options for the TSDoc instance.

    Returns TsDoc

    Throws

    If the provided code is not a valid TSDoc block comment.

Properties

multi: Map<string, TsDocTag[]> = ...

Multi tags are tags that can appear multiple times in a TSDoc comment, but each instance must have unique description text.

namedMulti: Map<string, Map<string, TsDocTag>> = ...

Named multi tags are tags that can appear multiple times in a TSDoc comment, but each instance must have a unique name.

paramOrder?: Set<string>

Can be used to specify the order in which param-tags are rendered in the TSDoc comment.

single: Map<string, TsDocTag> = ...

Single tags are tags that can only appear once in a TSDoc comment.

tagOrder?: string[]

The order in which tags are rendered in the TSDoc comment. Empty strings means spacing between tags when iterating and rendering.

defaultTagOrder: string[] = ...

The default order in which tags are rendered in the TSDoc comment.

Accessors

Methods

  • Parses a TSDoc block comment and adds the tags to the TsDoc instance.

    Parameters

    • code: string

      The TSDoc block comment soruce code.

    Returns TsDoc

  • Returns the order in which tags are rendered in the TSDoc comment. If no tagOrder was specified in the constructor options, TsDoc.defaultTagOrder is used.

    Returns string[]

  • Iterate tags in the order specified in the ´tagOrder´ and ´paramOrder´ properties.

    Parameters

    • Optional withSpaces: boolean

      Whether to yield empty strings encountered in ´tagOrder´. Empty strings are used to add spacing between tags.

    Returns Generator<"" | TsDocTag, any, unknown>

  • Deletes one or all TsDocTag matching the provided tag. If name is not provided, all tags matching the provided tag are deleted.

    Parameters

    • tag: string

      The tag to remove.

    • Optional name: string

      The name of the tag to remove.

    Returns TsDoc

  • Renders a TSDoc block comment string with all tags in the order specified by the tagOrder property.

    Returns string

  • Renders a TSDoc block comment string with all tags in the order specified by the tagOrder property.

    Returns string

    Remarks

    Identical to the render method.

Generated using TypeDoc