Angular Modernizer
    Preparing search index...

    Finds the declaration an identifier or member access refers to without the type checker: local variables and parameters, class members of this.x, static members of Cls.x, members of a field or parameter through its declared type (this.api.get -> Api.get), top-level declarations and imports. Module specifiers are resolved with the TypeScript module resolution of the project (tsconfig paths included); export { } from and export * from are followed.

    Building a type checker parses every file the program reaches (on an Angular app thousands of .d.ts files, about 2 s); this resolver reads only the files it needs. Files outside the project are parsed into a private side project, so the caller's project does not change. Library modules (node_modules, .d.ts) are not followed.

    const resolver = new SyntacticResolver(project);
    resolver.declarationOf(call.getExpression()); // MethodDeclaration of Urls.getOrdersPrefix
    Index

    Constructors

    Methods

    • Class a (possibly ns.-qualified) type name resolves to, looked up from context.

      Parameters

      • name: string
      • context: Node

      Returns ClassDeclaration | undefined

    • Declaration an identifier or property access refers to.

      Parameters

      • expr: Node

      Returns Node<Node> | undefined