source: trip-planner-front/node_modules/@angular/core/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.d.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8/// <amd-module name="@angular/core/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor" />
9import * as ts from 'typescript';
10export declare type FunctionContext = Map<ts.Node, ts.Node>;
11export declare enum ResolvedUsage {
12 SYNCHRONOUS = 0,
13 ASYNCHRONOUS = 1,
14 AMBIGUOUS = 2
15}
16/**
17 * Class that can be used to determine if a given TypeScript node is used within
18 * other given TypeScript nodes. This is achieved by walking through all children
19 * of the given node and checking for usages of the given declaration. The visitor
20 * also handles potential control flow changes caused by call/new expressions.
21 */
22export declare class DeclarationUsageVisitor {
23 private declaration;
24 private typeChecker;
25 private baseContext;
26 /** Set of visited symbols that caused a jump in control flow. */
27 private visitedJumpExprNodes;
28 /**
29 * Queue of nodes that need to be checked for declaration usage and
30 * are guaranteed to be executed synchronously.
31 */
32 private nodeQueue;
33 /**
34 * Nodes which need to be checked for declaration usage but aren't
35 * guaranteed to execute synchronously.
36 */
37 private ambiguousNodeQueue;
38 /**
39 * Function context that holds the TypeScript node values for all parameters
40 * of the currently analyzed function block.
41 */
42 private context;
43 constructor(declaration: ts.Node, typeChecker: ts.TypeChecker, baseContext?: FunctionContext);
44 private isReferringToSymbol;
45 private addJumpExpressionToQueue;
46 private addNewExpressionToQueue;
47 private visitPropertyAccessors;
48 private visitBinaryExpression;
49 getResolvedNodeUsage(searchNode: ts.Node): ResolvedUsage;
50 private isSynchronouslyUsedInNode;
51 /**
52 * Peeks into the given jump expression by adding all function like declarations
53 * which are referenced in the jump expression arguments to the ambiguous node
54 * queue. These arguments could technically access the given declaration but it's
55 * not guaranteed that the jump expression is executed. In that case the resolved
56 * usage is ambiguous.
57 */
58 private peekIntoJumpExpression;
59 /**
60 * Resolves a given node from the context. In case the node is not mapped in
61 * the context, the original node is returned.
62 */
63 private _resolveNodeFromContext;
64 /**
65 * Updates the context to reflect the newly set parameter values. This allows future
66 * references to function parameters to be resolved to the actual node through the context.
67 */
68 private _updateContext;
69 /**
70 * Resolves the declaration of a given TypeScript node. For example an identifier can
71 * refer to a function parameter. This parameter can then be resolved through the
72 * function context.
73 */
74 private _resolveDeclarationOfNode;
75 /**
76 * Gets the declaration symbol of a given TypeScript node. Resolves aliased
77 * symbols to the symbol containing the value declaration.
78 */
79 private _getDeclarationSymbolOfNode;
80 /** Gets the symbol of the given property access expression. */
81 private _getPropertyAccessSymbol;
82}
Note: See TracBrowser for help on using the repository browser.