@ts-ast-parser/core
Version:
Reflects a simplified version of the TypeScript AST for generating documentation
50 lines • 2.06 kB
TypeScript
import type { NodeWithFunctionDeclaration, SymbolWithContext } from '../utils/types.js';
import type { FunctionDeclaration } from '../models/function.js';
import { DeclarationKind } from '../models/declaration-kind.js';
import type { Method, ModifierType } from '../models/member.js';
import type { ProjectContext } from '../project-context.js';
import type { DeclarationNode } from './declaration-node.js';
import { MemberKind } from '../models/member-kind.js';
import { DecoratorNode } from './decorator-node.js';
import { SignatureNode } from './signature-node.js';
import { RootNodeType } from '../models/node.js';
import { CommentNode } from './comment-node.js';
/**
* Represents the reflected node of a function declaration
*/
export declare class FunctionNode implements DeclarationNode<FunctionDeclaration | Method, NodeWithFunctionDeclaration> {
private readonly _node;
private readonly _member;
private readonly _context;
private readonly _jsDoc;
constructor(node: NodeWithFunctionDeclaration, member: SymbolWithContext | null, context: ProjectContext);
getName(): string;
getNodeType(): RootNodeType;
getContext(): ProjectContext;
getKind(): MemberKind.Method | DeclarationKind.Function;
getTSNode(): NodeWithFunctionDeclaration;
getLine(): number | null;
getNamespace(): string;
getJSDoc(): CommentNode | null;
getDecorators(): DecoratorNode[];
getDecoratorWithName(name: string): DecoratorNode | null;
getSignatures(): SignatureNode[];
getModifier(): ModifierType | null;
isGenerator(): boolean;
isAsync(): boolean;
isOptional(): boolean;
isStatic(): boolean;
isReadOnly(): boolean;
isAbstract(): boolean;
isInherited(): boolean;
isArrowFunctionOrFunctionExpression(): boolean;
overrides(): boolean;
/**
* Serializes the reflected node
*
* @returns The reflected node as a serializable object
*/
serialize(): FunctionDeclaration | Method;
private _getFunctionNode;
}
//# sourceMappingURL=function-node.d.ts.map