UNPKG

@ts-ast-parser/core

Version:

Reflects a simplified version of the TypeScript AST for generating documentation

82 lines 2.44 kB
import { DeclarationKind } from '../models/declaration-kind.js'; import type { ProjectContext } from '../project-context.js'; import type { DeclarationNode } from './declaration-node.js'; import type { EnumDeclaration } from '../models/enum.js'; import { EnumMemberNode } from './enum-member-node.js'; import { RootNodeType } from '../models/node.js'; import { CommentNode } from './comment-node.js'; import type ts from 'typescript'; /** * Represents the reflected node of an enumerable declaration */ export declare class EnumNode implements DeclarationNode<EnumDeclaration, ts.EnumDeclaration> { private readonly _node; private readonly _context; private readonly _jsDoc; constructor(node: ts.EnumDeclaration, context: ProjectContext); /** * The reflected node kind * * @returns A declaration kind node */ getNodeType(): RootNodeType; /** * The reflected declaration kind * * @returns An Enum kind node */ getKind(): DeclarationKind.Enum; /** * The original TypeScript node * * @returns The TypeScript AST node related to this reflected node */ getTSNode(): ts.EnumDeclaration; /** * The context includes useful APIs that are shared across * all the reflected symbols. * * Some APIs include the parsed configuration options, the * system interface, the type checker * * @returns The analyser context */ getContext(): ProjectContext; /** * Gets the name of the enum declaration * * @returns The name of the enum declaration */ getName(): string; /** * The line position where the node is defined * * @returns The start line position number */ getLine(): number; /** * The namespace where the enum declaration is defined. * * @returns The namespace name if found one, otherwise an empty string */ getNamespace(): string; /** * The reflected documentation comment * * @returns The JSDoc node */ getJSDoc(): CommentNode; /** * The reflected members of the enum declaration * * @returns The array of reflected enum members */ getMembers(): EnumMemberNode[]; /** * Serializes the reflected node * * @returns The reflected node as a serializable object */ serialize(): EnumDeclaration; } //# sourceMappingURL=enum-node.d.ts.map