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/compiler-cli/linker/src/ast/typescript/typescript_ast_host" />
|
---|
9 | import * as ts from 'typescript';
|
---|
10 | import { AstHost, Range } from '../ast_host';
|
---|
11 | /**
|
---|
12 | * This implementation of `AstHost` is able to get information from TypeScript AST nodes.
|
---|
13 | *
|
---|
14 | * This host is not actually used at runtime in the current code.
|
---|
15 | *
|
---|
16 | * It is implemented here to ensure that the `AstHost` abstraction is not unfairly skewed towards
|
---|
17 | * the Babel implementation. It could also provide a basis for a 3rd TypeScript compiler plugin to
|
---|
18 | * do linking in the future.
|
---|
19 | */
|
---|
20 | export declare class TypeScriptAstHost implements AstHost<ts.Expression> {
|
---|
21 | getSymbolName(node: ts.Expression): string | null;
|
---|
22 | isStringLiteral: typeof ts.isStringLiteral;
|
---|
23 | parseStringLiteral(str: ts.Expression): string;
|
---|
24 | isNumericLiteral: typeof ts.isNumericLiteral;
|
---|
25 | parseNumericLiteral(num: ts.Expression): number;
|
---|
26 | isBooleanLiteral(node: ts.Expression): boolean;
|
---|
27 | parseBooleanLiteral(bool: ts.Expression): boolean;
|
---|
28 | isArrayLiteral: typeof ts.isArrayLiteralExpression;
|
---|
29 | parseArrayLiteral(array: ts.Expression): ts.Expression[];
|
---|
30 | isObjectLiteral: typeof ts.isObjectLiteralExpression;
|
---|
31 | parseObjectLiteral(obj: ts.Expression): Map<string, ts.Expression>;
|
---|
32 | isFunctionExpression(node: ts.Expression): node is ts.FunctionExpression | ts.ArrowFunction;
|
---|
33 | parseReturnValue(fn: ts.Expression): ts.Expression;
|
---|
34 | isCallExpression: typeof ts.isCallExpression;
|
---|
35 | parseCallee(call: ts.Expression): ts.Expression;
|
---|
36 | parseArguments(call: ts.Expression): ts.Expression[];
|
---|
37 | getRange(node: ts.Expression): Range;
|
---|
38 | }
|
---|