UNPKG

1.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.dev/license
7 */
8import ts from 'typescript';
9export { getDownlevelDecoratorsTransform } from './downlevel_decorators_transform';
10export { getInitializerApiJitTransform } from './initializer_api_transforms/transform';
11/**
12 * JIT transform for Angular applications. Used by the Angular CLI for unit tests and
13 * explicit JIT applications.
14 *
15 * The transforms include:
16 *
17 * - A transform for downleveling Angular decorators and Angular-decorated class constructor
18 * parameters for dependency injection. This transform can be used by the CLI for JIT-mode
19 * compilation where constructor parameters and associated Angular decorators should be
20 * downleveled so that apps are not exposed to the ES2015 temporal dead zone limitation
21 * in TypeScript. See https://github.com/angular/angular-cli/pull/14473 for more details.
22 *
23 * - A transform for adding `@Input` to signal inputs. Signal inputs cannot be recognized
24 * at runtime using reflection. That is because the class would need to be instantiated-
25 * but is not possible before creation. To fix this for JIT, a decorator is automatically
26 * added that will declare the input as a signal input while also capturing the necessary
27 * metadata
28 */
29export declare function angularJitApplicationTransform(program: ts.Program, isCore?: boolean, shouldTransformClass?: (node: ts.ClassDeclaration) => boolean): ts.TransformerFactory<ts.SourceFile>;