1 | /// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/ngcc_trait_compiler" />
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | import * as ts from 'typescript';
|
---|
10 | import { SemanticSymbol } from '../../../src/ngtsc/incremental/semantic_graph';
|
---|
11 | import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
|
---|
12 | import { DecoratorHandler, HandlerFlags, Trait, TraitCompiler } from '../../../src/ngtsc/transform';
|
---|
13 | import { NgccReflectionHost } from '../host/ngcc_host';
|
---|
14 | /**
|
---|
15 | * Specializes the `TraitCompiler` for ngcc purposes. Mainly, this includes an alternative way of
|
---|
16 | * scanning for classes to compile using the reflection host's `findClassSymbols`, together with
|
---|
17 | * support to inject synthetic decorators into the compilation for ad-hoc migrations that ngcc
|
---|
18 | * performs.
|
---|
19 | */
|
---|
20 | export declare class NgccTraitCompiler extends TraitCompiler {
|
---|
21 | private ngccReflector;
|
---|
22 | constructor(handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[], ngccReflector: NgccReflectionHost);
|
---|
23 | get analyzedFiles(): ts.SourceFile[];
|
---|
24 | /**
|
---|
25 | * Analyzes the source file in search for classes to process. For any class that is found in the
|
---|
26 | * file, a `ClassRecord` is created and the source file is included in the `analyzedFiles` array.
|
---|
27 | */
|
---|
28 | analyzeFile(sf: ts.SourceFile): void;
|
---|
29 | /**
|
---|
30 | * Associate a new synthesized decorator, which did not appear in the original source, with a
|
---|
31 | * given class.
|
---|
32 | * @param clazz the class to receive the new decorator.
|
---|
33 | * @param decorator the decorator to inject.
|
---|
34 | * @param flags optional bitwise flag to influence the compilation of the decorator.
|
---|
35 | */
|
---|
36 | injectSyntheticDecorator(clazz: ClassDeclaration, decorator: Decorator, flags?: HandlerFlags): Trait<unknown, unknown, SemanticSymbol | null, unknown>[];
|
---|
37 | /**
|
---|
38 | * Returns all decorators that have been recognized for the provided class, including any
|
---|
39 | * synthetically injected decorators.
|
---|
40 | * @param clazz the declaration for which the decorators are returned.
|
---|
41 | */
|
---|
42 | getAllDecorators(clazz: ClassDeclaration): Decorator[] | null;
|
---|
43 | }
|
---|