UNPKG

@ts-ast-parser/core

Version:

Reflects a simplified version of the TypeScript AST for generating documentation

51 lines 1.71 kB
import { type CommentPart } from '@ts-ast-parser/comment'; import ts from 'typescript'; /** * Reflected node that represents a documentation comment * * @see {@link https://tsdoc.org/} * @see {@link https://jsdoc.app/} */ export declare class CommentNode { private _parts; constructor(node: ts.Node); /** * Whether the comment has the specified tag * * @param name - The name of the documentation tag to check * @returns True if the block tag exist, otherwise false */ hasTag(name: string): boolean; /** * Returns the first tag with the given name. * * @param name - The name of the tag. * @returns The first tag with the given name or `undefined` if no such tag exists. */ getTag(name: string): CommentPart | undefined; /** * Returns all the matches found for the given tag. * A tag may appear more than once in a documentation comment. * For example `@param` can appear multiple times. This method * will return all the appearances of a given tag. * * @param name - The name of the tag to search * @returns All the available block tags instances */ getAllTags(name: string): CommentPart[]; /** * Whether the documentation comment has tags that make the * associated declaration ignored for documentation purposes. * * @returns True if the symbol should be ignored based on the JSDoc, otherwise false */ isIgnored(): boolean; /** * Serializes the reflected node * * @returns The reflected node as a serializable object */ serialize(): CommentPart[]; private _parseComments; } //# sourceMappingURL=comment-node.d.ts.map