@cparra/apex-reflection 2.0.2 → 2.1.1
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 +25 -0
- package/index.d.ts +7 -0
- package/index.ts +7 -0
- package/out.js +5215 -5168
- package/package.json +1 -1
|
@@ -294,4 +294,29 @@ describe('Class reflection', () => {
|
|
|
294
294
|
expect(result.classes[0].name).toBe('MyClass');
|
|
295
295
|
expect(result.classes[0].methods.length).toBe(2);
|
|
296
296
|
});
|
|
297
|
+
|
|
298
|
+
test('Can have members in groups', () => {
|
|
299
|
+
const classBody = `
|
|
300
|
+
public with sharing class MyClass {
|
|
301
|
+
/**
|
|
302
|
+
* @start-group Group Name
|
|
303
|
+
* @description Group Description
|
|
304
|
+
*/
|
|
305
|
+
public String Prop1 { get; set; }
|
|
306
|
+
public Integer Prop2 { get; set; }
|
|
307
|
+
/** @end-group */
|
|
308
|
+
}
|
|
309
|
+
`;
|
|
310
|
+
|
|
311
|
+
const result = (reflect(classBody)).typeMirror as ClassMirror;
|
|
312
|
+
expect(result.properties.length).toBe(2);
|
|
313
|
+
expect(result.properties[0].typeReference.type).toBe('String');
|
|
314
|
+
expect(result.properties[0].name).toBe('Prop1');
|
|
315
|
+
expect(result.properties[0].group).toBe('Group Name');
|
|
316
|
+
expect(result.properties[0].groupDescription).toBe('Group Description');
|
|
317
|
+
expect(result.properties[1].typeReference.type).toBe('Integer');
|
|
318
|
+
expect(result.properties[1].name).toBe('Prop2');
|
|
319
|
+
expect(result.properties[1].group).toBe('Group Name');
|
|
320
|
+
expect(result.properties[1].groupDescription).toBe('Group Description');
|
|
321
|
+
});
|
|
297
322
|
});
|
package/index.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export interface MethodMirror {
|
|
|
69
69
|
parameters: ParameterMirror[];
|
|
70
70
|
docComment?: DocComment;
|
|
71
71
|
group?: string;
|
|
72
|
+
groupDescription?: string;
|
|
72
73
|
}
|
|
73
74
|
export interface PropertyMirror {
|
|
74
75
|
access_modifier: string;
|
|
@@ -78,6 +79,7 @@ export interface PropertyMirror {
|
|
|
78
79
|
typeReference: ReferencedType;
|
|
79
80
|
docComment?: DocComment;
|
|
80
81
|
group?: string;
|
|
82
|
+
groupDescription?: string;
|
|
81
83
|
}
|
|
82
84
|
export interface FieldMirror {
|
|
83
85
|
access_modifier: string;
|
|
@@ -87,6 +89,7 @@ export interface FieldMirror {
|
|
|
87
89
|
typeReference: ReferencedType;
|
|
88
90
|
docComment?: DocComment;
|
|
89
91
|
group?: string;
|
|
92
|
+
groupDescription?: string;
|
|
90
93
|
}
|
|
91
94
|
export interface ConstructorMirror {
|
|
92
95
|
access_modifier: string;
|
|
@@ -94,6 +97,7 @@ export interface ConstructorMirror {
|
|
|
94
97
|
parameters: ParameterMirror[];
|
|
95
98
|
docComment?: DocComment;
|
|
96
99
|
group?: string;
|
|
100
|
+
groupDescription?: string;
|
|
97
101
|
}
|
|
98
102
|
export interface ReflectionResult {
|
|
99
103
|
typeMirror?: Type;
|
|
@@ -111,6 +115,7 @@ export interface EnumMirror {
|
|
|
111
115
|
access_modifier: string;
|
|
112
116
|
docComment?: DocComment;
|
|
113
117
|
group?: string;
|
|
118
|
+
groupDescription?: string;
|
|
114
119
|
}
|
|
115
120
|
export interface InterfaceMirror {
|
|
116
121
|
annotations: Annotation[];
|
|
@@ -122,6 +127,7 @@ export interface InterfaceMirror {
|
|
|
122
127
|
docComment?: DocComment;
|
|
123
128
|
sharingModifier?: string;
|
|
124
129
|
group?: string;
|
|
130
|
+
groupDescription?: string;
|
|
125
131
|
}
|
|
126
132
|
export interface ClassMirror {
|
|
127
133
|
annotations: Annotation[];
|
|
@@ -141,5 +147,6 @@ export interface ClassMirror {
|
|
|
141
147
|
access_modifier: string;
|
|
142
148
|
docComment?: DocComment;
|
|
143
149
|
group?: string;
|
|
150
|
+
groupDescription?: string;
|
|
144
151
|
}
|
|
145
152
|
export {};
|
package/index.ts
CHANGED
|
@@ -88,6 +88,7 @@ export interface MethodMirror {
|
|
|
88
88
|
parameters: ParameterMirror[];
|
|
89
89
|
docComment?: DocComment;
|
|
90
90
|
group?: string;
|
|
91
|
+
groupDescription?: string;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
export interface PropertyMirror {
|
|
@@ -98,6 +99,7 @@ export interface PropertyMirror {
|
|
|
98
99
|
typeReference: ReferencedType;
|
|
99
100
|
docComment?: DocComment;
|
|
100
101
|
group?: string;
|
|
102
|
+
groupDescription?: string;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
export interface FieldMirror {
|
|
@@ -108,6 +110,7 @@ export interface FieldMirror {
|
|
|
108
110
|
typeReference: ReferencedType;
|
|
109
111
|
docComment?: DocComment;
|
|
110
112
|
group?: string;
|
|
113
|
+
groupDescription?: string;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
export interface ConstructorMirror {
|
|
@@ -116,6 +119,7 @@ export interface ConstructorMirror {
|
|
|
116
119
|
parameters: ParameterMirror[];
|
|
117
120
|
docComment?: DocComment;
|
|
118
121
|
group?: string;
|
|
122
|
+
groupDescription?: string;
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
export interface ReflectionResult {
|
|
@@ -139,6 +143,7 @@ export interface EnumMirror {
|
|
|
139
143
|
access_modifier: string;
|
|
140
144
|
docComment?: DocComment;
|
|
141
145
|
group?: string;
|
|
146
|
+
groupDescription?: string;
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
export interface InterfaceMirror {
|
|
@@ -151,6 +156,7 @@ export interface InterfaceMirror {
|
|
|
151
156
|
docComment?: DocComment;
|
|
152
157
|
sharingModifier?: string;
|
|
153
158
|
group?: string;
|
|
159
|
+
groupDescription?: string;
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
export interface ClassMirror {
|
|
@@ -171,4 +177,5 @@ export interface ClassMirror {
|
|
|
171
177
|
access_modifier: string;
|
|
172
178
|
docComment?: DocComment;
|
|
173
179
|
group?: string;
|
|
180
|
+
groupDescription?: string;
|
|
174
181
|
}
|