source: trip-planner-front/node_modules/@angular/compiler-cli/src/ngtsc/annotations/src/directive.d.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 6.2 KB
Line 
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/annotations/src/directive" />
9import { ConstantPool, ParsedHostBindings, R3ClassMetadata, R3DirectiveMetadata, R3QueryMetadata } from '@angular/compiler';
10import * as ts from 'typescript';
11import { Reference } from '../../imports';
12import { SemanticDepGraphUpdater, SemanticSymbol, SemanticTypeParameter } from '../../incremental/semantic_graph';
13import { ClassPropertyMapping, DirectiveTypeCheckMeta, InjectableClassRegistry, MetadataReader, MetadataRegistry } from '../../metadata';
14import { PartialEvaluator } from '../../partial_evaluator';
15import { PerfRecorder } from '../../perf';
16import { ClassDeclaration, ClassMember, Decorator, ReflectionHost } from '../../reflection';
17import { LocalModuleScopeRegistry } from '../../scope';
18import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerFlags, HandlerPrecedence, ResolveResult } from '../../transform';
19export interface DirectiveHandlerData {
20 baseClass: Reference<ClassDeclaration> | 'dynamic' | null;
21 typeCheckMeta: DirectiveTypeCheckMeta;
22 meta: R3DirectiveMetadata;
23 classMetadata: R3ClassMetadata | null;
24 providersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
25 inputs: ClassPropertyMapping;
26 outputs: ClassPropertyMapping;
27 isPoisoned: boolean;
28 isStructural: boolean;
29}
30/**
31 * Represents an Angular directive. Components are represented by `ComponentSymbol`, which inherits
32 * from this symbol.
33 */
34export declare class DirectiveSymbol extends SemanticSymbol {
35 readonly selector: string | null;
36 readonly inputs: ClassPropertyMapping;
37 readonly outputs: ClassPropertyMapping;
38 readonly exportAs: string[] | null;
39 readonly typeCheckMeta: DirectiveTypeCheckMeta;
40 readonly typeParameters: SemanticTypeParameter[] | null;
41 baseClass: SemanticSymbol | null;
42 constructor(decl: ClassDeclaration, selector: string | null, inputs: ClassPropertyMapping, outputs: ClassPropertyMapping, exportAs: string[] | null, typeCheckMeta: DirectiveTypeCheckMeta, typeParameters: SemanticTypeParameter[] | null);
43 isPublicApiAffected(previousSymbol: SemanticSymbol): boolean;
44 isTypeCheckApiAffected(previousSymbol: SemanticSymbol): boolean;
45}
46export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decorator | null, DirectiveHandlerData, DirectiveSymbol, unknown> {
47 private reflector;
48 private evaluator;
49 private metaRegistry;
50 private scopeRegistry;
51 private metaReader;
52 private injectableRegistry;
53 private isCore;
54 private semanticDepGraphUpdater;
55 private annotateForClosureCompiler;
56 private compileUndecoratedClassesWithAngularFeatures;
57 private perf;
58 constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, isCore: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, compileUndecoratedClassesWithAngularFeatures: boolean, perf: PerfRecorder);
59 readonly precedence = HandlerPrecedence.PRIMARY;
60 readonly name: string;
61 detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
62 analyze(node: ClassDeclaration, decorator: Readonly<Decorator | null>, flags?: HandlerFlags): AnalysisOutput<DirectiveHandlerData>;
63 symbol(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): DirectiveSymbol;
64 register(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): void;
65 resolve(node: ClassDeclaration, analysis: DirectiveHandlerData, symbol: DirectiveSymbol): ResolveResult<unknown>;
66 compileFull(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>, resolution: Readonly<unknown>, pool: ConstantPool): CompileResult[];
67 compilePartial(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>, resolution: Readonly<unknown>): CompileResult[];
68 /**
69 * Checks if a given class uses Angular features and returns the TypeScript node
70 * that indicated the usage. Classes are considered using Angular features if they
71 * contain class members that are either decorated with a known Angular decorator,
72 * or if they correspond to a known Angular lifecycle hook.
73 */
74 private findClassFieldWithAngularFeatures;
75}
76/**
77 * Helper function to extract metadata from a `Directive` or `Component`. `Directive`s without a
78 * selector are allowed to be used for abstract base classes. These abstract directives should not
79 * appear in the declarations of an `NgModule` and additional verification is done when processing
80 * the module.
81 */
82export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator | null>, reflector: ReflectionHost, evaluator: PartialEvaluator, isCore: boolean, flags: HandlerFlags, annotateForClosureCompiler: boolean, defaultSelector?: string | null): {
83 decorator: Map<string, ts.Expression>;
84 metadata: R3DirectiveMetadata;
85 inputs: ClassPropertyMapping;
86 outputs: ClassPropertyMapping;
87 isStructural: boolean;
88} | undefined;
89export declare function extractQueryMetadata(exprNode: ts.Node, name: string, args: ReadonlyArray<ts.Expression>, propertyName: string, reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata;
90export declare function extractQueriesFromDecorator(queryData: ts.Expression, reflector: ReflectionHost, evaluator: PartialEvaluator, isCore: boolean): {
91 content: R3QueryMetadata[];
92 view: R3QueryMetadata[];
93};
94export declare function parseFieldArrayValue(directive: Map<string, ts.Expression>, field: string, evaluator: PartialEvaluator): null | string[];
95export declare function queriesFromFields(fields: {
96 member: ClassMember;
97 decorators: Decorator[];
98}[], reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata[];
99export declare function extractHostBindings(members: ClassMember[], evaluator: PartialEvaluator, coreModule: string | undefined, metadata?: Map<string, ts.Expression>): ParsedHostBindings;
Note: See TracBrowser for help on using the repository browser.