/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import ts from 'typescript'; export declare function tsCastToAny(expr: ts.Expression): ts.Expression; /** * Create an expression which instantiates an element by its HTML tagName. * * Thanks to narrowing of `document.createElement()`, this expression will have its type inferred * based on the tag name, including for custom elements that have appropriate .d.ts definitions. */ export declare function tsCreateElement(...tagNames: string[]): ts.Expression; /** * Create a `ts.VariableStatement` which declares a variable without explicit initialization. * * The initializer `null!` is used to bypass strict variable initialization checks. * * Unlike with `tsCreateVariable`, the type of the variable is explicitly specified. */ export declare function tsDeclareVariable(id: ts.Identifier, type: ts.TypeNode): ts.VariableStatement; /** * Creates a `ts.TypeQueryNode` for a coerced input. * * For example: `typeof MatInput.ngAcceptInputType_value`, where MatInput is `typeName` and `value` * is the `coercedInputName`. * * @param typeName The `EntityName` of the Directive where the static coerced input is defined. * @param coercedInputName The field name of the coerced input. */ export declare function tsCreateTypeQueryForCoercedInput(typeName: ts.EntityName, coercedInputName: string): ts.TypeQueryNode; /** * Create a `ts.VariableStatement` that initializes a variable with a given expression. * * Unlike with `tsDeclareVariable`, the type of the variable is inferred from the initializer * expression. */ export declare function tsCreateVariable(id: ts.Identifier, initializer: ts.Expression, flags?: ts.NodeFlags | null): ts.VariableStatement; /** * Construct a `ts.CallExpression` that calls a method on a receiver. */ export declare function tsCallMethod(receiver: ts.Expression, methodName: string, args?: ts.Expression[]): ts.CallExpression; export declare function isAccessExpression(node: ts.Node): node is ts.ElementAccessExpression | ts.PropertyAccessExpression; /** * Creates a TypeScript node representing a numeric value. */ export declare function tsNumericExpression(value: number): ts.NumericLiteral | ts.PrefixUnaryExpression;