@cparra/apex-reflection 1.11.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/end-to-end.test.ts +8 -8
- package/coverage/clover.xml +16052 -0
- package/coverage/coverage-final.json +3 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +79 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +126 -0
- package/coverage/lcov-report/index.js.html +104 -0
- package/coverage/lcov-report/out.js.html +51182 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +170 -0
- package/coverage/lcov.info +30947 -0
- package/index.d.ts +19 -4
- package/index.ts +111 -91
- package/out.js +3897 -3781
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -39,10 +39,25 @@ export interface Annotation {
|
|
|
39
39
|
type: string;
|
|
40
40
|
elementValues?: AnnotationElementValue[];
|
|
41
41
|
}
|
|
42
|
+
export declare type ReferencedType = ReferenceObjectType | ListObjectType | SetObjectType | MapObjectType;
|
|
43
|
+
export interface ReferenceObjectType {
|
|
44
|
+
type: string;
|
|
45
|
+
rawDeclaration: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ListObjectType extends ReferenceObjectType {
|
|
48
|
+
ofType: ReferenceObjectType;
|
|
49
|
+
}
|
|
50
|
+
export interface SetObjectType extends ReferenceObjectType {
|
|
51
|
+
ofType: ReferenceObjectType;
|
|
52
|
+
}
|
|
53
|
+
export interface MapObjectType extends ReferenceObjectType {
|
|
54
|
+
keyType: ReferenceObjectType;
|
|
55
|
+
valueType: ReferenceObjectType;
|
|
56
|
+
}
|
|
42
57
|
export interface ParameterMirror {
|
|
43
58
|
memberModifiers: string[];
|
|
44
59
|
name: string;
|
|
45
|
-
|
|
60
|
+
typeReference: ReferencedType;
|
|
46
61
|
docComment?: DocComment;
|
|
47
62
|
}
|
|
48
63
|
export interface MethodMirror {
|
|
@@ -50,7 +65,7 @@ export interface MethodMirror {
|
|
|
50
65
|
annotations: Annotation[];
|
|
51
66
|
name: string;
|
|
52
67
|
memberModifiers: string[];
|
|
53
|
-
|
|
68
|
+
typeReference: ReferencedType;
|
|
54
69
|
parameters: ParameterMirror[];
|
|
55
70
|
docComment?: DocComment;
|
|
56
71
|
group?: string;
|
|
@@ -60,7 +75,7 @@ export interface PropertyMirror {
|
|
|
60
75
|
annotations: Annotation[];
|
|
61
76
|
name: string;
|
|
62
77
|
memberModifiers: string[];
|
|
63
|
-
|
|
78
|
+
typeReference: ReferencedType;
|
|
64
79
|
docComment?: DocComment;
|
|
65
80
|
group?: string;
|
|
66
81
|
}
|
|
@@ -69,7 +84,7 @@ export interface FieldMirror {
|
|
|
69
84
|
annotations: Annotation[];
|
|
70
85
|
name: string;
|
|
71
86
|
memberModifiers: string[];
|
|
72
|
-
|
|
87
|
+
typeReference: ReferencedType;
|
|
73
88
|
docComment?: DocComment;
|
|
74
89
|
group?: string;
|
|
75
90
|
}
|
package/index.ts
CHANGED
|
@@ -1,110 +1,130 @@
|
|
|
1
1
|
const lib = require('./out');
|
|
2
2
|
|
|
3
3
|
export function reflect(declarationBody: string): ReflectionResult {
|
|
4
|
-
|
|
4
|
+
return JSON.parse(lib.reflect(declarationBody)) as ReflectionResult;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export interface ParamAnnotation {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
bodyLines: string[];
|
|
9
|
+
paramName: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface ReturnAnnotation {
|
|
13
|
-
|
|
13
|
+
bodyLines: string[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface ExampleAnnotation {
|
|
17
|
-
|
|
17
|
+
bodyLines: string[];
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface ThrowsAnnotation {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
bodyLines: string[];
|
|
22
|
+
exceptionName: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface DocCommentAnnotation {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
name: string;
|
|
27
|
+
bodyLines: string[];
|
|
28
|
+
body: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface DocComment {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
rawDeclaration?: string;
|
|
33
|
+
paramAnnotations: ParamAnnotation[];
|
|
34
|
+
returnAnnotation: ReturnAnnotation;
|
|
35
|
+
exampleAnnotation: ExampleAnnotation;
|
|
36
|
+
throwsAnnotations: ThrowsAnnotation[];
|
|
37
|
+
annotations: DocCommentAnnotation[];
|
|
38
|
+
descriptionLines: string[];
|
|
39
|
+
description: string;
|
|
40
|
+
error?: string;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export interface AnnotationElementValue {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
key: string;
|
|
45
|
+
value: string;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export interface Annotation {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
rawDeclaration: string;
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
elementValues?: AnnotationElementValue[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ReferencedType = ReferenceObjectType | ListObjectType | SetObjectType | MapObjectType;
|
|
56
|
+
|
|
57
|
+
export interface ReferenceObjectType {
|
|
58
|
+
type: string;
|
|
59
|
+
rawDeclaration: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ListObjectType extends ReferenceObjectType {
|
|
63
|
+
ofType: ReferenceObjectType;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface SetObjectType extends ReferenceObjectType {
|
|
67
|
+
ofType: ReferenceObjectType;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface MapObjectType extends ReferenceObjectType {
|
|
71
|
+
keyType: ReferenceObjectType;
|
|
72
|
+
valueType: ReferenceObjectType;
|
|
53
73
|
}
|
|
54
74
|
|
|
55
75
|
export interface ParameterMirror {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
76
|
+
memberModifiers: string[];
|
|
77
|
+
name: string;
|
|
78
|
+
typeReference: ReferencedType;
|
|
79
|
+
docComment?: DocComment;
|
|
60
80
|
}
|
|
61
81
|
|
|
62
82
|
export interface MethodMirror {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
access_modifier: string;
|
|
84
|
+
annotations: Annotation[];
|
|
85
|
+
name: string;
|
|
86
|
+
memberModifiers: string[];
|
|
87
|
+
typeReference: ReferencedType;
|
|
88
|
+
parameters: ParameterMirror[];
|
|
89
|
+
docComment?: DocComment;
|
|
90
|
+
group?: string;
|
|
71
91
|
}
|
|
72
92
|
|
|
73
93
|
export interface PropertyMirror {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
access_modifier: string;
|
|
95
|
+
annotations: Annotation[];
|
|
96
|
+
name: string;
|
|
97
|
+
memberModifiers: string[];
|
|
98
|
+
typeReference: ReferencedType;
|
|
99
|
+
docComment?: DocComment;
|
|
100
|
+
group?: string;
|
|
81
101
|
}
|
|
82
102
|
|
|
83
103
|
export interface FieldMirror {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
access_modifier: string;
|
|
105
|
+
annotations: Annotation[];
|
|
106
|
+
name: string;
|
|
107
|
+
memberModifiers: string[];
|
|
108
|
+
typeReference: ReferencedType;
|
|
109
|
+
docComment?: DocComment;
|
|
110
|
+
group?: string;
|
|
91
111
|
}
|
|
92
112
|
|
|
93
113
|
export interface ConstructorMirror {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
114
|
+
access_modifier: string;
|
|
115
|
+
annotations: Annotation[];
|
|
116
|
+
parameters: ParameterMirror[];
|
|
117
|
+
docComment?: DocComment;
|
|
118
|
+
group?: string;
|
|
99
119
|
}
|
|
100
120
|
|
|
101
121
|
export interface ReflectionResult {
|
|
102
|
-
|
|
103
|
-
|
|
122
|
+
typeMirror?: Type;
|
|
123
|
+
error?: ParsingError;
|
|
104
124
|
}
|
|
105
125
|
|
|
106
126
|
export interface ParsingError {
|
|
107
|
-
|
|
127
|
+
message: string;
|
|
108
128
|
}
|
|
109
129
|
|
|
110
130
|
// Types
|
|
@@ -113,42 +133,42 @@ type TypeName = 'class' | 'interface' | 'enum';
|
|
|
113
133
|
export type Type = InterfaceMirror | ClassMirror | EnumMirror;
|
|
114
134
|
|
|
115
135
|
export interface EnumMirror {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
136
|
+
annotations: Annotation[];
|
|
137
|
+
name: string;
|
|
138
|
+
type_name: TypeName;
|
|
139
|
+
access_modifier: string;
|
|
140
|
+
docComment?: DocComment;
|
|
141
|
+
group?: string;
|
|
122
142
|
}
|
|
123
143
|
|
|
124
144
|
export interface InterfaceMirror {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
annotations: Annotation[];
|
|
146
|
+
name: string;
|
|
147
|
+
type_name: TypeName;
|
|
148
|
+
methods: MethodMirror[];
|
|
149
|
+
extended_interfaces: string[];
|
|
150
|
+
access_modifier: string;
|
|
151
|
+
docComment?: DocComment;
|
|
152
|
+
sharingModifier?: string;
|
|
153
|
+
group?: string;
|
|
134
154
|
}
|
|
135
155
|
|
|
136
156
|
export interface ClassMirror {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
annotations: Annotation[];
|
|
158
|
+
name: string;
|
|
159
|
+
type_name: TypeName;
|
|
160
|
+
methods: MethodMirror[];
|
|
161
|
+
sharingModifier?: string;
|
|
162
|
+
classModifier?: string;
|
|
163
|
+
extended_class?: string;
|
|
164
|
+
implemented_interfaces: string[];
|
|
165
|
+
properties: PropertyMirror[];
|
|
166
|
+
fields: FieldMirror[];
|
|
167
|
+
constructors: ConstructorMirror[];
|
|
168
|
+
enums: EnumMirror[];
|
|
169
|
+
interfaces: InterfaceMirror[];
|
|
170
|
+
classes: ClassMirror[];
|
|
171
|
+
access_modifier: string;
|
|
172
|
+
docComment?: DocComment;
|
|
173
|
+
group?: string;
|
|
154
174
|
}
|