A model that represents a comment.

Instances of this model are created by the CommentPlugin. You can retrieve comments through the comment property.

Hierarchy

  • Comment

Constructors

Properties

blockTags: CommentTag[] = []

All associated block level tags.

modifierTags: Set<string> = ...

All modifier tags present on the comment, e.g. @alpha, @beta.

The content of the comment which is not associated with a block tag.

Methods

  • Create a deep clone of this comment.

    Returns Comment

  • getIdentifiedTag(identifier: string, tagName: `@${string}`): undefined | CommentTag
  • Parameters

    • identifier: string
    • tagName: `@${string}`

    Returns undefined | CommentTag

  • getTag(tagName: `@${string}`): undefined | CommentTag
  • Return the first tag with the given name.

    Returns

    The found tag or undefined.

    Parameters

    • tagName: `@${string}`

      The name of the tag to look for.

    Returns undefined | CommentTag

  • Get all tags with the given tag name.

    Parameters

    • tagName: `@${string}`

    Returns CommentTag[]

  • hasModifier(tagName: `@${string}`): boolean
  • Test whether this comment contains a tag with the given name.

    Returns

    TRUE when this comment contains a tag with the given name, otherwise FALSE.

    Parameters

    • tagName: `@${string}`

      The name of the tag to look for.

    Returns boolean

  • hasVisibleComponent(): boolean
  • Has this comment a visible component?

    Returns

    TRUE when this comment has a visible component.

    Returns boolean

  • isEmpty(): boolean
  • Internal

    Returns true if this comment is completely empty.

    Returns boolean

  • removeModifier(tagName: `@${string}`): void
  • Parameters

    • tagName: `@${string}`

    Returns void

  • removeTags(tagName: `@${string}`): void
  • Removes all block tags with the given tag name from the comment.

    Parameters

    • tagName: `@${string}`

    Returns void

  • cloneDisplayParts(parts: CommentDisplayPart[]): ({ kind: "text"; text: string } | { kind: "code"; text: string } | { kind: "inline-tag"; tag: `@${string}`; target?: string | Reflection; text: string })[]
  • Helper utility to clone summary or content

    Parameters

    Returns ({ kind: "text"; text: string } | { kind: "code"; text: string } | { kind: "inline-tag"; tag: `@${string}`; target?: string | Reflection; text: string })[]

  • Debugging utility for combining parts into a simple string. Not suitable for rendering, but can be useful in tests.

    Parameters

    Returns string

Generated using TypeDoc