@glutinum/cli 1.0.0-beta.13 → 1.0.0-beta.15
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/Glutinum.Converter/GlueAST.js +19 -14
- package/dist/Glutinum.Converter/Merge.js +480 -205
- package/dist/Glutinum.Converter/Packages.js +2 -2
- package/dist/Glutinum.Converter/Printer.js +26 -21
- package/dist/Glutinum.Converter/Read.js +377 -169
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +25 -8
- package/dist/Glutinum.Converter/Reader/ConditionalTypeNode.js +2 -2
- package/dist/Glutinum.Converter/Reader/Declaration.js +15 -15
- package/dist/Glutinum.Converter/Reader/Deferred.js +114 -43
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +98 -44
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +2 -2
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +61 -46
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +4 -4
- package/dist/Glutinum.Converter/Reader/IntersectionTypeNode.js +38 -25
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +6 -5
- package/dist/Glutinum.Converter/Reader/Node.js +1 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js +244 -29
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +1 -1
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +143 -35
- package/dist/Glutinum.Converter/Reader/UtilityType.js +153 -40
- package/dist/Glutinum.Converter/Reader/Utils.js +186 -17
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +46 -16
- package/dist/Glutinum.Converter/Transform.js +1062 -629
- package/dist/Glutinum.Converter/Transformer/CallableProperties.js +2 -2
- package/dist/Glutinum.Converter/Transformer/Conditionals.js +17 -16
- package/dist/Glutinum.Converter/Transformer/Context.js +12 -4
- package/dist/Glutinum.Converter/Transformer/Exports.js +242 -66
- package/dist/Glutinum.Converter/Transformer/Heritage.js +278 -19
- package/dist/Glutinum.Converter/Transformer/KeyOfMaps.js +4 -4
- package/dist/Glutinum.Converter/Transformer/ParamObjectCandidate.js +105 -19
- package/dist/Glutinum.Converter/Transformer/TypeParameters.js +2 -2
- package/dist/Glutinum.Converter/Transformer/Utils.js +3 -3
- package/dist/Glutinum.Converter/Utils/Naming.js +10 -3
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { unwrap, orElse, value as value_2, defaultArg } from "../../fable_modules/fable-library-js.5.21.0/Option.js";
|
|
3
|
+
import { tryReadLiteral, typeLiteralId, declaredName, isFromEsLib, Type_StringLiteral_$007CString$007COther$007C, isFromEs5Lib, entityNameText, readTypeArguments, landingOf, crossesNamespace, modulePathForSymbol, isLibraryName, getFullNameOrEmpty, knownExternalTypeNames, isExternalToPackages, importedName, identifierText, typeNodeBuilderFlags, $007CHasSymbolFlags$007C_$007C, symbolAtLocation, $007CHasTypeFlags$007C_$007C, resolveAlias } from "./Utils.js";
|
|
4
|
+
import { filter, choose, sortByDescending, tryHead, map as map_1, toList, exists, forAll, tryPick } from "../../fable_modules/fable-library-js.5.21.0/Seq.js";
|
|
5
|
+
import { exists as exists_1, collect, head, tail, isEmpty, map, append, fold, singleton, empty, length, mapIndexed } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
4
6
|
import { GlueTypeLiteral, GlueConstructSignature, GlueThisType, GlueFunctionType, GlueTypeUnion, GlueLiteral, GlueTypeReference, GluePrimitive, GlueType } from "../GlueAST.js";
|
|
5
7
|
import { readReadonly, readPick, readOmit, readThisParameterType, readReturnType, readRecord, readPartial, readExclude, tryExpandAnonymousObjectApplication } from "./UtilityType.js";
|
|
6
8
|
import { contains, item as item_1 } from "../../fable_modules/fable-library-js.5.21.0/Array.js";
|
|
7
9
|
import { isGlobalThisQuery, truncateToDeclaredArity, tryResolveDeferred, isDeferredConditional } from "./Deferred.js";
|
|
8
|
-
import { filter, choose, sortByDescending, tryHead, map as map_1, toList, exists } from "../../fable_modules/fable-library-js.5.21.0/Seq.js";
|
|
9
10
|
import { FSharpSet__Contains } from "../../fable_modules/fable-library-js.5.21.0/Set.js";
|
|
10
11
|
import { sanitizeTypeName } from "../Utils/Naming.js";
|
|
11
|
-
import { exists as exists_1, collect, head, tail, isEmpty, map, append, fold, singleton, empty } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
12
12
|
import { Operators_IsNull } from "../../fable_modules/fable-library-js.5.21.0/FSharp.Core.js";
|
|
13
13
|
import { List_distinct, List_distinctBy } from "../../fable_modules/fable-library-js.5.21.0/Seq2.js";
|
|
14
14
|
import { Exception, safeHash, equals, comparePrimitives, stringHash } from "../../fable_modules/fable-library-js.5.21.0/Util.js";
|
|
@@ -21,6 +21,94 @@ import { Report_readerError_Z19516DCE } from "./Report.js";
|
|
|
21
21
|
import { readExpressionWithTypeArguments } from "./ExpressionWithTypeArguments.js";
|
|
22
22
|
import { TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name } from "../TypeScript.Extensions.js";
|
|
23
23
|
|
|
24
|
+
function widenLiteralArguments(reader, symbolOpt, typeReferenceNode, typeArguments) {
|
|
25
|
+
let symbol, nodes;
|
|
26
|
+
let declaredTypeParameters;
|
|
27
|
+
let option_6;
|
|
28
|
+
let option_4;
|
|
29
|
+
const option_2 = symbolOpt;
|
|
30
|
+
option_4 = ((option_2 != null) ? ((symbol = option_2, defaultArg(resolveAlias(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), symbol), symbol))) : undefined);
|
|
31
|
+
if (option_4 != null) {
|
|
32
|
+
const symbol_1 = option_4;
|
|
33
|
+
option_6 = symbol_1.declarations;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
option_6 = undefined;
|
|
37
|
+
}
|
|
38
|
+
declaredTypeParameters = ((option_6 != null) ? tryPick((declaration) => declaration.typeParameters, option_6) : undefined);
|
|
39
|
+
const matchValue_2 = typeReferenceNode.typeArguments;
|
|
40
|
+
let matchResult, nodes_1, typeParameters_2;
|
|
41
|
+
if (matchValue_2 != null) {
|
|
42
|
+
if (declaredTypeParameters != null) {
|
|
43
|
+
if ((nodes = matchValue_2, ~~nodes.length === length(typeArguments))) {
|
|
44
|
+
matchResult = 0;
|
|
45
|
+
nodes_1 = matchValue_2;
|
|
46
|
+
typeParameters_2 = declaredTypeParameters;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
matchResult = 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
matchResult = 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
matchResult = 1;
|
|
58
|
+
}
|
|
59
|
+
switch (matchResult) {
|
|
60
|
+
case 0:
|
|
61
|
+
return mapIndexed((index, typeArgument) => {
|
|
62
|
+
let node, typ, isLiteralType, matchValue_1, constraint_, matchValue_4, symbol_2, matchValue_5;
|
|
63
|
+
if ((index < ~~typeParameters_2.length) && ((node = (nodes_1[index]), (node.pos >= 0) && ((typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(node), (isLiteralType = ((typ_1) => {
|
|
64
|
+
const matchValue = typ_1.flags;
|
|
65
|
+
let matchResult_1;
|
|
66
|
+
if ($007CHasTypeFlags$007C_$007C(1024, matchValue) != null) {
|
|
67
|
+
matchResult_1 = 0;
|
|
68
|
+
}
|
|
69
|
+
else if ($007CHasTypeFlags$007C_$007C(2048, matchValue) != null) {
|
|
70
|
+
matchResult_1 = 0;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
matchResult_1 = 1;
|
|
74
|
+
}
|
|
75
|
+
switch (matchResult_1) {
|
|
76
|
+
case 0:
|
|
77
|
+
return true;
|
|
78
|
+
default:
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}), (matchValue_1 = typ.flags, ($007CHasTypeFlags$007C_$007C(134217728, matchValue_1) != null) ? forAll(isLiteralType, typ.types) : isLiteralType(typ)))))))) {
|
|
82
|
+
const matchValue_6 = (typeParameters_2[index]).constraint;
|
|
83
|
+
let matchResult_2, constraint__2;
|
|
84
|
+
if (matchValue_6 != null) {
|
|
85
|
+
if ((constraint_ = matchValue_6, ((constraint_.kind === 184) && (constraint_.typeArguments == null)) && ((matchValue_4 = symbolAtLocation(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), constraint_.typeName), (matchValue_4 == null) ? false : ((symbol_2 = matchValue_4, (matchValue_5 = symbol_2.flags, !($007CHasSymbolFlags$007C_$007C(262144, matchValue_5) != null)))))))) {
|
|
86
|
+
matchResult_2 = 0;
|
|
87
|
+
constraint__2 = matchValue_6;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
matchResult_2 = 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
matchResult_2 = 1;
|
|
95
|
+
}
|
|
96
|
+
switch (matchResult_2) {
|
|
97
|
+
case 0:
|
|
98
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](constraint__2);
|
|
99
|
+
default:
|
|
100
|
+
return typeArgument;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
return typeArgument;
|
|
105
|
+
}
|
|
106
|
+
}, typeArguments);
|
|
107
|
+
default:
|
|
108
|
+
return typeArguments;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
24
112
|
function readTypeReference(reader, typeNode) {
|
|
25
113
|
let option_13, symbol_4;
|
|
26
114
|
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
@@ -125,7 +213,7 @@ function readTypeReference(reader, typeNode) {
|
|
|
125
213
|
const symbol_3 = symbolOpt;
|
|
126
214
|
name = defaultArg(orElse(importedName(checker, symbol_3), (option_9 = symbol_3.valueDeclaration, (option_9 != null) ? ((valueDeclaration = option_9, (matchValue_5 = valueDeclaration.kind, (matchValue_5 === 267) ? (isQualified ? symbol_3.name : writtenName()) : ((matchValue_5 === 307) ? (valueDeclaration.symbol.parent.getName()) : writtenName())))) : undefined)), writtenName());
|
|
127
215
|
}
|
|
128
|
-
const isUnresolved = (
|
|
216
|
+
const isUnresolved = (reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"]() != null) && (symbolOpt == null);
|
|
129
217
|
const isExternal = isExternalToPackages(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), symbolOpt);
|
|
130
218
|
if ((((name === "...") ? true : ((matchValue_6 = typeReferenceNode.typeArguments, (matchValue_6 == null) ? false : exists((typeArgument) => {
|
|
131
219
|
if (typeArgument.kind === 184) {
|
|
@@ -138,7 +226,7 @@ function readTypeReference(reader, typeNode) {
|
|
|
138
226
|
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
139
227
|
}
|
|
140
228
|
else {
|
|
141
|
-
return new GlueType(/* TypeReference */ 13, [new GlueTypeReference((name.indexOf(".") >= 0) ? name : sanitizeTypeName(name), getFullNameOrEmpty(checker, typeReferenceNode.typeName), isLibraryName(reader, name) ? empty() : modulePathForSymbol(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), isQualified ? true : crossesNamespace(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), symbolOpt, landingOf(reader, typeNode)), symbolOpt), truncateToDeclaredArity(reader, symbolOpt, readTypeArguments(reader, typeReferenceNode)), (isStandardLibrary ? true : isExternal) ? true : isLibraryName(reader, name))]);
|
|
229
|
+
return new GlueType(/* TypeReference */ 13, [new GlueTypeReference((name.indexOf(".") >= 0) ? name : sanitizeTypeName(name), getFullNameOrEmpty(checker, typeReferenceNode.typeName), isLibraryName(reader, name) ? empty() : modulePathForSymbol(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), isQualified ? true : crossesNamespace(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), symbolOpt, landingOf(reader, typeNode)), symbolOpt), truncateToDeclaredArity(reader, symbolOpt, widenLiteralArguments(reader, symbolOpt, typeReferenceNode, readTypeArguments(reader, typeReferenceNode))), (isStandardLibrary ? true : isExternal) ? true : isLibraryName(reader, name))]);
|
|
142
230
|
}
|
|
143
231
|
}
|
|
144
232
|
else {
|
|
@@ -151,13 +239,63 @@ function readTypeReference(reader, typeNode) {
|
|
|
151
239
|
}
|
|
152
240
|
else if (isFromEs5Lib(symbolOpt)) {
|
|
153
241
|
const matchValue_10 = getFullNameOrEmpty(checker, typeReferenceNode.typeName);
|
|
242
|
+
let matchResult_2;
|
|
154
243
|
switch (matchValue_10) {
|
|
155
|
-
case "Exclude":
|
|
156
|
-
|
|
244
|
+
case "Exclude": {
|
|
245
|
+
matchResult_2 = 0;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
157
248
|
case "Uppercase":
|
|
158
249
|
case "Lowercase":
|
|
159
250
|
case "Capitalize":
|
|
160
251
|
case "Uncapitalize": {
|
|
252
|
+
matchResult_2 = 1;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
case "Partial": {
|
|
256
|
+
matchResult_2 = 2;
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
case "Record": {
|
|
260
|
+
matchResult_2 = 3;
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
case "ReturnType": {
|
|
264
|
+
matchResult_2 = 4;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
case "ThisParameterType": {
|
|
268
|
+
matchResult_2 = 5;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
case "Omit": {
|
|
272
|
+
matchResult_2 = 6;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
case "Pick": {
|
|
276
|
+
matchResult_2 = 7;
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
case "Readonly": {
|
|
280
|
+
matchResult_2 = 8;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
case "Awaited": {
|
|
284
|
+
if (typeReferenceNode.typeArguments != null) {
|
|
285
|
+
matchResult_2 = 9;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
matchResult_2 = 10;
|
|
289
|
+
}
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
default:
|
|
293
|
+
matchResult_2 = 10;
|
|
294
|
+
}
|
|
295
|
+
switch (matchResult_2) {
|
|
296
|
+
case 0:
|
|
297
|
+
return readExclude(reader, typeReferenceNode);
|
|
298
|
+
case 1: {
|
|
161
299
|
const literals = (typ_1) => {
|
|
162
300
|
const matchValue_7 = typ_1.flags;
|
|
163
301
|
if ($007CHasTypeFlags$007C_$007C(1024, matchValue_7) != null) {
|
|
@@ -171,21 +309,21 @@ function readTypeReference(reader, typeNode) {
|
|
|
171
309
|
}
|
|
172
310
|
else if ($007CHasTypeFlags$007C_$007C(134217728, matchValue_7) != null) {
|
|
173
311
|
return fold((acc, cases) => {
|
|
174
|
-
let
|
|
312
|
+
let matchResult_3, acc_1, cases_1;
|
|
175
313
|
if (acc != null) {
|
|
176
314
|
if (cases != null) {
|
|
177
|
-
|
|
315
|
+
matchResult_3 = 0;
|
|
178
316
|
acc_1 = acc;
|
|
179
317
|
cases_1 = cases;
|
|
180
318
|
}
|
|
181
319
|
else {
|
|
182
|
-
|
|
320
|
+
matchResult_3 = 1;
|
|
183
321
|
}
|
|
184
322
|
}
|
|
185
323
|
else {
|
|
186
|
-
|
|
324
|
+
matchResult_3 = 1;
|
|
187
325
|
}
|
|
188
|
-
switch (
|
|
326
|
+
switch (matchResult_3) {
|
|
189
327
|
case 0:
|
|
190
328
|
return append(acc_1, cases_1);
|
|
191
329
|
default:
|
|
@@ -202,26 +340,26 @@ function readTypeReference(reader, typeNode) {
|
|
|
202
340
|
}
|
|
203
341
|
else {
|
|
204
342
|
const matchValue_9 = literals(checker.getTypeFromTypeNode(typeReferenceNode));
|
|
205
|
-
let
|
|
343
|
+
let matchResult_4, single, cases_2;
|
|
206
344
|
if (matchValue_9 != null) {
|
|
207
345
|
if (!isEmpty(matchValue_9)) {
|
|
208
346
|
if (isEmpty(tail(matchValue_9))) {
|
|
209
|
-
|
|
347
|
+
matchResult_4 = 0;
|
|
210
348
|
single = head(matchValue_9);
|
|
211
349
|
}
|
|
212
350
|
else {
|
|
213
|
-
|
|
351
|
+
matchResult_4 = 1;
|
|
214
352
|
cases_2 = matchValue_9;
|
|
215
353
|
}
|
|
216
354
|
}
|
|
217
355
|
else {
|
|
218
|
-
|
|
356
|
+
matchResult_4 = 2;
|
|
219
357
|
}
|
|
220
358
|
}
|
|
221
359
|
else {
|
|
222
|
-
|
|
360
|
+
matchResult_4 = 2;
|
|
223
361
|
}
|
|
224
|
-
switch (
|
|
362
|
+
switch (matchResult_4) {
|
|
225
363
|
case 0:
|
|
226
364
|
return single;
|
|
227
365
|
case 1:
|
|
@@ -231,15 +369,15 @@ function readTypeReference(reader, typeNode) {
|
|
|
231
369
|
}
|
|
232
370
|
}
|
|
233
371
|
}
|
|
234
|
-
case
|
|
372
|
+
case 2:
|
|
235
373
|
return readPartial(reader, typeReferenceNode);
|
|
236
|
-
case
|
|
374
|
+
case 3:
|
|
237
375
|
return readRecord(reader, typeReferenceNode);
|
|
238
|
-
case
|
|
376
|
+
case 4:
|
|
239
377
|
return readReturnType(reader, typeReferenceNode);
|
|
240
|
-
case
|
|
378
|
+
case 5:
|
|
241
379
|
return readThisParameterType(reader, typeReferenceNode);
|
|
242
|
-
case
|
|
380
|
+
case 6: {
|
|
243
381
|
const option_16 = tryExpandAnonymousObjectApplication(reader, typeReferenceNode);
|
|
244
382
|
if (option_16 != null) {
|
|
245
383
|
return option_16;
|
|
@@ -248,7 +386,7 @@ function readTypeReference(reader, typeNode) {
|
|
|
248
386
|
return readOmit(reader, typeReferenceNode);
|
|
249
387
|
}
|
|
250
388
|
}
|
|
251
|
-
case
|
|
389
|
+
case 7: {
|
|
252
390
|
const option_18 = tryExpandAnonymousObjectApplication(reader, typeReferenceNode);
|
|
253
391
|
if (option_18 != null) {
|
|
254
392
|
return option_18;
|
|
@@ -257,8 +395,85 @@ function readTypeReference(reader, typeNode) {
|
|
|
257
395
|
return readPick(reader, typeReferenceNode);
|
|
258
396
|
}
|
|
259
397
|
}
|
|
260
|
-
case
|
|
398
|
+
case 8:
|
|
261
399
|
return readReadonly(reader, typeReferenceNode);
|
|
400
|
+
case 9: {
|
|
401
|
+
const awaited = (glueType_1_mut) => {
|
|
402
|
+
awaited:
|
|
403
|
+
while (true) {
|
|
404
|
+
const glueType_1 = glueType_1_mut;
|
|
405
|
+
let matchResult_5, result, glueType_2;
|
|
406
|
+
if (glueType_1.tag === 13) {
|
|
407
|
+
switch (glueType_1.fields[0].Name) {
|
|
408
|
+
case "Promise": {
|
|
409
|
+
if (!isEmpty(glueType_1.fields[0].TypeArguments)) {
|
|
410
|
+
if (isEmpty(tail(glueType_1.fields[0].TypeArguments))) {
|
|
411
|
+
if (glueType_1.fields[0].IsStandardLibrary) {
|
|
412
|
+
matchResult_5 = 0;
|
|
413
|
+
result = head(glueType_1.fields[0].TypeArguments);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
matchResult_5 = 1;
|
|
417
|
+
glueType_2 = glueType_1;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
matchResult_5 = 1;
|
|
422
|
+
glueType_2 = glueType_1;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
matchResult_5 = 1;
|
|
427
|
+
glueType_2 = glueType_1;
|
|
428
|
+
}
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
case "PromiseLike": {
|
|
432
|
+
if (!isEmpty(glueType_1.fields[0].TypeArguments)) {
|
|
433
|
+
if (isEmpty(tail(glueType_1.fields[0].TypeArguments))) {
|
|
434
|
+
if (glueType_1.fields[0].IsStandardLibrary) {
|
|
435
|
+
matchResult_5 = 0;
|
|
436
|
+
result = head(glueType_1.fields[0].TypeArguments);
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
matchResult_5 = 1;
|
|
440
|
+
glueType_2 = glueType_1;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
else {
|
|
444
|
+
matchResult_5 = 1;
|
|
445
|
+
glueType_2 = glueType_1;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
matchResult_5 = 1;
|
|
450
|
+
glueType_2 = glueType_1;
|
|
451
|
+
}
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
default: {
|
|
455
|
+
matchResult_5 = 1;
|
|
456
|
+
glueType_2 = glueType_1;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
matchResult_5 = 1;
|
|
462
|
+
glueType_2 = glueType_1;
|
|
463
|
+
}
|
|
464
|
+
switch (matchResult_5) {
|
|
465
|
+
case 0: {
|
|
466
|
+
glueType_1_mut = result;
|
|
467
|
+
continue awaited;
|
|
468
|
+
}
|
|
469
|
+
default:
|
|
470
|
+
return glueType_2;
|
|
471
|
+
}
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
return awaited(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](value_2(typeReferenceNode.typeArguments)[0]));
|
|
476
|
+
}
|
|
262
477
|
default:
|
|
263
478
|
return readTypeReference_1(true);
|
|
264
479
|
}
|
|
@@ -595,7 +810,7 @@ export function readTypeNode(reader, typeNode) {
|
|
|
595
810
|
case 195:
|
|
596
811
|
return readConditionalType(reader, typeNode);
|
|
597
812
|
case 196:
|
|
598
|
-
return new GlueType(/* TypeParameter */ 16, [typeNode.typeParameter.name.
|
|
813
|
+
return new GlueType(/* TypeParameter */ 16, [typeNode.typeParameter.name.text]);
|
|
599
814
|
case 197: {
|
|
600
815
|
const parenthesizedTypeNode = typeNode;
|
|
601
816
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](parenthesizedTypeNode.type);
|
|
@@ -616,7 +831,7 @@ export function readTypeNode(reader, typeNode) {
|
|
|
616
831
|
const literalTypeNode = typeNode;
|
|
617
832
|
const matchValue_2 = tryReadLiteral(checker, literalTypeNode.literal);
|
|
618
833
|
if (matchValue_2 == null) {
|
|
619
|
-
throw new Exception(Report_readerError_Z19516DCE("type node - literal type", "Could not read literal type", typeNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs",
|
|
834
|
+
throw new Exception(Report_readerError_Z19516DCE("type node - literal type", "Could not read literal type", typeNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 531));
|
|
620
835
|
}
|
|
621
836
|
else {
|
|
622
837
|
return new GlueType(/* Literal */ 8, [matchValue_2]);
|
|
@@ -631,7 +846,7 @@ export function readTypeNode(reader, typeNode) {
|
|
|
631
846
|
case 234:
|
|
632
847
|
return readExpressionWithTypeArguments(reader, typeNode);
|
|
633
848
|
default: {
|
|
634
|
-
const item = Report_readerError_Z19516DCE("type node", concat("Unsupported kind ", TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(typeNode.kind)), typeNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs",
|
|
849
|
+
const item = Report_readerError_Z19516DCE("type node", concat("Unsupported kind ", TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(typeNode.kind)), typeNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 675);
|
|
635
850
|
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
636
851
|
void (objectArg.push(item));
|
|
637
852
|
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
@@ -120,7 +120,7 @@ export function readTypeOperatorNode(reader, node) {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
case 148:
|
|
123
|
-
return new GlueType(/* ReadOnly */
|
|
123
|
+
return new GlueType(/* ReadOnly */ 31, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](node.type)]);
|
|
124
124
|
case 158:
|
|
125
125
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](node.type);
|
|
126
126
|
default: {
|