1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import ts from 'typescript';
|
10 | import { DependencyTracker } from '../../incremental/api';
|
11 | import { ReflectionHost } from '../../reflection';
|
12 | import { ForeignFunctionResolver } from './interface';
|
13 | import { ResolvedValue } from './result';
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | declare type Scope = Map<ts.ParameterDeclaration, ResolvedValue>;
|
19 | interface Context {
|
20 | originatingFile: ts.SourceFile;
|
21 | |
22 |
|
23 |
|
24 | absoluteModuleName: string | null;
|
25 | |
26 |
|
27 |
|
28 |
|
29 | resolutionContext: string;
|
30 | scope: Scope;
|
31 | foreignFunctionResolver?: ForeignFunctionResolver;
|
32 | }
|
33 | export declare class StaticInterpreter {
|
34 | private host;
|
35 | private checker;
|
36 | private dependencyTracker;
|
37 | constructor(host: ReflectionHost, checker: ts.TypeChecker, dependencyTracker: DependencyTracker | null);
|
38 | visit(node: ts.Expression, context: Context): ResolvedValue;
|
39 | private visitExpression;
|
40 | private visitArrayLiteralExpression;
|
41 | protected visitObjectLiteralExpression(node: ts.ObjectLiteralExpression, context: Context): ResolvedValue;
|
42 | private visitTemplateExpression;
|
43 | private visitIdentifier;
|
44 | private visitDeclaration;
|
45 | private visitVariableDeclaration;
|
46 | private visitEnumDeclaration;
|
47 | private visitElementAccessExpression;
|
48 | private visitPropertyAccessExpression;
|
49 | private visitSourceFile;
|
50 | private visitAmbiguousDeclaration;
|
51 | private accessHelper;
|
52 | private visitCallExpression;
|
53 | /**
|
54 | * Visit an expression which was extracted from a foreign-function resolver.
|
55 | *
|
56 | * This will process the result and ensure it's correct for FFR-resolved values, including marking
|
57 | * `Reference`s as synthetic.
|
58 | */
|
59 | private visitFfrExpression;
|
60 | private visitFunctionBody;
|
61 | private visitConditionalExpression;
|
62 | private visitPrefixUnaryExpression;
|
63 | private visitBinaryExpression;
|
64 | private visitParenthesizedExpression;
|
65 | private evaluateFunctionArguments;
|
66 | private visitSpreadElement;
|
67 | private visitBindingElement;
|
68 | private stringNameFromPropertyName;
|
69 | private getResolvedEnum;
|
70 | private getReference;
|
71 | private visitType;
|
72 | private visitTupleType;
|
73 | }
|
74 | export {};
|