UNPKG

1.36 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';
9import { ReflectionHost } from '../../../reflection';
10/**
11 * Gets a transformer for downleveling Angular constructor parameter and property decorators.
12 *
13 * Note that Angular class decorators are never processed as those rely on side effects that
14 * would otherwise no longer be executed. i.e. the creation of a component definition.
15 *
16 * @param typeChecker Reference to the program's type checker.
17 * @param host Reflection host that is used for determining decorators.
18 * @param diagnostics List which will be populated with diagnostics if any.
19 * @param isCore Whether the current TypeScript program is for the `@angular/core` package.
20 * @param isClosureCompilerEnabled Whether closure annotations need to be added where needed.
21 * @param shouldTransformClass Optional function to check if a given class should be transformed.
22 */
23export declare function getDownlevelDecoratorsTransform(typeChecker: ts.TypeChecker, host: ReflectionHost, diagnostics: ts.Diagnostic[], isCore: boolean, isClosureCompilerEnabled: boolean, shouldTransformClass?: (node: ts.ClassDeclaration) => boolean): ts.TransformerFactory<ts.SourceFile>;