@cparra/apex-reflection 1.10.3 → 2.0.0-alpha.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/index.d.ts CHANGED
@@ -39,10 +39,26 @@ 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
  type: string;
61
+ typeReference: ReferencedType;
46
62
  docComment?: DocComment;
47
63
  }
48
64
  export interface MethodMirror {
@@ -51,6 +67,7 @@ export interface MethodMirror {
51
67
  name: string;
52
68
  memberModifiers: string[];
53
69
  type: string;
70
+ typeReference: ReferencedType;
54
71
  parameters: ParameterMirror[];
55
72
  docComment?: DocComment;
56
73
  group?: string;
@@ -60,6 +77,7 @@ export interface PropertyMirror {
60
77
  annotations: Annotation[];
61
78
  name: string;
62
79
  memberModifiers: string[];
80
+ typeReference: ReferencedType;
63
81
  type: string;
64
82
  docComment?: DocComment;
65
83
  group?: string;
@@ -69,6 +87,7 @@ export interface FieldMirror {
69
87
  annotations: Annotation[];
70
88
  name: string;
71
89
  memberModifiers: string[];
90
+ typeReference: ReferencedType;
72
91
  type: string;
73
92
  docComment?: DocComment;
74
93
  group?: string;
package/index.ts CHANGED
@@ -1,110 +1,134 @@
1
1
  const lib = require('./out');
2
2
 
3
3
  export function reflect(declarationBody: string): ReflectionResult {
4
- return JSON.parse(lib.reflect(declarationBody)) as ReflectionResult;
4
+ return JSON.parse(lib.reflect(declarationBody)) as ReflectionResult;
5
5
  }
6
6
 
7
7
  export interface ParamAnnotation {
8
- bodyLines: string[];
9
- paramName: string;
8
+ bodyLines: string[];
9
+ paramName: string;
10
10
  }
11
11
 
12
12
  export interface ReturnAnnotation {
13
- bodyLines: string[];
13
+ bodyLines: string[];
14
14
  }
15
15
 
16
16
  export interface ExampleAnnotation {
17
- bodyLines: string[];
17
+ bodyLines: string[];
18
18
  }
19
19
 
20
20
  export interface ThrowsAnnotation {
21
- bodyLines: string[];
22
- exceptionName: string;
21
+ bodyLines: string[];
22
+ exceptionName: string;
23
23
  }
24
24
 
25
25
  export interface DocCommentAnnotation {
26
- name: string;
27
- bodyLines: string[];
28
- body: string;
26
+ name: string;
27
+ bodyLines: string[];
28
+ body: string;
29
29
  }
30
30
 
31
31
  export interface DocComment {
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;
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
- key: string;
45
- value: string;
44
+ key: string;
45
+ value: string;
46
46
  }
47
47
 
48
48
  export interface Annotation {
49
- rawDeclaration: string;
50
- name: string;
51
- type: string;
52
- elementValues?: AnnotationElementValue[];
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
- memberModifiers: string[];
57
- name: string;
58
- type: string;
59
- docComment?: DocComment;
76
+ memberModifiers: string[];
77
+ name: string;
78
+ type: string;
79
+ typeReference: ReferencedType;
80
+ docComment?: DocComment;
60
81
  }
61
82
 
62
83
  export interface MethodMirror {
63
- access_modifier: string;
64
- annotations: Annotation[];
65
- name: string;
66
- memberModifiers: string[];
67
- type: string;
68
- parameters: ParameterMirror[];
69
- docComment?: DocComment;
70
- group?: string;
84
+ access_modifier: string;
85
+ annotations: Annotation[];
86
+ name: string;
87
+ memberModifiers: string[];
88
+ type: string;
89
+ typeReference: ReferencedType;
90
+ parameters: ParameterMirror[];
91
+ docComment?: DocComment;
92
+ group?: string;
71
93
  }
72
94
 
73
95
  export interface PropertyMirror {
74
- access_modifier: string;
75
- annotations: Annotation[];
76
- name: string;
77
- memberModifiers: string[];
78
- type: string;
79
- docComment?: DocComment;
80
- group?: string;
96
+ access_modifier: string;
97
+ annotations: Annotation[];
98
+ name: string;
99
+ memberModifiers: string[];
100
+ typeReference: ReferencedType;
101
+ type: string;
102
+ docComment?: DocComment;
103
+ group?: string;
81
104
  }
82
105
 
83
106
  export interface FieldMirror {
84
- access_modifier: string;
85
- annotations: Annotation[];
86
- name: string;
87
- memberModifiers: string[];
88
- type: string;
89
- docComment?: DocComment;
90
- group?: string;
107
+ access_modifier: string;
108
+ annotations: Annotation[];
109
+ name: string;
110
+ memberModifiers: string[];
111
+ typeReference: ReferencedType;
112
+ type: string;
113
+ docComment?: DocComment;
114
+ group?: string;
91
115
  }
92
116
 
93
117
  export interface ConstructorMirror {
94
- access_modifier: string;
95
- annotations: Annotation[];
96
- parameters: ParameterMirror[];
97
- docComment?: DocComment;
98
- group?: string;
118
+ access_modifier: string;
119
+ annotations: Annotation[];
120
+ parameters: ParameterMirror[];
121
+ docComment?: DocComment;
122
+ group?: string;
99
123
  }
100
124
 
101
125
  export interface ReflectionResult {
102
- typeMirror?: Type;
103
- error?: ParsingError;
126
+ typeMirror?: Type;
127
+ error?: ParsingError;
104
128
  }
105
129
 
106
130
  export interface ParsingError {
107
- message: string;
131
+ message: string;
108
132
  }
109
133
 
110
134
  // Types
@@ -113,42 +137,42 @@ type TypeName = 'class' | 'interface' | 'enum';
113
137
  export type Type = InterfaceMirror | ClassMirror | EnumMirror;
114
138
 
115
139
  export interface EnumMirror {
116
- annotations: Annotation[];
117
- name: string;
118
- type_name: TypeName;
119
- access_modifier: string;
120
- docComment?: DocComment;
121
- group?: string;
140
+ annotations: Annotation[];
141
+ name: string;
142
+ type_name: TypeName;
143
+ access_modifier: string;
144
+ docComment?: DocComment;
145
+ group?: string;
122
146
  }
123
147
 
124
148
  export interface InterfaceMirror {
125
- annotations: Annotation[];
126
- name: string;
127
- type_name: TypeName;
128
- methods: MethodMirror[];
129
- extended_interfaces: string[];
130
- access_modifier: string;
131
- docComment?: DocComment;
132
- sharingModifier?: string;
133
- group?: string;
149
+ annotations: Annotation[];
150
+ name: string;
151
+ type_name: TypeName;
152
+ methods: MethodMirror[];
153
+ extended_interfaces: string[];
154
+ access_modifier: string;
155
+ docComment?: DocComment;
156
+ sharingModifier?: string;
157
+ group?: string;
134
158
  }
135
159
 
136
160
  export interface ClassMirror {
137
- annotations: Annotation[];
138
- name: string;
139
- type_name: TypeName;
140
- methods: MethodMirror[];
141
- sharingModifier?: string;
142
- classModifier?: string;
143
- extended_class?: string;
144
- implemented_interfaces: string[];
145
- properties: PropertyMirror[];
146
- fields: FieldMirror[];
147
- constructors: ConstructorMirror[];
148
- enums: EnumMirror[];
149
- interfaces: InterfaceMirror[];
150
- classes: ClassMirror[];
151
- access_modifier: string;
152
- docComment?: DocComment;
153
- group?: string;
161
+ annotations: Annotation[];
162
+ name: string;
163
+ type_name: TypeName;
164
+ methods: MethodMirror[];
165
+ sharingModifier?: string;
166
+ classModifier?: string;
167
+ extended_class?: string;
168
+ implemented_interfaces: string[];
169
+ properties: PropertyMirror[];
170
+ fields: FieldMirror[];
171
+ constructors: ConstructorMirror[];
172
+ enums: EnumMirror[];
173
+ interfaces: InterfaceMirror[];
174
+ classes: ClassMirror[];
175
+ access_modifier: string;
176
+ docComment?: DocComment;
177
+ group?: string;
154
178
  }