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/src/ngtsc/typecheck/src/ts_util" />
|
---|
9 | import * as ts from 'typescript';
|
---|
10 | import { ClassDeclaration } from '../../reflection';
|
---|
11 | export declare function tsCastToAny(expr: ts.Expression): ts.Expression;
|
---|
12 | /**
|
---|
13 | * Create an expression which instantiates an element by its HTML tagName.
|
---|
14 | *
|
---|
15 | * Thanks to narrowing of `document.createElement()`, this expression will have its type inferred
|
---|
16 | * based on the tag name, including for custom elements that have appropriate .d.ts definitions.
|
---|
17 | */
|
---|
18 | export declare function tsCreateElement(tagName: string): ts.Expression;
|
---|
19 | /**
|
---|
20 | * Create a `ts.VariableStatement` which declares a variable without explicit initialization.
|
---|
21 | *
|
---|
22 | * The initializer `null!` is used to bypass strict variable initialization checks.
|
---|
23 | *
|
---|
24 | * Unlike with `tsCreateVariable`, the type of the variable is explicitly specified.
|
---|
25 | */
|
---|
26 | export declare function tsDeclareVariable(id: ts.Identifier, type: ts.TypeNode): ts.VariableStatement;
|
---|
27 | /**
|
---|
28 | * Creates a `ts.TypeQueryNode` for a coerced input.
|
---|
29 | *
|
---|
30 | * For example: `typeof MatInput.ngAcceptInputType_value`, where MatInput is `typeName` and `value`
|
---|
31 | * is the `coercedInputName`.
|
---|
32 | *
|
---|
33 | * @param typeName The `EntityName` of the Directive where the static coerced input is defined.
|
---|
34 | * @param coercedInputName The field name of the coerced input.
|
---|
35 | */
|
---|
36 | export declare function tsCreateTypeQueryForCoercedInput(typeName: ts.EntityName, coercedInputName: string): ts.TypeQueryNode;
|
---|
37 | /**
|
---|
38 | * Create a `ts.VariableStatement` that initializes a variable with a given expression.
|
---|
39 | *
|
---|
40 | * Unlike with `tsDeclareVariable`, the type of the variable is inferred from the initializer
|
---|
41 | * expression.
|
---|
42 | */
|
---|
43 | export declare function tsCreateVariable(id: ts.Identifier, initializer: ts.Expression): ts.VariableStatement;
|
---|
44 | /**
|
---|
45 | * Construct a `ts.CallExpression` that calls a method on a receiver.
|
---|
46 | */
|
---|
47 | export declare function tsCallMethod(receiver: ts.Expression, methodName: string, args?: ts.Expression[]): ts.CallExpression;
|
---|
48 | export declare function checkIfClassIsExported(node: ClassDeclaration): boolean;
|
---|
49 | export declare function checkIfGenericTypesAreUnbound(node: ClassDeclaration<ts.ClassDeclaration>): boolean;
|
---|
50 | export declare function isAccessExpression(node: ts.Node): node is ts.ElementAccessExpression | ts.PropertyAccessExpression;
|
---|