@cparra/apex-reflection 0.1.1-alpha.1 → 0.1.1-alpha.10
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 +256 -0
- package/coverage/clover.xml +12857 -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 +41126 -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 +24801 -0
- package/index.d.ts +118 -1
- package/index.js +8 -4
- package/index.ts +141 -0
- package/jest.config.js +11 -0
- package/out.js +13477 -25792
- package/package.json +22 -17
- package/tsconfig.json +5 -3
- package/dart2jsout.js +0 -25898
- package/dart2jsout.js.deps +0 -116
- package/dart2jsout.js.map +0 -16
- package/out.js.map +0 -16
- package/preamble.js +0 -125
package/index.d.ts
CHANGED
|
@@ -1 +1,118 @@
|
|
|
1
|
-
export function reflect(declarationBody: string):
|
|
1
|
+
export declare function reflect(declarationBody: string): ReflectionResult;
|
|
2
|
+
export interface ParamAnnotation {
|
|
3
|
+
bodyLines: string[];
|
|
4
|
+
paramName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ReturnAnnotation {
|
|
7
|
+
bodyLines: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface ExampleAnnotation {
|
|
10
|
+
bodyLines: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface ThrowsAnnotation {
|
|
13
|
+
bodyLines: string[];
|
|
14
|
+
exceptionName: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DocCommentAnnotation {
|
|
17
|
+
name: string;
|
|
18
|
+
bodyLines: string[];
|
|
19
|
+
body: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DocComment {
|
|
22
|
+
rawDeclaration?: string;
|
|
23
|
+
paramAnnotations: ParamAnnotation[];
|
|
24
|
+
returnAnnotation: ReturnAnnotation;
|
|
25
|
+
exampleAnnotation: ExampleAnnotation;
|
|
26
|
+
throwsAnnotations: ThrowsAnnotation[];
|
|
27
|
+
annotations: DocCommentAnnotation[];
|
|
28
|
+
descriptionLines: string[];
|
|
29
|
+
description: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Annotation {
|
|
32
|
+
rawDeclaration: string;
|
|
33
|
+
name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ParameterMirror {
|
|
37
|
+
memberModifiers: string[];
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
docComment?: DocComment;
|
|
41
|
+
}
|
|
42
|
+
export interface MethodMirror {
|
|
43
|
+
access_modifier: string;
|
|
44
|
+
annotations: Annotation[];
|
|
45
|
+
name: string;
|
|
46
|
+
memberModifiers: string[];
|
|
47
|
+
type: string;
|
|
48
|
+
parameters: ParameterMirror[];
|
|
49
|
+
docComment?: DocComment;
|
|
50
|
+
}
|
|
51
|
+
export interface PropertyMirror {
|
|
52
|
+
access_modifier: string;
|
|
53
|
+
annotations: Annotation[];
|
|
54
|
+
name: string;
|
|
55
|
+
memberModifiers: string[];
|
|
56
|
+
type: string;
|
|
57
|
+
docComment?: DocComment;
|
|
58
|
+
}
|
|
59
|
+
export interface FieldMirror {
|
|
60
|
+
access_modifier: string;
|
|
61
|
+
annotations: Annotation[];
|
|
62
|
+
name: string;
|
|
63
|
+
memberModifiers: string[];
|
|
64
|
+
type: string;
|
|
65
|
+
docComment?: DocComment;
|
|
66
|
+
}
|
|
67
|
+
export interface ConstructorMirror {
|
|
68
|
+
access_modifier: string;
|
|
69
|
+
annotations: Annotation[];
|
|
70
|
+
parameters: ParameterMirror[];
|
|
71
|
+
docComment?: DocComment;
|
|
72
|
+
}
|
|
73
|
+
export interface ReflectionResult {
|
|
74
|
+
typeMirror?: Type;
|
|
75
|
+
error?: ParsingError;
|
|
76
|
+
}
|
|
77
|
+
export interface ParsingError {
|
|
78
|
+
message: string;
|
|
79
|
+
}
|
|
80
|
+
declare type TypeName = 'class' | 'interface' | 'enum';
|
|
81
|
+
export declare type Type = InterfaceMirror | ClassMirror | EnumMirror;
|
|
82
|
+
export interface EnumMirror {
|
|
83
|
+
annotations: Annotation[];
|
|
84
|
+
name: string;
|
|
85
|
+
type_name: TypeName;
|
|
86
|
+
access_modifier: string;
|
|
87
|
+
docComment?: DocComment;
|
|
88
|
+
}
|
|
89
|
+
export interface InterfaceMirror {
|
|
90
|
+
annotations: Annotation[];
|
|
91
|
+
name: string;
|
|
92
|
+
type_name: TypeName;
|
|
93
|
+
methods: MethodMirror[];
|
|
94
|
+
extended_interfaces: string[];
|
|
95
|
+
access_modifier: string;
|
|
96
|
+
docComment?: DocComment;
|
|
97
|
+
sharingModifier?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface ClassMirror {
|
|
100
|
+
string: any;
|
|
101
|
+
annotations: Annotation[];
|
|
102
|
+
name: string;
|
|
103
|
+
type_name: TypeName;
|
|
104
|
+
methods: MethodMirror[];
|
|
105
|
+
sharingModifier?: string;
|
|
106
|
+
classModifier?: string;
|
|
107
|
+
extended_class?: string;
|
|
108
|
+
implemented_interfaces: string[];
|
|
109
|
+
properties: PropertyMirror[];
|
|
110
|
+
fields: FieldMirror[];
|
|
111
|
+
constructors: ConstructorMirror[];
|
|
112
|
+
enums: EnumMirror[];
|
|
113
|
+
interfaces: InterfaceMirror[];
|
|
114
|
+
classes: ClassMirror[];
|
|
115
|
+
access_modifier: string;
|
|
116
|
+
docComment?: DocComment;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
package/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.reflect = void 0;
|
|
4
|
+
var lib = require('./out');
|
|
5
|
+
function reflect(declarationBody) {
|
|
6
|
+
return JSON.parse(lib.reflect(declarationBody));
|
|
7
|
+
}
|
|
8
|
+
exports.reflect = reflect;
|
package/index.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Annotation {
|
|
43
|
+
rawDeclaration: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ParameterMirror {
|
|
49
|
+
memberModifiers: string[];
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
docComment?: DocComment;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface MethodMirror {
|
|
56
|
+
access_modifier: string;
|
|
57
|
+
annotations: Annotation[];
|
|
58
|
+
name: string;
|
|
59
|
+
memberModifiers: string[];
|
|
60
|
+
type: string;
|
|
61
|
+
parameters: ParameterMirror[];
|
|
62
|
+
docComment?: DocComment;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface PropertyMirror {
|
|
66
|
+
access_modifier: string;
|
|
67
|
+
annotations: Annotation[];
|
|
68
|
+
name: string;
|
|
69
|
+
memberModifiers: string[];
|
|
70
|
+
type: string;
|
|
71
|
+
docComment?: DocComment;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface FieldMirror {
|
|
75
|
+
access_modifier: string;
|
|
76
|
+
annotations: Annotation[];
|
|
77
|
+
name: string;
|
|
78
|
+
memberModifiers: string[];
|
|
79
|
+
type: string;
|
|
80
|
+
docComment?: DocComment;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ConstructorMirror {
|
|
84
|
+
access_modifier: string;
|
|
85
|
+
annotations: Annotation[];
|
|
86
|
+
parameters: ParameterMirror[];
|
|
87
|
+
docComment?: DocComment;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface ReflectionResult {
|
|
91
|
+
typeMirror?: Type;
|
|
92
|
+
error?: ParsingError;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ParsingError {
|
|
96
|
+
message: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Types
|
|
100
|
+
|
|
101
|
+
type TypeName = 'class' | 'interface' | 'enum';
|
|
102
|
+
export type Type = InterfaceMirror | ClassMirror | EnumMirror;
|
|
103
|
+
|
|
104
|
+
export interface EnumMirror {
|
|
105
|
+
annotations: Annotation[];
|
|
106
|
+
name: string;
|
|
107
|
+
type_name: TypeName;
|
|
108
|
+
access_modifier: string;
|
|
109
|
+
docComment?: DocComment;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface InterfaceMirror {
|
|
113
|
+
annotations: Annotation[];
|
|
114
|
+
name: string;
|
|
115
|
+
type_name: TypeName;
|
|
116
|
+
methods: MethodMirror[];
|
|
117
|
+
extended_interfaces: string[];
|
|
118
|
+
access_modifier: string;
|
|
119
|
+
docComment?: DocComment;
|
|
120
|
+
sharingModifier?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface ClassMirror {
|
|
124
|
+
string;
|
|
125
|
+
annotations: Annotation[];
|
|
126
|
+
name: string;
|
|
127
|
+
type_name: TypeName;
|
|
128
|
+
methods: MethodMirror[];
|
|
129
|
+
sharingModifier?: string;
|
|
130
|
+
classModifier?: string;
|
|
131
|
+
extended_class?: string;
|
|
132
|
+
implemented_interfaces: string[];
|
|
133
|
+
properties: PropertyMirror[];
|
|
134
|
+
fields: FieldMirror[];
|
|
135
|
+
constructors: ConstructorMirror[];
|
|
136
|
+
enums: EnumMirror[];
|
|
137
|
+
interfaces: InterfaceMirror[];
|
|
138
|
+
classes: ClassMirror[];
|
|
139
|
+
access_modifier: string;
|
|
140
|
+
docComment?: DocComment;
|
|
141
|
+
}
|
package/jest.config.js
ADDED