UNPKG

2.61 kBTypeScriptView Raw
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/language-service/src/expression_type" />
9import { AST, AstVisitor, Binary, BindingPipe, Chain, Conditional, FunctionCall, ImplicitReceiver, Interpolation, KeyedRead, KeyedWrite, LiteralArray, LiteralMap, LiteralPrimitive, MethodCall, NonNullAssert, PrefixNot, PropertyRead, PropertyWrite, Quote, SafeMethodCall, SafePropertyRead, ThisReceiver, Unary } from '@angular/compiler';
10import { Symbol, SymbolQuery, SymbolTable } from './symbols';
11import * as ng from './types';
12interface ExpressionDiagnosticsContext {
13 inEvent?: boolean;
14}
15export declare class AstType implements AstVisitor {
16 private scope;
17 private query;
18 private context;
19 private source;
20 private readonly diagnostics;
21 constructor(scope: SymbolTable, query: SymbolQuery, context: ExpressionDiagnosticsContext, source: string);
22 getType(ast: AST): Symbol;
23 getDiagnostics(ast: AST): ng.Diagnostic[];
24 visitUnary(ast: Unary): Symbol;
25 visitBinary(ast: Binary): Symbol;
26 visitChain(ast: Chain): Symbol;
27 visitConditional(ast: Conditional): Symbol;
28 visitFunctionCall(ast: FunctionCall): Symbol;
29 visitImplicitReceiver(_ast: ImplicitReceiver): Symbol;
30 visitThisReceiver(_ast: ThisReceiver): Symbol;
31 visitInterpolation(ast: Interpolation): Symbol;
32 visitKeyedRead(ast: KeyedRead): Symbol;
33 visitKeyedWrite(ast: KeyedWrite): Symbol;
34 visitLiteralArray(ast: LiteralArray): Symbol;
35 visitLiteralMap(ast: LiteralMap): Symbol;
36 visitLiteralPrimitive(ast: LiteralPrimitive): Symbol;
37 visitMethodCall(ast: MethodCall): Symbol;
38 visitPipe(ast: BindingPipe): Symbol;
39 visitPrefixNot(ast: PrefixNot): Symbol;
40 visitNonNullAssert(ast: NonNullAssert): Symbol;
41 visitPropertyRead(ast: PropertyRead): Symbol | undefined;
42 visitPropertyWrite(ast: PropertyWrite): Symbol;
43 visitQuote(_ast: Quote): Symbol;
44 visitSafeMethodCall(ast: SafeMethodCall): Symbol;
45 visitSafePropertyRead(ast: SafePropertyRead): Symbol | undefined;
46 /**
47 * Gets the source of an expession AST.
48 * The AST's sourceSpan is relative to the start of the template source code, which is contained
49 * at this.source.
50 */
51 private sourceOf;
52 private _anyType;
53 private get anyType();
54 private _undefinedType;
55 private get undefinedType();
56 private resolveMethodCall;
57 private resolvePropertyRead;
58 private isAny;
59}
60export {};