🚧 Still under progress. Soon will be finished.

DeclarationNode

INTERFACE code

Description

A reflected node that represents a declaration.

Methods

  • getName

    code

    Returns the name of the declaration.

    getName(): string

    Returns

    string:
  • getJSDoc

    code

    Returns the documentation comment attached to this declaration.

    getJSDoc(): CommentNode | null

    Returns

    CommentNode | null:
  • getKind

    code

    Returns the type of declaration

    getKind(): DeclarationKind | MemberKind

    Returns

    DeclarationKind | MemberKind:
  • getNamespace

    code

    Returns the namespaces where this declaration is inside. If no namespace is found, an empty string is returned.

    getNamespace(): string

    Returns

    string:
  • getNodeType

    code

    The type of node. Can be an import, an export or a declaration

    getNodeType(): RootNodeType

    Returns

    RootNodeType:
  • getTSNode

    code

    The original node generated by the TypeScript compiler

    getTSNode(): TSNode | null

    Returns

    TSNode | null:
  • getContext

    code

    Returns the context in which the AST node was created. The context contains useful utilities like the TS type checker.

    getContext(): ProjectContext

    Returns

    ProjectContext:
  • serialize

    code

    Returns a simple readonly JavaScript object without methods or internal state.

    serialize(): Model

    Returns

    Model: