@cparra/apex-reflection 2.7.1 → 2.9.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.ts CHANGED
@@ -1,181 +1,187 @@
1
- const lib = require('./out');
2
-
3
- export function reflect(declarationBody: string): ReflectionResult {
4
- return JSON.parse(lib.reflect(declarationBody)) as ReflectionResult;
5
- }
6
-
7
- export interface ParamAnnotation {
8
- bodyLines: string[];
9
- paramName: string;
10
- }
11
-
12
- export interface ReturnAnnotation {
13
- bodyLines: string[];
14
- }
15
-
16
- export interface ExampleAnnotation {
17
- bodyLines: string[];
18
- }
19
-
20
- export interface ThrowsAnnotation {
21
- bodyLines: string[];
22
- exceptionName: string;
23
- }
24
-
25
- export interface DocCommentAnnotation {
26
- name: string;
27
- bodyLines: string[];
28
- body: string;
29
- }
30
-
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;
41
- }
42
-
43
- export interface AnnotationElementValue {
44
- key: string;
45
- value: string;
46
- }
47
-
48
- export interface Annotation {
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;
73
- }
74
-
75
- export interface ParameterMirror {
76
- memberModifiers: string[];
77
- name: string;
78
- typeReference: ReferencedType;
79
- docComment?: DocComment;
80
- }
81
-
82
- export interface MethodMirror {
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;
91
- groupDescription?: string;
92
- }
93
-
94
- export interface PropertyMirror {
95
- access_modifier: string;
96
- annotations: Annotation[];
97
- name: string;
98
- memberModifiers: string[];
99
- typeReference: ReferencedType;
100
- docComment?: DocComment;
101
- group?: string;
102
- groupDescription?: string;
103
- }
104
-
105
- export interface FieldMirror {
106
- access_modifier: string;
107
- annotations: Annotation[];
108
- name: string;
109
- memberModifiers: string[];
110
- typeReference: ReferencedType;
111
- docComment?: DocComment;
112
- group?: string;
113
- groupDescription?: string;
114
- }
115
-
116
- export interface ConstructorMirror {
117
- access_modifier: string;
118
- annotations: Annotation[];
119
- parameters: ParameterMirror[];
120
- docComment?: DocComment;
121
- group?: string;
122
- groupDescription?: string;
123
- }
124
-
125
- export interface ReflectionResult {
126
- typeMirror?: Type;
127
- error?: ParsingError;
128
- }
129
-
130
- export interface ParsingError {
131
- message: string;
132
- }
133
-
134
- // Types
135
-
136
- type TypeName = 'class' | 'interface' | 'enum';
137
- export type Type = InterfaceMirror | ClassMirror | EnumMirror;
138
-
139
- export interface EnumMirror {
140
- annotations: Annotation[];
141
- name: string;
142
- type_name: TypeName;
143
- access_modifier: string;
144
- docComment?: DocComment;
145
- group?: string;
146
- groupDescription?: string;
147
- }
148
-
149
- export interface InterfaceMirror {
150
- annotations: Annotation[];
151
- name: string;
152
- type_name: TypeName;
153
- methods: MethodMirror[];
154
- extended_interfaces: string[];
155
- access_modifier: string;
156
- docComment?: DocComment;
157
- sharingModifier?: string;
158
- group?: string;
159
- groupDescription?: string;
160
- }
161
-
162
- export interface ClassMirror {
163
- annotations: Annotation[];
164
- name: string;
165
- type_name: TypeName;
166
- methods: MethodMirror[];
167
- sharingModifier?: string;
168
- classModifier?: string;
169
- extended_class?: string;
170
- implemented_interfaces: string[];
171
- properties: PropertyMirror[];
172
- fields: FieldMirror[];
173
- constructors: ConstructorMirror[];
174
- enums: EnumMirror[];
175
- interfaces: InterfaceMirror[];
176
- classes: ClassMirror[];
177
- access_modifier: string;
178
- docComment?: DocComment;
179
- group?: string;
180
- groupDescription?: string;
181
- }
1
+ const lib = require('./out');
2
+
3
+ export function reflect(declarationBody: string): ReflectionResult {
4
+ return JSON.parse(lib.reflect(declarationBody)) as ReflectionResult;
5
+ }
6
+
7
+ export interface ParamAnnotation {
8
+ bodyLines: string[];
9
+ paramName: string;
10
+ }
11
+
12
+ export interface ReturnAnnotation {
13
+ bodyLines: string[];
14
+ }
15
+
16
+ export interface ExampleAnnotation {
17
+ bodyLines: string[];
18
+ }
19
+
20
+ export interface ThrowsAnnotation {
21
+ bodyLines: string[];
22
+ exceptionName: string;
23
+ }
24
+
25
+ export interface DocCommentAnnotation {
26
+ name: string;
27
+ bodyLines: string[];
28
+ body: string;
29
+ }
30
+
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;
41
+ }
42
+
43
+ export interface AnnotationElementValue {
44
+ key: string;
45
+ value: string;
46
+ }
47
+
48
+ export interface Annotation {
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;
73
+ }
74
+
75
+ export interface EnumValue {
76
+ name: string;
77
+ docComment?: DocComment;
78
+ }
79
+
80
+ export interface ParameterMirror {
81
+ memberModifiers: string[];
82
+ name: string;
83
+ typeReference: ReferencedType;
84
+ docComment?: DocComment;
85
+ }
86
+
87
+ export interface MethodMirror {
88
+ access_modifier: string;
89
+ annotations: Annotation[];
90
+ name: string;
91
+ memberModifiers: string[];
92
+ typeReference: ReferencedType;
93
+ parameters: ParameterMirror[];
94
+ docComment?: DocComment;
95
+ group?: string;
96
+ groupDescription?: string;
97
+ }
98
+
99
+ export interface PropertyMirror {
100
+ access_modifier: string;
101
+ annotations: Annotation[];
102
+ name: string;
103
+ memberModifiers: string[];
104
+ typeReference: ReferencedType;
105
+ docComment?: DocComment;
106
+ group?: string;
107
+ groupDescription?: string;
108
+ }
109
+
110
+ export interface FieldMirror {
111
+ access_modifier: string;
112
+ annotations: Annotation[];
113
+ name: string;
114
+ memberModifiers: string[];
115
+ typeReference: ReferencedType;
116
+ docComment?: DocComment;
117
+ group?: string;
118
+ groupDescription?: string;
119
+ }
120
+
121
+ export interface ConstructorMirror {
122
+ access_modifier: string;
123
+ annotations: Annotation[];
124
+ parameters: ParameterMirror[];
125
+ docComment?: DocComment;
126
+ group?: string;
127
+ groupDescription?: string;
128
+ }
129
+
130
+ export interface ReflectionResult {
131
+ typeMirror?: Type;
132
+ error?: ParsingError;
133
+ }
134
+
135
+ export interface ParsingError {
136
+ message: string;
137
+ }
138
+
139
+ // Types
140
+
141
+ type TypeName = 'class' | 'interface' | 'enum';
142
+ export type Type = InterfaceMirror | ClassMirror | EnumMirror;
143
+
144
+ export interface EnumMirror {
145
+ annotations: Annotation[];
146
+ name: string;
147
+ type_name: TypeName;
148
+ access_modifier: string;
149
+ docComment?: DocComment;
150
+ group?: string;
151
+ groupDescription?: string;
152
+ values: EnumValue[];
153
+ }
154
+
155
+ export interface InterfaceMirror {
156
+ annotations: Annotation[];
157
+ name: string;
158
+ type_name: TypeName;
159
+ methods: MethodMirror[];
160
+ extended_interfaces: string[];
161
+ access_modifier: string;
162
+ docComment?: DocComment;
163
+ sharingModifier?: string;
164
+ group?: string;
165
+ groupDescription?: string;
166
+ }
167
+
168
+ export interface ClassMirror {
169
+ annotations: Annotation[];
170
+ name: string;
171
+ type_name: TypeName;
172
+ methods: MethodMirror[];
173
+ sharingModifier?: string;
174
+ classModifier?: string;
175
+ extended_class?: string;
176
+ implemented_interfaces: string[];
177
+ properties: PropertyMirror[];
178
+ fields: FieldMirror[];
179
+ constructors: ConstructorMirror[];
180
+ enums: EnumMirror[];
181
+ interfaces: InterfaceMirror[];
182
+ classes: ClassMirror[];
183
+ access_modifier: string;
184
+ docComment?: DocComment;
185
+ group?: string;
186
+ groupDescription?: string;
187
+ }
package/jest.config.js CHANGED
@@ -1,11 +1,11 @@
1
- // eslint-disable-next-line no-undef
2
- module.exports = {
3
- roots: ["<rootDir>/."],
4
- testMatch: [
5
- "**/__tests__/**/*.+(ts|tsx|js)",
6
- "**/?(*.)+(spec|test).+(ts|tsx|js)",
7
- ],
8
- transform: {
9
- "^.+\\.(ts|tsx)$": "ts-jest",
10
- },
11
- };
1
+ // eslint-disable-next-line no-undef
2
+ module.exports = {
3
+ roots: ["<rootDir>/."],
4
+ testMatch: [
5
+ "**/__tests__/**/*.+(ts|tsx|js)",
6
+ "**/?(*.)+(spec|test).+(ts|tsx|js)",
7
+ ],
8
+ transform: {
9
+ "^.+\\.(ts|tsx)$": "ts-jest",
10
+ },
11
+ };