-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
scope.ts
88 lines (74 loc) 路 1.75 KB
/
scope.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* @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.io/license
*/
import ts from 'typescript';
import {EmittedReference, Reference} from '../../imports';
import {ClassDeclaration} from '../../reflection';
import {SymbolWithValueDeclaration} from '../../util/src/typescript';
/**
* A PotentialImport for some Angular trait has a TypeScript module specifier, which can be
* relative, as well as an identifier name.
*/
export interface PotentialImport {
kind: PotentialImportKind;
moduleSpecifier: string;
symbolName: string;
}
/**
* Which kind of Angular Trait the import targets.
*/
export enum PotentialImportKind {
NgModule,
Standalone,
}
/**
* Metadata on a directive which is available in a template.
*/
export interface PotentialDirective {
ref: Reference<ClassDeclaration>;
/**
* The `ts.Symbol` for the directive class.
*/
tsSymbol: SymbolWithValueDeclaration;
/**
* The module which declares the directive.
*/
ngModule: ClassDeclaration|null;
/**
* The selector for the directive or component.
*/
selector: string|null;
/**
* `true` if this directive is a component.
*/
isComponent: boolean;
/**
* `true` if this directive is a structural directive.
*/
isStructural: boolean;
/**
* Whether or not this directive is in scope.
*/
isInScope: boolean;
}
/**
* Metadata for a pipe which is available in a template.
*/
export interface PotentialPipe {
/**
* The `ts.Symbol` for the pipe class.
*/
tsSymbol: ts.Symbol;
/**
* Name of the pipe.
*/
name: string;
/**
* Whether or not this pipe is in scope.
*/
isInScope: boolean;
}