@teambit/typescript 0.0.965 → 0.0.967
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/dist/export-identifier.d.ts +5 -4
- package/dist/export-identifier.js +23 -4
- package/dist/export-identifier.js.map +1 -1
- package/dist/identifier-list.d.ts +7 -0
- package/dist/identifier-list.js +21 -0
- package/dist/identifier-list.js.map +1 -0
- package/dist/identifier.d.ts +9 -0
- package/dist/identifier.js +30 -0
- package/dist/identifier.js.map +1 -0
- package/dist/{preview-1674271762484.js → preview-1674617375675.js} +2 -2
- package/dist/schema-extractor-context.d.ts +40 -8
- package/dist/schema-extractor-context.js +243 -101
- package/dist/schema-extractor-context.js.map +1 -1
- package/dist/schema-transformer.d.ts +2 -2
- package/dist/schema-transformer.js.map +1 -1
- package/dist/transformers/array-type.d.ts +10 -0
- package/dist/transformers/array-type.js +38 -0
- package/dist/transformers/array-type.js.map +1 -0
- package/dist/transformers/binding-element.d.ts +2 -2
- package/dist/transformers/binding-element.js +7 -7
- package/dist/transformers/binding-element.js.map +1 -1
- package/dist/transformers/class-declaration.d.ts +2 -2
- package/dist/transformers/class-declaration.js +6 -20
- package/dist/transformers/class-declaration.js.map +1 -1
- package/dist/transformers/conditional-type.d.ts +10 -0
- package/dist/transformers/conditional-type.js +39 -0
- package/dist/transformers/conditional-type.js.map +1 -0
- package/dist/transformers/constructor.d.ts +10 -0
- package/dist/transformers/constructor.js +50 -0
- package/dist/transformers/constructor.js.map +1 -0
- package/dist/transformers/enum-declaration.d.ts +2 -2
- package/dist/transformers/enum-declaration.js +4 -4
- package/dist/transformers/enum-declaration.js.map +1 -1
- package/dist/transformers/{export-assignment-declaration.d.ts → export-assignment.d.ts} +7 -2
- package/dist/transformers/export-assignment.js +41 -0
- package/dist/transformers/export-assignment.js.map +1 -0
- package/dist/transformers/export-declaration.d.ts +2 -3
- package/dist/transformers/export-declaration.js +21 -10
- package/dist/transformers/export-declaration.js.map +1 -1
- package/dist/transformers/function-like.d.ts +11 -0
- package/dist/transformers/function-like.js +82 -0
- package/dist/transformers/function-like.js.map +1 -0
- package/dist/transformers/get-accessor.d.ts +10 -0
- package/dist/transformers/get-accessor.js +48 -0
- package/dist/transformers/get-accessor.js.map +1 -0
- package/dist/transformers/import-declaration.d.ts +10 -0
- package/dist/transformers/import-declaration.js +74 -0
- package/dist/transformers/import-declaration.js.map +1 -0
- package/dist/transformers/index-signature.d.ts +10 -0
- package/dist/transformers/index-signature.js +45 -0
- package/dist/transformers/index-signature.js.map +1 -0
- package/dist/transformers/index.d.ts +28 -3
- package/dist/transformers/index.js +337 -12
- package/dist/transformers/index.js.map +1 -1
- package/dist/transformers/indexed-access-type.d.ts +10 -0
- package/dist/transformers/indexed-access-type.js +37 -0
- package/dist/transformers/indexed-access-type.js.map +1 -0
- package/dist/transformers/interface-declaration.d.ts +2 -2
- package/dist/transformers/interface-declaration.js +6 -20
- package/dist/transformers/interface-declaration.js.map +1 -1
- package/dist/transformers/intersection-type.d.ts +10 -0
- package/dist/transformers/intersection-type.js +48 -0
- package/dist/transformers/intersection-type.js.map +1 -0
- package/dist/transformers/keyword-type.d.ts +13 -0
- package/dist/transformers/keyword-type.js +55 -0
- package/dist/transformers/keyword-type.js.map +1 -0
- package/dist/transformers/literal-type.d.ts +13 -0
- package/dist/transformers/literal-type.js +40 -0
- package/dist/transformers/literal-type.js.map +1 -0
- package/dist/transformers/named-tuple.d.ts +10 -0
- package/dist/transformers/named-tuple.js +38 -0
- package/dist/transformers/named-tuple.js.map +1 -0
- package/dist/transformers/parameter.d.ts +13 -0
- package/dist/transformers/parameter.js +112 -0
- package/dist/transformers/parameter.js.map +1 -0
- package/dist/transformers/parenthesized-type.d.ts +10 -0
- package/dist/transformers/parenthesized-type.js +36 -0
- package/dist/transformers/parenthesized-type.js.map +1 -0
- package/dist/transformers/property-declaration.d.ts +11 -0
- package/dist/transformers/property-declaration.js +57 -0
- package/dist/transformers/property-declaration.js.map +1 -0
- package/dist/transformers/set-accessor.d.ts +10 -0
- package/dist/transformers/set-accessor.js +45 -0
- package/dist/transformers/set-accessor.js.map +1 -0
- package/dist/transformers/source-file-transformer.d.ts +3 -2
- package/dist/transformers/source-file-transformer.js +44 -15
- package/dist/transformers/source-file-transformer.js.map +1 -1
- package/dist/transformers/template-literal-type-span.d.ts +10 -0
- package/dist/transformers/template-literal-type-span.js +37 -0
- package/dist/transformers/template-literal-type-span.js.map +1 -0
- package/dist/transformers/template-literal-type.d.ts +10 -0
- package/dist/transformers/template-literal-type.js +45 -0
- package/dist/transformers/template-literal-type.js.map +1 -0
- package/dist/transformers/this-type.d.ts +10 -0
- package/dist/transformers/this-type.js +35 -0
- package/dist/transformers/this-type.js.map +1 -0
- package/dist/transformers/tuple-type.d.ts +10 -0
- package/dist/transformers/tuple-type.js +47 -0
- package/dist/transformers/tuple-type.js.map +1 -0
- package/dist/transformers/type-alias.d.ts +2 -2
- package/dist/transformers/type-alias.js +5 -12
- package/dist/transformers/type-alias.js.map +1 -1
- package/dist/transformers/type-literal.d.ts +14 -0
- package/dist/transformers/type-literal.js +49 -0
- package/dist/transformers/type-literal.js.map +1 -0
- package/dist/transformers/type-operator.d.ts +14 -0
- package/dist/transformers/type-operator.js +52 -0
- package/dist/transformers/type-operator.js.map +1 -0
- package/dist/transformers/type-predicate.d.ts +10 -0
- package/dist/transformers/type-predicate.js +38 -0
- package/dist/transformers/type-predicate.js.map +1 -0
- package/dist/transformers/type-query.d.ts +13 -0
- package/dist/transformers/type-query.js +42 -0
- package/dist/transformers/type-query.js.map +1 -0
- package/dist/transformers/type-reference.d.ts +16 -0
- package/dist/transformers/type-reference.js +56 -0
- package/dist/transformers/type-reference.js.map +1 -0
- package/dist/transformers/union-type.d.ts +10 -0
- package/dist/transformers/union-type.js +48 -0
- package/dist/transformers/union-type.js.map +1 -0
- package/dist/transformers/utils/jsdoc-to-doc-schema.js +2 -10
- package/dist/transformers/utils/jsdoc-to-doc-schema.js.map +1 -1
- package/dist/transformers/variable-declaration.d.ts +2 -2
- package/dist/transformers/variable-declaration.js +11 -11
- package/dist/transformers/variable-declaration.js.map +1 -1
- package/dist/transformers/variable-statement.d.ts +2 -2
- package/dist/transformers/variable-statement.js +5 -5
- package/dist/transformers/variable-statement.js.map +1 -1
- package/dist/typescript.extractor.d.ts +10 -4
- package/dist/typescript.extractor.js +70 -17
- package/dist/typescript.extractor.js.map +1 -1
- package/dist/typescript.main.runtime.d.ts +4 -2
- package/dist/typescript.main.runtime.js +5 -11
- package/dist/typescript.main.runtime.js.map +1 -1
- package/package-tar/teambit-typescript-0.0.967.tgz +0 -0
- package/package.json +17 -17
- package/transformers/array-type.ts +21 -0
- package/transformers/binding-element.ts +2 -2
- package/transformers/class-declaration.ts +4 -6
- package/transformers/conditional-type.ts +23 -0
- package/transformers/constructor.ts +40 -0
- package/transformers/enum-declaration.ts +3 -3
- package/transformers/{export-assignment-declaration.ts → export-assignment.ts} +9 -3
- package/transformers/export-declaration.ts +35 -8
- package/transformers/function-like.ts +65 -0
- package/transformers/get-accessor.ts +24 -0
- package/transformers/import-declaration.ts +56 -0
- package/transformers/index-signature.ts +24 -0
- package/transformers/index.ts +28 -3
- package/transformers/indexed-access-type.ts +21 -0
- package/transformers/interface-declaration.ts +5 -7
- package/transformers/intersection-type.ts +25 -0
- package/transformers/keyword-type.ts +39 -0
- package/transformers/literal-type.ts +23 -0
- package/transformers/named-tuple.ts +22 -0
- package/transformers/parameter.ts +110 -0
- package/transformers/parenthesized-type.ts +20 -0
- package/transformers/property-declaration.ts +33 -0
- package/transformers/set-accessor.ts +25 -0
- package/transformers/source-file-transformer.ts +56 -24
- package/transformers/template-literal-type-span.ts +21 -0
- package/transformers/template-literal-type.ts +24 -0
- package/transformers/this-type.ts +19 -0
- package/transformers/tuple-type.ts +24 -0
- package/transformers/type-alias.ts +3 -4
- package/transformers/type-literal.ts +26 -0
- package/transformers/type-operator.ts +37 -0
- package/transformers/type-predicate.ts +22 -0
- package/transformers/type-query.ts +25 -0
- package/transformers/type-reference.ts +33 -0
- package/transformers/union-type.ts +25 -0
- package/transformers/utils/jsdoc-to-doc-schema.ts +2 -4
- package/transformers/variable-declaration.ts +7 -4
- package/transformers/variable-statement.ts +3 -3
- package/dist/export-list.d.ts +0 -6
- package/dist/export-list.js +0 -17
- package/dist/export-list.js.map +0 -1
- package/dist/transformers/export-assignment-declaration.js +0 -29
- package/dist/transformers/export-assignment-declaration.js.map +0 -1
- package/dist/transformers/function-declaration.d.ts +0 -11
- package/dist/transformers/function-declaration.js +0 -49
- package/dist/transformers/function-declaration.js.map +0 -1
- package/dist/transformers/utils/class-element-to-schema.d.ts +0 -4
- package/dist/transformers/utils/class-element-to-schema.js +0 -95
- package/dist/transformers/utils/class-element-to-schema.js.map +0 -1
- package/dist/transformers/utils/get-params.d.ts +0 -4
- package/dist/transformers/utils/get-params.js +0 -100
- package/dist/transformers/utils/get-params.js.map +0 -1
- package/dist/transformers/utils/to-function-like-schema.d.ts +0 -4
- package/dist/transformers/utils/to-function-like-schema.js +0 -58
- package/dist/transformers/utils/to-function-like-schema.js.map +0 -1
- package/dist/transformers/utils/type-element-to-schema.d.ts +0 -7
- package/dist/transformers/utils/type-element-to-schema.js +0 -106
- package/dist/transformers/utils/type-element-to-schema.js.map +0 -1
- package/dist/transformers/utils/type-node-to-schema.d.ts +0 -4
- package/dist/transformers/utils/type-node-to-schema.js +0 -274
- package/dist/transformers/utils/type-node-to-schema.js.map +0 -1
- package/package-tar/teambit-typescript-0.0.965.tgz +0 -0
- package/transformers/function-declaration.ts +0 -25
- package/transformers/utils/class-element-to-schema.ts +0 -64
- package/transformers/utils/get-params.ts +0 -92
- package/transformers/utils/to-function-like-schema.ts +0 -39
- package/transformers/utils/type-element-to-schema.ts +0 -79
- package/transformers/utils/type-node-to-schema.ts +0 -294
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "ArrayTypeTransformer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _arrayType().ArrayTypeTransformer;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "BindingElementTransformer", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -15,28 +21,64 @@ Object.defineProperty(exports, "ClassDeclarationTransformer", {
|
|
|
15
21
|
return _classDeclaration().ClassDeclarationTransformer;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "ConditionalTypeTransformer", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _conditionalType().ConditionalTypeTransformer;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "ConstructorTransformer", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _constructor().ConstructorTransformer;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
18
36
|
Object.defineProperty(exports, "EnumDeclarationTransformer", {
|
|
19
37
|
enumerable: true,
|
|
20
38
|
get: function () {
|
|
21
39
|
return _enumDeclaration().EnumDeclarationTransformer;
|
|
22
40
|
}
|
|
23
41
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "ExportAssignmentTransformer", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _exportAssignment().ExportAssignmentTransformer;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "ExportDeclarationTransformer", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _exportDeclaration().ExportDeclarationTransformer;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "FunctionLikeTransformer", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _functionLike().FunctionLikeTransformer;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "GetAccessorTransformer", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _getAccessor().GetAccessorTransformer;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "ImportDeclarationTransformer", {
|
|
25
67
|
enumerable: true,
|
|
26
68
|
get: function () {
|
|
27
|
-
return
|
|
69
|
+
return _importDeclaration().ImportDeclarationTransformer;
|
|
28
70
|
}
|
|
29
71
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
72
|
+
Object.defineProperty(exports, "IndexSignatureTransformer", {
|
|
31
73
|
enumerable: true,
|
|
32
74
|
get: function () {
|
|
33
|
-
return
|
|
75
|
+
return _indexSignature().IndexSignatureTransformer;
|
|
34
76
|
}
|
|
35
77
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
78
|
+
Object.defineProperty(exports, "IndexedAccessTypeTransformer", {
|
|
37
79
|
enumerable: true,
|
|
38
80
|
get: function () {
|
|
39
|
-
return
|
|
81
|
+
return _indexedAccessType().IndexedAccessTypeTransformer;
|
|
40
82
|
}
|
|
41
83
|
});
|
|
42
84
|
Object.defineProperty(exports, "InterfaceDeclarationTransformer", {
|
|
@@ -45,18 +87,126 @@ Object.defineProperty(exports, "InterfaceDeclarationTransformer", {
|
|
|
45
87
|
return _interfaceDeclaration().InterfaceDeclarationTransformer;
|
|
46
88
|
}
|
|
47
89
|
});
|
|
90
|
+
Object.defineProperty(exports, "IntersectionTypeTransformer", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _intersectionType().IntersectionTypeTransformer;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "KeywordTypeTransformer", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _keywordType().KeywordTypeTransformer;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "LiteralTypeTransformer", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _literalType().LiteralTypeTransformer;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "NamedTupleTransformer", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _namedTuple().NamedTupleTransformer;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "ParameterTransformer", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _parameter().ParameterTransformer;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "ParenthesizedTypeTransformer", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _parenthesizedType().ParenthesizedTypeTransformer;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "PropertyDeclarationTransformer", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _propertyDeclaration().PropertyDeclarationTransformer;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "SetAccessorTransformer", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _setAccessor().SetAccessorTransformer;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
48
138
|
Object.defineProperty(exports, "SourceFileTransformer", {
|
|
49
139
|
enumerable: true,
|
|
50
140
|
get: function () {
|
|
51
141
|
return _sourceFileTransformer().SourceFileTransformer;
|
|
52
142
|
}
|
|
53
143
|
});
|
|
144
|
+
Object.defineProperty(exports, "TemplateLiteralTypeSpanTransformer", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _templateLiteralTypeSpan().TemplateLiteralTypeSpanTransformer;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "TemplateLiteralTypeTransformer", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _templateLiteralType().TemplateLiteralTypeTransformer;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "ThisTypeTransformer", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _thisType().ThisTypeTransformer;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "TupleTypeTransformer", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _tupleType().TupleTypeTransformer;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
54
168
|
Object.defineProperty(exports, "TypeAliasTransformer", {
|
|
55
169
|
enumerable: true,
|
|
56
170
|
get: function () {
|
|
57
171
|
return _typeAlias().TypeAliasTransformer;
|
|
58
172
|
}
|
|
59
173
|
});
|
|
174
|
+
Object.defineProperty(exports, "TypeLiteralTransformer", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _typeLiteral().TypeLiteralTransformer;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "TypeOperatorTransformer", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _typeOperator().TypeOperatorTransformer;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "TypePredicateTransformer", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _typePredicate().TypePredicateTransformer;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "TypeQueryTransformer", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _typeQuery().TypeQueryTransformer;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "TypeReferenceTransformer", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _typeReference().TypeReferenceTransformer;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "UnionTypeTransformer", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _unionType().UnionTypeTransformer;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
60
210
|
Object.defineProperty(exports, "VariableDeclaration", {
|
|
61
211
|
enumerable: true,
|
|
62
212
|
get: function () {
|
|
@@ -76,9 +226,16 @@ function _exportDeclaration() {
|
|
|
76
226
|
};
|
|
77
227
|
return data;
|
|
78
228
|
}
|
|
79
|
-
function
|
|
80
|
-
const data = require("./function-
|
|
81
|
-
|
|
229
|
+
function _functionLike() {
|
|
230
|
+
const data = require("./function-like");
|
|
231
|
+
_functionLike = function () {
|
|
232
|
+
return data;
|
|
233
|
+
};
|
|
234
|
+
return data;
|
|
235
|
+
}
|
|
236
|
+
function _parameter() {
|
|
237
|
+
const data = require("./parameter");
|
|
238
|
+
_parameter = function () {
|
|
82
239
|
return data;
|
|
83
240
|
};
|
|
84
241
|
return data;
|
|
@@ -111,6 +268,132 @@ function _typeAlias() {
|
|
|
111
268
|
};
|
|
112
269
|
return data;
|
|
113
270
|
}
|
|
271
|
+
function _intersectionType() {
|
|
272
|
+
const data = require("./intersection-type");
|
|
273
|
+
_intersectionType = function () {
|
|
274
|
+
return data;
|
|
275
|
+
};
|
|
276
|
+
return data;
|
|
277
|
+
}
|
|
278
|
+
function _unionType() {
|
|
279
|
+
const data = require("./union-type");
|
|
280
|
+
_unionType = function () {
|
|
281
|
+
return data;
|
|
282
|
+
};
|
|
283
|
+
return data;
|
|
284
|
+
}
|
|
285
|
+
function _typeReference() {
|
|
286
|
+
const data = require("./type-reference");
|
|
287
|
+
_typeReference = function () {
|
|
288
|
+
return data;
|
|
289
|
+
};
|
|
290
|
+
return data;
|
|
291
|
+
}
|
|
292
|
+
function _typeLiteral() {
|
|
293
|
+
const data = require("./type-literal");
|
|
294
|
+
_typeLiteral = function () {
|
|
295
|
+
return data;
|
|
296
|
+
};
|
|
297
|
+
return data;
|
|
298
|
+
}
|
|
299
|
+
function _literalType() {
|
|
300
|
+
const data = require("./literal-type");
|
|
301
|
+
_literalType = function () {
|
|
302
|
+
return data;
|
|
303
|
+
};
|
|
304
|
+
return data;
|
|
305
|
+
}
|
|
306
|
+
function _typeQuery() {
|
|
307
|
+
const data = require("./type-query");
|
|
308
|
+
_typeQuery = function () {
|
|
309
|
+
return data;
|
|
310
|
+
};
|
|
311
|
+
return data;
|
|
312
|
+
}
|
|
313
|
+
function _typeOperator() {
|
|
314
|
+
const data = require("./type-operator");
|
|
315
|
+
_typeOperator = function () {
|
|
316
|
+
return data;
|
|
317
|
+
};
|
|
318
|
+
return data;
|
|
319
|
+
}
|
|
320
|
+
function _keywordType() {
|
|
321
|
+
const data = require("./keyword-type");
|
|
322
|
+
_keywordType = function () {
|
|
323
|
+
return data;
|
|
324
|
+
};
|
|
325
|
+
return data;
|
|
326
|
+
}
|
|
327
|
+
function _tupleType() {
|
|
328
|
+
const data = require("./tuple-type");
|
|
329
|
+
_tupleType = function () {
|
|
330
|
+
return data;
|
|
331
|
+
};
|
|
332
|
+
return data;
|
|
333
|
+
}
|
|
334
|
+
function _parenthesizedType() {
|
|
335
|
+
const data = require("./parenthesized-type");
|
|
336
|
+
_parenthesizedType = function () {
|
|
337
|
+
return data;
|
|
338
|
+
};
|
|
339
|
+
return data;
|
|
340
|
+
}
|
|
341
|
+
function _typePredicate() {
|
|
342
|
+
const data = require("./type-predicate");
|
|
343
|
+
_typePredicate = function () {
|
|
344
|
+
return data;
|
|
345
|
+
};
|
|
346
|
+
return data;
|
|
347
|
+
}
|
|
348
|
+
function _indexedAccessType() {
|
|
349
|
+
const data = require("./indexed-access-type");
|
|
350
|
+
_indexedAccessType = function () {
|
|
351
|
+
return data;
|
|
352
|
+
};
|
|
353
|
+
return data;
|
|
354
|
+
}
|
|
355
|
+
function _templateLiteralTypeSpan() {
|
|
356
|
+
const data = require("./template-literal-type-span");
|
|
357
|
+
_templateLiteralTypeSpan = function () {
|
|
358
|
+
return data;
|
|
359
|
+
};
|
|
360
|
+
return data;
|
|
361
|
+
}
|
|
362
|
+
function _templateLiteralType() {
|
|
363
|
+
const data = require("./template-literal-type");
|
|
364
|
+
_templateLiteralType = function () {
|
|
365
|
+
return data;
|
|
366
|
+
};
|
|
367
|
+
return data;
|
|
368
|
+
}
|
|
369
|
+
function _thisType() {
|
|
370
|
+
const data = require("./this-type");
|
|
371
|
+
_thisType = function () {
|
|
372
|
+
return data;
|
|
373
|
+
};
|
|
374
|
+
return data;
|
|
375
|
+
}
|
|
376
|
+
function _conditionalType() {
|
|
377
|
+
const data = require("./conditional-type");
|
|
378
|
+
_conditionalType = function () {
|
|
379
|
+
return data;
|
|
380
|
+
};
|
|
381
|
+
return data;
|
|
382
|
+
}
|
|
383
|
+
function _namedTuple() {
|
|
384
|
+
const data = require("./named-tuple");
|
|
385
|
+
_namedTuple = function () {
|
|
386
|
+
return data;
|
|
387
|
+
};
|
|
388
|
+
return data;
|
|
389
|
+
}
|
|
390
|
+
function _arrayType() {
|
|
391
|
+
const data = require("./array-type");
|
|
392
|
+
_arrayType = function () {
|
|
393
|
+
return data;
|
|
394
|
+
};
|
|
395
|
+
return data;
|
|
396
|
+
}
|
|
114
397
|
function _classDeclaration() {
|
|
115
398
|
const data = require("./class-declaration");
|
|
116
399
|
_classDeclaration = function () {
|
|
@@ -118,6 +401,41 @@ function _classDeclaration() {
|
|
|
118
401
|
};
|
|
119
402
|
return data;
|
|
120
403
|
}
|
|
404
|
+
function _constructor() {
|
|
405
|
+
const data = require("./constructor");
|
|
406
|
+
_constructor = function () {
|
|
407
|
+
return data;
|
|
408
|
+
};
|
|
409
|
+
return data;
|
|
410
|
+
}
|
|
411
|
+
function _propertyDeclaration() {
|
|
412
|
+
const data = require("./property-declaration");
|
|
413
|
+
_propertyDeclaration = function () {
|
|
414
|
+
return data;
|
|
415
|
+
};
|
|
416
|
+
return data;
|
|
417
|
+
}
|
|
418
|
+
function _setAccessor() {
|
|
419
|
+
const data = require("./set-accessor");
|
|
420
|
+
_setAccessor = function () {
|
|
421
|
+
return data;
|
|
422
|
+
};
|
|
423
|
+
return data;
|
|
424
|
+
}
|
|
425
|
+
function _getAccessor() {
|
|
426
|
+
const data = require("./get-accessor");
|
|
427
|
+
_getAccessor = function () {
|
|
428
|
+
return data;
|
|
429
|
+
};
|
|
430
|
+
return data;
|
|
431
|
+
}
|
|
432
|
+
function _indexSignature() {
|
|
433
|
+
const data = require("./index-signature");
|
|
434
|
+
_indexSignature = function () {
|
|
435
|
+
return data;
|
|
436
|
+
};
|
|
437
|
+
return data;
|
|
438
|
+
}
|
|
121
439
|
function _interfaceDeclaration() {
|
|
122
440
|
const data = require("./interface-declaration");
|
|
123
441
|
_interfaceDeclaration = function () {
|
|
@@ -139,9 +457,16 @@ function _bindingElement() {
|
|
|
139
457
|
};
|
|
140
458
|
return data;
|
|
141
459
|
}
|
|
142
|
-
function
|
|
143
|
-
const data = require("./export-assignment
|
|
144
|
-
|
|
460
|
+
function _exportAssignment() {
|
|
461
|
+
const data = require("./export-assignment");
|
|
462
|
+
_exportAssignment = function () {
|
|
463
|
+
return data;
|
|
464
|
+
};
|
|
465
|
+
return data;
|
|
466
|
+
}
|
|
467
|
+
function _importDeclaration() {
|
|
468
|
+
const data = require("./import-declaration");
|
|
469
|
+
_importDeclaration = function () {
|
|
145
470
|
return data;
|
|
146
471
|
};
|
|
147
472
|
return data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ExportDeclarationTransformer } from './export-declaration';\nexport { FunctionLikeTransformer } from './function-like';\nexport { ParameterTransformer } from './parameter';\nexport { VariableStatementTransformer } from './variable-statement';\nexport { VariableDeclaration } from './variable-declaration';\nexport { SourceFileTransformer } from './source-file-transformer';\nexport { TypeAliasTransformer } from './type-alias';\nexport { IntersectionTypeTransformer } from './intersection-type';\nexport { UnionTypeTransformer } from './union-type';\nexport { TypeReferenceTransformer } from './type-reference';\nexport { TypeLiteralTransformer } from './type-literal';\nexport { LiteralTypeTransformer } from './literal-type';\nexport { TypeQueryTransformer } from './type-query';\nexport { TypeOperatorTransformer } from './type-operator';\nexport { KeywordTypeTransformer } from './keyword-type';\nexport { TupleTypeTransformer } from './tuple-type';\nexport { ParenthesizedTypeTransformer } from './parenthesized-type';\nexport { TypePredicateTransformer } from './type-predicate';\nexport { IndexedAccessTypeTransformer } from './indexed-access-type';\nexport { TemplateLiteralTypeSpanTransformer } from './template-literal-type-span';\nexport { TemplateLiteralTypeTransformer } from './template-literal-type';\nexport { ThisTypeTransformer } from './this-type';\nexport { ConditionalTypeTransformer } from './conditional-type';\nexport { NamedTupleTransformer } from './named-tuple';\nexport { ArrayTypeTransformer } from './array-type';\nexport { ClassDeclarationTransformer } from './class-declaration';\nexport { ConstructorTransformer } from './constructor';\nexport { PropertyDeclarationTransformer } from './property-declaration';\nexport { SetAccessorTransformer } from './set-accessor';\nexport { GetAccessorTransformer } from './get-accessor';\nexport { IndexSignatureTransformer } from './index-signature';\nexport { InterfaceDeclarationTransformer } from './interface-declaration';\nexport { EnumDeclarationTransformer } from './enum-declaration';\nexport { BindingElementTransformer } from './binding-element';\nexport { ExportAssignmentTransformer } from './export-assignment';\nexport { ImportDeclarationTransformer } from './import-declaration';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IndexedAccessTypeNode, Node } from 'typescript';
|
|
2
|
+
import { IndexedAccessSchema } from '@teambit/semantics.entities.semantic-schema';
|
|
3
|
+
import { SchemaTransformer } from '../schema-transformer';
|
|
4
|
+
import { SchemaExtractorContext } from '../schema-extractor-context';
|
|
5
|
+
import { Identifier } from '../identifier';
|
|
6
|
+
export declare class IndexedAccessTypeTransformer implements SchemaTransformer {
|
|
7
|
+
predicate(node: Node): boolean;
|
|
8
|
+
getIdentifiers(): Promise<Identifier[]>;
|
|
9
|
+
transform(node: IndexedAccessTypeNode, context: SchemaExtractorContext): Promise<IndexedAccessSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.promise.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.IndexedAccessTypeTransformer = void 0;
|
|
8
|
+
function _typescript() {
|
|
9
|
+
const data = require("typescript");
|
|
10
|
+
_typescript = function () {
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
15
|
+
function _semanticsEntities() {
|
|
16
|
+
const data = require("@teambit/semantics.entities.semantic-schema");
|
|
17
|
+
_semanticsEntities = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
class IndexedAccessTypeTransformer {
|
|
23
|
+
predicate(node) {
|
|
24
|
+
return node.kind === _typescript().SyntaxKind.IndexedAccessType;
|
|
25
|
+
}
|
|
26
|
+
async getIdentifiers() {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
async transform(node, context) {
|
|
30
|
+
const objectType = await context.computeSchema(node.objectType);
|
|
31
|
+
const indexType = await context.computeSchema(node.indexType);
|
|
32
|
+
return new (_semanticsEntities().IndexedAccessSchema)(context.getLocation(node), objectType, indexType);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.IndexedAccessTypeTransformer = IndexedAccessTypeTransformer;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=indexed-access-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IndexedAccessTypeTransformer","predicate","node","kind","SyntaxKind","IndexedAccessType","getIdentifiers","transform","context","objectType","computeSchema","indexType","IndexedAccessSchema","getLocation"],"sources":["indexed-access-type.ts"],"sourcesContent":["import { IndexedAccessTypeNode, Node, SyntaxKind } from 'typescript';\nimport { IndexedAccessSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexedAccessTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.IndexedAccessType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexedAccessTypeNode, context: SchemaExtractorContext) {\n const objectType = await context.computeSchema(node.objectType);\n const indexType = await context.computeSchema(node.indexType);\n return new IndexedAccessSchema(context.getLocation(node), objectType, indexType);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKO,MAAMA,4BAA4B,CAA8B;EACrEC,SAAS,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,iBAAiB;EACnD;EAEA,MAAMC,cAAc,GAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAAS,CAACL,IAA2B,EAAEM,OAA+B,EAAE;IAC5E,MAAMC,UAAU,GAAG,MAAMD,OAAO,CAACE,aAAa,CAACR,IAAI,CAACO,UAAU,CAAC;IAC/D,MAAME,SAAS,GAAG,MAAMH,OAAO,CAACE,aAAa,CAACR,IAAI,CAACS,SAAS,CAAC;IAC7D,OAAO,KAAIC,wCAAmB,EAACJ,OAAO,CAACK,WAAW,CAACX,IAAI,CAAC,EAAEO,UAAU,EAAEE,SAAS,CAAC;EAClF;AACF;AAAC"}
|
|
@@ -2,10 +2,10 @@ import { Node, InterfaceDeclaration } from 'typescript';
|
|
|
2
2
|
import { InterfaceSchema } from '@teambit/semantics.entities.semantic-schema';
|
|
3
3
|
import { SchemaTransformer } from '../schema-transformer';
|
|
4
4
|
import { SchemaExtractorContext } from '../schema-extractor-context';
|
|
5
|
-
import {
|
|
5
|
+
import { Identifier } from '../identifier';
|
|
6
6
|
export declare class InterfaceDeclarationTransformer implements SchemaTransformer {
|
|
7
7
|
predicate(node: Node): boolean;
|
|
8
|
-
getIdentifiers(node: InterfaceDeclaration): Promise<
|
|
8
|
+
getIdentifiers(node: InterfaceDeclaration): Promise<Identifier[]>;
|
|
9
9
|
private getExpressionWithTypeArgs;
|
|
10
10
|
transform(interfaceDec: InterfaceDeclaration, context: SchemaExtractorContext): Promise<InterfaceSchema>;
|
|
11
11
|
}
|
|
@@ -36,23 +36,9 @@ function _semanticsEntities() {
|
|
|
36
36
|
};
|
|
37
37
|
return data;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const data = require("../
|
|
41
|
-
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
return data;
|
|
45
|
-
}
|
|
46
|
-
function _typeElementToSchema() {
|
|
47
|
-
const data = require("./utils/type-element-to-schema");
|
|
48
|
-
_typeElementToSchema = function () {
|
|
49
|
-
return data;
|
|
50
|
-
};
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
function _typeNodeToSchema() {
|
|
54
|
-
const data = require("./utils/type-node-to-schema");
|
|
55
|
-
_typeNodeToSchema = function () {
|
|
39
|
+
function _identifier() {
|
|
40
|
+
const data = require("../identifier");
|
|
41
|
+
_identifier = function () {
|
|
56
42
|
return data;
|
|
57
43
|
};
|
|
58
44
|
return data;
|
|
@@ -64,7 +50,7 @@ class InterfaceDeclarationTransformer {
|
|
|
64
50
|
return node.kind === _typescript().SyntaxKind.InterfaceDeclaration;
|
|
65
51
|
}
|
|
66
52
|
async getIdentifiers(node) {
|
|
67
|
-
return [new (
|
|
53
|
+
return [new (_identifier().Identifier)(node.name.getText(), node.getSourceFile().fileName)];
|
|
68
54
|
}
|
|
69
55
|
async getExpressionWithTypeArgs(node, context) {
|
|
70
56
|
if (!node.heritageClauses) return [];
|
|
@@ -82,7 +68,7 @@ class InterfaceDeclarationTransformer {
|
|
|
82
68
|
expression,
|
|
83
69
|
name
|
|
84
70
|
} = expressionWithTypeArgs;
|
|
85
|
-
const typeArgsNodes = typeArguments ? await (0, _pMapSeries().default)(typeArguments, t =>
|
|
71
|
+
const typeArgsNodes = typeArguments ? await (0, _pMapSeries().default)(typeArguments, t => context.computeSchema(t)) : [];
|
|
86
72
|
const location = context.getLocation(expression);
|
|
87
73
|
const expressionNode = (await context.visitDefinition(expression)) || new (_semanticsEntities().UnresolvedSchema)(location, expression.getText());
|
|
88
74
|
return new (_semanticsEntities().ExpressionWithTypeArgumentsSchema)(typeArgsNodes, expressionNode, name, location);
|
|
@@ -90,7 +76,7 @@ class InterfaceDeclarationTransformer {
|
|
|
90
76
|
}
|
|
91
77
|
async transform(interfaceDec, context) {
|
|
92
78
|
var _interfaceDec$typePar;
|
|
93
|
-
const members = await (0, _pMapSeries().default)(interfaceDec.members, member =>
|
|
79
|
+
const members = await (0, _pMapSeries().default)(interfaceDec.members, member => context.computeSchema(member));
|
|
94
80
|
const doc = await context.jsDocToDocSchema(interfaceDec);
|
|
95
81
|
const signature = interfaceDec.name ? await context.getQuickInfoDisplayString(interfaceDec.name) : undefined;
|
|
96
82
|
const extendsNodes = await this.getExpressionWithTypeArgs(interfaceDec, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InterfaceDeclarationTransformer","predicate","node","kind","SyntaxKind","InterfaceDeclaration","getIdentifiers","
|
|
1
|
+
{"version":3,"names":["InterfaceDeclarationTransformer","predicate","node","kind","SyntaxKind","InterfaceDeclaration","getIdentifiers","Identifier","name","getText","getSourceFile","fileName","getExpressionWithTypeArgs","context","heritageClauses","pMapSeries","filter","heritageClause","token","ExtendsKeyword","flatMap","h","types","map","type","expressionWithTypeArgs","typeArguments","expression","typeArgsNodes","t","computeSchema","location","getLocation","expressionNode","visitDefinition","UnresolvedSchema","ExpressionWithTypeArgumentsSchema","transform","interfaceDec","members","member","doc","jsDocToDocSchema","signature","getQuickInfoDisplayString","undefined","extendsNodes","typeParameters","typeParam","Error","InterfaceSchema"],"sources":["interface-declaration.ts"],"sourcesContent":["import ts, { Node, InterfaceDeclaration, SyntaxKind } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport {\n ExpressionWithTypeArgumentsSchema,\n InterfaceSchema,\n UnresolvedSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class InterfaceDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.InterfaceDeclaration;\n }\n\n async getIdentifiers(node: InterfaceDeclaration): Promise<Identifier[]> {\n return [new Identifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private async getExpressionWithTypeArgs(node: InterfaceDeclaration, context: SchemaExtractorContext) {\n if (!node.heritageClauses) return [];\n\n return pMapSeries(\n node.heritageClauses\n .filter((heritageClause: ts.HeritageClause) => heritageClause.token === SyntaxKind.ExtendsKeyword)\n .flatMap((h: ts.HeritageClause) => {\n const { types } = h;\n const name = h.getText();\n return types.map((type) => ({ ...type, name }));\n }),\n async (expressionWithTypeArgs: ts.ExpressionWithTypeArguments & { name: string }) => {\n const { typeArguments, expression, name } = expressionWithTypeArgs;\n const typeArgsNodes = typeArguments ? await pMapSeries(typeArguments, (t) => context.computeSchema(t)) : [];\n const location = context.getLocation(expression);\n const expressionNode =\n (await context.visitDefinition(expression)) || new UnresolvedSchema(location, expression.getText());\n return new ExpressionWithTypeArgumentsSchema(typeArgsNodes, expressionNode, name, location);\n }\n );\n }\n\n async transform(interfaceDec: InterfaceDeclaration, context: SchemaExtractorContext) {\n const members = await pMapSeries(interfaceDec.members, (member) => context.computeSchema(member));\n const doc = await context.jsDocToDocSchema(interfaceDec);\n const signature = interfaceDec.name ? await context.getQuickInfoDisplayString(interfaceDec.name) : undefined;\n const extendsNodes = await this.getExpressionWithTypeArgs(interfaceDec, context);\n const typeParameters = interfaceDec.typeParameters?.map((typeParam) => {\n return typeParam.name.getText();\n });\n\n if (!signature) {\n throw Error(`Missing signature for interface ${interfaceDec.name.getText()} declaration`);\n }\n\n return new InterfaceSchema(\n context.getLocation(interfaceDec),\n interfaceDec.name.getText(),\n signature,\n extendsNodes,\n members,\n doc,\n typeParameters\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA2C;AAAA;AAEpC,MAAMA,+BAA+B,CAA8B;EACxEC,SAAS,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,oBAAoB;EACtD;EAEA,MAAMC,cAAc,CAACJ,IAA0B,EAAyB;IACtE,OAAO,CAAC,KAAIK,wBAAU,EAACL,IAAI,CAACM,IAAI,CAACC,OAAO,EAAE,EAAEP,IAAI,CAACQ,aAAa,EAAE,CAACC,QAAQ,CAAC,CAAC;EAC7E;EAEA,MAAcC,yBAAyB,CAACV,IAA0B,EAAEW,OAA+B,EAAE;IACnG,IAAI,CAACX,IAAI,CAACY,eAAe,EAAE,OAAO,EAAE;IAEpC,OAAO,IAAAC,qBAAU,EACfb,IAAI,CAACY,eAAe,CACjBE,MAAM,CAAEC,cAAiC,IAAKA,cAAc,CAACC,KAAK,KAAKd,wBAAU,CAACe,cAAc,CAAC,CACjGC,OAAO,CAAEC,CAAoB,IAAK;MACjC,MAAM;QAAEC;MAAM,CAAC,GAAGD,CAAC;MACnB,MAAMb,IAAI,GAAGa,CAAC,CAACZ,OAAO,EAAE;MACxB,OAAOa,KAAK,CAACC,GAAG,CAAEC,IAAI,oCAAWA,IAAI;QAAEhB;MAAI,EAAG,CAAC;IACjD,CAAC,CAAC,EACJ,MAAOiB,sBAAyE,IAAK;MACnF,MAAM;QAAEC,aAAa;QAAEC,UAAU;QAAEnB;MAAK,CAAC,GAAGiB,sBAAsB;MAClE,MAAMG,aAAa,GAAGF,aAAa,GAAG,MAAM,IAAAX,qBAAU,EAACW,aAAa,EAAGG,CAAC,IAAKhB,OAAO,CAACiB,aAAa,CAACD,CAAC,CAAC,CAAC,GAAG,EAAE;MAC3G,MAAME,QAAQ,GAAGlB,OAAO,CAACmB,WAAW,CAACL,UAAU,CAAC;MAChD,MAAMM,cAAc,GAClB,CAAC,MAAMpB,OAAO,CAACqB,eAAe,CAACP,UAAU,CAAC,KAAK,KAAIQ,qCAAgB,EAACJ,QAAQ,EAAEJ,UAAU,CAAClB,OAAO,EAAE,CAAC;MACrG,OAAO,KAAI2B,sDAAiC,EAACR,aAAa,EAAEK,cAAc,EAAEzB,IAAI,EAAEuB,QAAQ,CAAC;IAC7F,CAAC,CACF;EACH;EAEA,MAAMM,SAAS,CAACC,YAAkC,EAAEzB,OAA+B,EAAE;IAAA;IACnF,MAAM0B,OAAO,GAAG,MAAM,IAAAxB,qBAAU,EAACuB,YAAY,CAACC,OAAO,EAAGC,MAAM,IAAK3B,OAAO,CAACiB,aAAa,CAACU,MAAM,CAAC,CAAC;IACjG,MAAMC,GAAG,GAAG,MAAM5B,OAAO,CAAC6B,gBAAgB,CAACJ,YAAY,CAAC;IACxD,MAAMK,SAAS,GAAGL,YAAY,CAAC9B,IAAI,GAAG,MAAMK,OAAO,CAAC+B,yBAAyB,CAACN,YAAY,CAAC9B,IAAI,CAAC,GAAGqC,SAAS;IAC5G,MAAMC,YAAY,GAAG,MAAM,IAAI,CAAClC,yBAAyB,CAAC0B,YAAY,EAAEzB,OAAO,CAAC;IAChF,MAAMkC,cAAc,4BAAGT,YAAY,CAACS,cAAc,0DAA3B,sBAA6BxB,GAAG,CAAEyB,SAAS,IAAK;MACrE,OAAOA,SAAS,CAACxC,IAAI,CAACC,OAAO,EAAE;IACjC,CAAC,CAAC;IAEF,IAAI,CAACkC,SAAS,EAAE;MACd,MAAMM,KAAK,CAAE,mCAAkCX,YAAY,CAAC9B,IAAI,CAACC,OAAO,EAAG,cAAa,CAAC;IAC3F;IAEA,OAAO,KAAIyC,oCAAe,EACxBrC,OAAO,CAACmB,WAAW,CAACM,YAAY,CAAC,EACjCA,YAAY,CAAC9B,IAAI,CAACC,OAAO,EAAE,EAC3BkC,SAAS,EACTG,YAAY,EACZP,OAAO,EACPE,GAAG,EACHM,cAAc,CACf;EACH;AACF;AAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Node, IntersectionTypeNode } from 'typescript';
|
|
2
|
+
import { TypeIntersectionSchema } from '@teambit/semantics.entities.semantic-schema';
|
|
3
|
+
import { SchemaTransformer } from '../schema-transformer';
|
|
4
|
+
import { SchemaExtractorContext } from '../schema-extractor-context';
|
|
5
|
+
import { Identifier } from '../identifier';
|
|
6
|
+
export declare class IntersectionTypeTransformer implements SchemaTransformer {
|
|
7
|
+
predicate(node: Node): boolean;
|
|
8
|
+
getIdentifiers(): Promise<Identifier[]>;
|
|
9
|
+
transform(node: IntersectionTypeNode, context: SchemaExtractorContext): Promise<TypeIntersectionSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
require("core-js/modules/es.promise.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.IntersectionTypeTransformer = void 0;
|
|
9
|
+
function _typescript() {
|
|
10
|
+
const data = _interopRequireDefault(require("typescript"));
|
|
11
|
+
_typescript = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
function _semanticsEntities() {
|
|
17
|
+
const data = require("@teambit/semantics.entities.semantic-schema");
|
|
18
|
+
_semanticsEntities = function () {
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
function _pMapSeries() {
|
|
24
|
+
const data = _interopRequireDefault(require("p-map-series"));
|
|
25
|
+
_pMapSeries = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
class IntersectionTypeTransformer {
|
|
31
|
+
predicate(node) {
|
|
32
|
+
return node.kind === _typescript().default.SyntaxKind.IntersectionType;
|
|
33
|
+
}
|
|
34
|
+
async getIdentifiers() {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
async transform(node, context) {
|
|
38
|
+
const types = await (0, _pMapSeries().default)(node.types, async type => {
|
|
39
|
+
const typeSchema = context.computeSchema(type);
|
|
40
|
+
return typeSchema;
|
|
41
|
+
});
|
|
42
|
+
const location = context.getLocation(node);
|
|
43
|
+
return new (_semanticsEntities().TypeIntersectionSchema)(location, types);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.IntersectionTypeTransformer = IntersectionTypeTransformer;
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=intersection-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IntersectionTypeTransformer","predicate","node","kind","ts","SyntaxKind","IntersectionType","getIdentifiers","transform","context","types","pMapSeries","type","typeSchema","computeSchema","location","getLocation","TypeIntersectionSchema"],"sources":["intersection-type.ts"],"sourcesContent":["import ts, { Node, IntersectionTypeNode } from 'typescript';\nimport { TypeIntersectionSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IntersectionTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IntersectionType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IntersectionTypeNode, context: SchemaExtractorContext) {\n const types = await pMapSeries(node.types, async (type) => {\n const typeSchema = context.computeSchema(type);\n return typeSchema;\n });\n const location = context.getLocation(node);\n return new TypeIntersectionSchema(location, types);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKO,MAAMA,2BAA2B,CAA8B;EACpEC,SAAS,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,gBAAgB;EACrD;EAEA,MAAMC,cAAc,GAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAAS,CAACN,IAA0B,EAAEO,OAA+B,EAAE;IAC3E,MAAMC,KAAK,GAAG,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACQ,KAAK,EAAE,MAAOE,IAAI,IAAK;MACzD,MAAMC,UAAU,GAAGJ,OAAO,CAACK,aAAa,CAACF,IAAI,CAAC;MAC9C,OAAOC,UAAU;IACnB,CAAC,CAAC;IACF,MAAME,QAAQ,GAAGN,OAAO,CAACO,WAAW,CAACd,IAAI,CAAC;IAC1C,OAAO,KAAIe,2CAAsB,EAACF,QAAQ,EAAEL,KAAK,CAAC;EACpD;AACF;AAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node } from 'typescript';
|
|
2
|
+
import { KeywordTypeSchema } from '@teambit/semantics.entities.semantic-schema';
|
|
3
|
+
import { SchemaTransformer } from '../schema-transformer';
|
|
4
|
+
import { SchemaExtractorContext } from '../schema-extractor-context';
|
|
5
|
+
import { Identifier } from '../identifier';
|
|
6
|
+
/**
|
|
7
|
+
* whether it's kind of `ts.KeywordTypeSyntaxKind`
|
|
8
|
+
*/
|
|
9
|
+
export declare class KeywordTypeTransformer implements SchemaTransformer {
|
|
10
|
+
predicate(node: Node): boolean;
|
|
11
|
+
getIdentifiers(): Promise<Identifier[]>;
|
|
12
|
+
transform(node: Node, context: SchemaExtractorContext): Promise<KeywordTypeSchema>;
|
|
13
|
+
}
|