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.
Example
constresolver = newSyntacticResolver(project); resolver.declarationOf(call.getExpression()); // MethodDeclaration of Urls.getOrdersPrefix
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 ofCls.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 (tsconfigpathsincluded);export { } fromandexport * fromare followed.Building a type checker parses every file the program reaches (on an Angular app thousands of
.d.tsfiles, 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.Example