Angular Modernizer
    Preparing search index...

    Resolves callables and their callees in a ts-morph project.

    Maps TypeScript declarations to callables (methods, functions, constructors incl. field initializers, accessors, function-valued properties) and resolves what a callable calls: call expressions via the type checker (name-based fallback), new X(), super(), and property reads/writes that hit a getter/setter.

    Shared by CallGraphBuilder (caller/callee trees for one target) and BootstrapExecutionAnalyzer (everything that runs from bootstrap roots).

    Index

    Constructors

    Methods

    • Collects the callables invoked from the bodies of callable: calls, new expressions, super() calls and property accesses that hit a getter or setter. Duplicates are kept.

      Parameters

      Returns Callable[]

    • Constructor callable for a class: the explicit constructor body (if any) plus all non-static, non-function field initializers.

      Parameters

      • cls: ClassDeclaration

      Returns Callable

    • Finds the callable that contains node. Anonymous callbacks are attributed to their enclosing named callable; references inside a non-function field initializer are attributed to the class constructor.

      Parameters

      • node: Node

      Returns Callable | null

    • Stable identity of a callable: file:line:name of its declaration.

      Parameters

      Returns string

    • Resolves the declarations behind an expression via the type checker. Returns undefined when no symbol can be resolved (caller may fall back to name-based lookup) and an empty array when the symbol resolves to declarations that cannot be represented.

      Parameters

      • expr: Node

      Returns Node<Node>[] | undefined

    • Finds a callable by name in one file.

      Parameters

      • name: string

        member, Class.member or Class.constructor; without a class prefix, class members are tried first, then top-level functions and variables.

      • file: string

        Path of the source file in the project.

      Returns Callable | null

      The callable, or null when the file or name is not found.

    • Converts a declaration node into a Callable, or null when the node cannot run code (e.g. a plain data property or an interface member).

      Parameters

      • node: Node

      Returns Callable | null