-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
entities.ts
124 lines (108 loc) Β· 2.76 KB
/
entities.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
* @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
*/
/** Type of top-level documentation entry. */
export enum EntryType {
Block = 'Block',
Component = 'component',
Constant = 'constant',
Decorator = 'decorator',
Directive = 'directive',
Element = 'element',
Enum = 'enum',
Function = 'function',
Interface = 'interface',
NgModule = 'ng_module',
Pipe = 'pipe',
TypeAlias = 'type_alias',
UndecoratedClass = 'undecorated_class',
}
/** Types of class members */
export enum MemberType {
Property = 'property',
Method = 'method',
Getter = 'getter',
Setter = 'setter',
EnumItem = 'enum_item',
}
/** Informational tags applicable to class members. */
export enum MemberTags {
Static = 'static',
Readonly = 'readonly',
Protected = 'protected',
Optional = 'optional',
Input = 'input',
Output = 'output',
}
export interface JsDocTagEntry {
name: string;
comment: string;
}
/** Base type for all documentation entities. */
export interface DocEntry {
entryType: EntryType;
name: string;
description: string;
rawComment: string;
jsdocTags: JsDocTagEntry[];
}
/** Documentation entity for a constant. */
export interface ConstantEntry extends DocEntry {
type: string;
}
/** Documentation entity for a TypeScript class. */
export interface ClassEntry extends DocEntry {
members: MemberEntry[];
}
/** Documentation entity for a TypeScript enum. */
export interface EnumEntry extends DocEntry {
members: EnumMemberEntry[];
}
/** Documentation entity for an Angular directives and components. */
export interface DirectiveEntry extends ClassEntry {
selector: string;
exportAs: string[];
isStandalone: boolean;
}
export interface PipeEntry extends ClassEntry {
pipeName: string;
isStandalone: boolean;
// TODO: add `isPure`.
}
export interface FunctionEntry extends DocEntry {
params: ParameterEntry[];
returnType: string;
}
/** Sub-entry for a single class or enum member. */
export interface MemberEntry {
name: string;
memberType: MemberType;
memberTags: MemberTags[];
description: string;
jsdocTags: JsDocTagEntry[];
}
/** Sub-entry for an enum member. */
export interface EnumMemberEntry extends MemberEntry {
type: string;
value: string;
}
/** Sub-entry for a class property. */
export interface PropertyEntry extends MemberEntry {
type: string;
inputAlias?: string;
outputAlias?: string;
}
/** Sub-entry for a class method. */
export type MethodEntry = MemberEntry&FunctionEntry;
/** Sub-entry for a single function parameter. */
export interface ParameterEntry {
name: string;
description: string;
type: string;
isOptional: boolean;
isRestParam: boolean;
}