@glutinum/cli 0.8.0 → 0.10.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.
Files changed (34) hide show
  1. package/dist/Glutinum.Converter/FsharpAST.js +21 -8
  2. package/dist/Glutinum.Converter/FsharpAST.js.map +1 -1
  3. package/dist/Glutinum.Converter/Generate.js +23 -8
  4. package/dist/Glutinum.Converter/Generate.js.map +1 -1
  5. package/dist/Glutinum.Converter/GlueAST.js +51 -16
  6. package/dist/Glutinum.Converter/GlueAST.js.map +1 -1
  7. package/dist/Glutinum.Converter/Merge.js +86 -0
  8. package/dist/Glutinum.Converter/Merge.js.map +1 -0
  9. package/dist/Glutinum.Converter/Printer.js +61 -25
  10. package/dist/Glutinum.Converter/Printer.js.map +1 -1
  11. package/dist/Glutinum.Converter/Read.js +5 -2
  12. package/dist/Glutinum.Converter/Read.js.map +1 -1
  13. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +1 -1
  14. package/dist/Glutinum.Converter/Reader/ExportAssignment.js +1 -1
  15. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +2 -2
  16. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +1 -1
  17. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +1 -1
  18. package/dist/Glutinum.Converter/Reader/Node.js +1 -1
  19. package/dist/Glutinum.Converter/Reader/TypeNode.js +166 -123
  20. package/dist/Glutinum.Converter/Reader/TypeNode.js.map +1 -1
  21. package/dist/Glutinum.Converter/Reader/TypeParameters.js +2 -1
  22. package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +1 -1
  23. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +8 -1
  24. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +1 -1
  25. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +8 -5
  26. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +1 -1
  27. package/dist/Glutinum.Converter/Reader/Utils.js +41 -6
  28. package/dist/Glutinum.Converter/Reader/Utils.js.map +1 -1
  29. package/dist/Glutinum.Converter/Transform.js +374 -120
  30. package/dist/Glutinum.Converter/Transform.js.map +1 -1
  31. package/dist/Glutinum.Converter/Utils/Naming.js +0 -19
  32. package/dist/Glutinum.Converter/Utils/Naming.js.map +1 -1
  33. package/dist/fable_modules/project_cracked.json +1 -1
  34. package/package.json +1 -1
@@ -26,7 +26,7 @@ export function readClassDeclaration(reader, classDeclaration) {
26
26
  const isDefaultExport = ModifierUtil_HasModifier_Z687DC302(classDeclaration.modifiers, 90);
27
27
  const classDeclaration_1 = new GlueType(12, [new GlueClassDeclaration(name.getText(), constructors_1, members_2, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"](classDeclaration.typeParameters), readHeritageClauses(reader, classDeclaration.heritageClauses))]);
28
28
  if (isDefaultExport) {
29
- return new GlueType(25, [classDeclaration_1]);
29
+ return new GlueType(24, [classDeclaration_1]);
30
30
  }
31
31
  else {
32
32
  return classDeclaration_1;
@@ -27,7 +27,7 @@ export function readExportAssignment(reader, exportNode) {
27
27
  else {
28
28
  typ = (($007CHasTypeFlags$007C_$007C(4, matchValue_1) != null) ? (new GlueType(3, [new GluePrimitive(0, [])])) : (($007CHasTypeFlags$007C_$007C(8, matchValue_1) != null) ? (new GlueType(3, [new GluePrimitive(5, [])])) : (($007CHasTypeFlags$007C_$007C(16, matchValue_1) != null) ? (new GlueType(3, [new GluePrimitive(3, [])])) : (($007CHasTypeFlags$007C_$007C(1, matchValue_1) != null) ? (new GlueType(3, [new GluePrimitive(6, [])])) : (($007CHasTypeFlags$007C_$007C(16384, matchValue_1) != null) ? (new GlueType(3, [new GluePrimitive(4, [])])) : (new GlueType(3, [new GluePrimitive(6, [])])))))));
29
29
  }
30
- return new GlueType(25, [new GlueType(2, [new GlueVariable(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](exportNode), identiferNode.getText(), typ)])]);
30
+ return new GlueType(24, [new GlueType(2, [new GlueVariable(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](exportNode), identiferNode.getText(), typ)])]);
31
31
  }
32
32
  else {
33
33
  return new GlueType(0, []);
@@ -1,11 +1,11 @@
1
1
  import { map } from "../../fable_modules/fable-library-js.4.14.0/List.js";
2
2
  import { toList } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
3
- import { readHeritageClauses } from "./Utils.js";
3
+ import { readHeritageClauses, getFullNameOrEmpty } from "./Utils.js";
4
4
  import { GlueInterface } from "../GlueAST.js";
5
5
 
6
6
  export function readInterfaceDeclaration(reader, declaration) {
7
7
  const members = map((declaration_1) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_1), toList(declaration.members));
8
- return new GlueInterface(declaration.name.getText(), members, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"](declaration.typeParameters), readHeritageClauses(reader, declaration.heritageClauses));
8
+ return new GlueInterface(getFullNameOrEmpty(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), declaration), declaration.name.getText(), members, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"](declaration.typeParameters), readHeritageClauses(reader, declaration.heritageClauses));
9
9
  }
10
10
 
11
11
  //# sourceMappingURL=InterfaceDeclaration.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/InterfaceDeclaration.fs"],"names":["members","reader","declaration"],"mappings":";;;;;;AAYQA,oBACqC,uBAAS,AAAAC,oFAAAC,gBAAvB,OAAvB,AAAAA;AAEJ,WAAA,kBACW,AAAAA,4BACGF,SACO,AAAAC,uFAA0B,AAAAC,6BAEvC,oBAA0BD,QAAO,AAAAC","file":null,"sourcesContent":null,"sourceRoot":null}
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/InterfaceDeclaration.fs"],"names":["members","reader","declaration"],"mappings":";;;;;;AAYQA,oBACqC,uBAAS,AAAAC,oFAAAC,gBAAvB,OAAvB,AAAAA;AAEJ,WAAA,kBACe,mBAAyB,AAAAD,2EAAeC,cAC5C,AAAAA,4BACGF,SACO,AAAAC,uFAA0B,AAAAC,6BAEvC,oBAA0BD,QAAO,AAAAC","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -1,7 +1,7 @@
1
1
  import { GlueType, NamedTupleType } from "../GlueAST.js";
2
2
 
3
3
  export function readNamedTupleMember(reader, declaration) {
4
- return new GlueType(20, [new NamedTupleType(declaration.name.getText(), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](declaration.type))]);
4
+ return new GlueType(19, [new NamedTupleType(declaration.name.getText(), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](declaration.type))]);
5
5
  }
6
6
 
7
7
  //# sourceMappingURL=NamedTupleMember.js.map
@@ -9,7 +9,7 @@ export function readNode(reader, node) {
9
9
  switch (matchValue) {
10
10
  case 187: {
11
11
  const typeLiteralNode = node;
12
- return new GlueType(22, [new GlueTypeLiteral(map((declaration) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration), toList(typeLiteralNode.members)))]);
12
+ return new GlueType(21, [new GlueTypeLiteral(map((declaration) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration), toList(typeLiteralNode.members)))]);
13
13
  }
14
14
  case 243:
15
15
  return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadVariableStatementZ66C4BA0A"](node);
@@ -1,8 +1,8 @@
1
1
  import { Union } from "../../fable_modules/fable-library-js.4.14.0/Types.js";
2
2
  import { union_type, class_type } from "../../fable_modules/fable-library-js.4.14.0/Reflection.js";
3
- import { GlueTypeLiteral, GlueClassDeclaration, GlueFunctionType, GlueTypeReference, GlueInterface, GlueTypeUnion, GlueLiteral, GlueType, GluePrimitive } from "../GlueAST.js";
4
- import { getFullNameOrEmpty, tryReadLiteral, readTypeArguments, $007CHasSymbolFlags$007C_$007C, $007CHasTypeFlags$007C_$007C, generateReaderError } from "./Utils.js";
5
- import { exists, concat, empty, map, choose } from "../../fable_modules/fable-library-js.4.14.0/List.js";
3
+ import { tryReadLiteral, generateReaderError, isFromEs5Lib, $007CHasSymbolFlags$007C_$007C, readTypeArguments, getFullNameOrEmpty, $007CHasTypeFlags$007C_$007C } from "./Utils.js";
4
+ import { GlueTypeLiteral, GlueFunctionType, GlueTypeReference, GlueRecord, GlueUtilityType, GlueInterface, GlueTypeUnion, GlueLiteral, GlueClassDeclaration, GlueType, GluePrimitive } from "../GlueAST.js";
5
+ import { exists, concat, item as item_1, map, choose, empty } from "../../fable_modules/fable-library-js.4.14.0/List.js";
6
6
  import { head, toList } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
7
7
  import { value as value_2 } from "../../fable_modules/fable-library-js.4.14.0/Option.js";
8
8
  import { List_distinct } from "../../fable_modules/fable-library-js.4.14.0/Seq2.js";
@@ -24,6 +24,102 @@ function IntersectionTypePropertyResult_$reflection() {
24
24
  return union_type("Glutinum.Converter.Reader.TypeNode.IntersectionTypePropertyResult", [], IntersectionTypePropertyResult, () => [[["Item", class_type("TypeScript.Ts.Declaration")]], []]);
25
25
  }
26
26
 
27
+ function readTypeUsingFlags(reader, typ) {
28
+ const matchValue = typ.flags | 0;
29
+ if ($007CHasTypeFlags$007C_$007C(524288, matchValue) != null) {
30
+ const matchValue_1 = typ.symbol.declarations;
31
+ if (matchValue_1 == null) {
32
+ return new GlueType(3, [new GluePrimitive(6, [])]);
33
+ }
34
+ else {
35
+ const declarations = matchValue_1;
36
+ const declaration = declarations[0];
37
+ const matchValue_2 = declaration.kind | 0;
38
+ switch (matchValue_2) {
39
+ case 263:
40
+ return new GlueType(12, [new GlueClassDeclaration(typ.symbol.name, empty(), empty(), empty(), empty())]);
41
+ case 267:
42
+ return new GlueType(0, []);
43
+ default:
44
+ return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration);
45
+ }
46
+ }
47
+ }
48
+ else if ($007CHasTypeFlags$007C_$007C(4, matchValue) != null) {
49
+ return new GlueType(3, [new GluePrimitive(0, [])]);
50
+ }
51
+ else if ($007CHasTypeFlags$007C_$007C(8, matchValue) != null) {
52
+ return new GlueType(3, [new GluePrimitive(5, [])]);
53
+ }
54
+ else if ($007CHasTypeFlags$007C_$007C(16, matchValue) != null) {
55
+ return new GlueType(3, [new GluePrimitive(3, [])]);
56
+ }
57
+ else if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
58
+ return new GlueType(3, [new GluePrimitive(6, [])]);
59
+ }
60
+ else if ($007CHasTypeFlags$007C_$007C(16384, matchValue) != null) {
61
+ return new GlueType(3, [new GluePrimitive(4, [])]);
62
+ }
63
+ else {
64
+ return new GlueType(3, [new GluePrimitive(6, [])]);
65
+ }
66
+ }
67
+
68
+ export function UtilityType_readExclude(reader, typeReferenceNode) {
69
+ const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode);
70
+ return new GlueType(7, [new GlueTypeUnion(choose((typ_1) => {
71
+ const matchValue = typ_1.flags | 0;
72
+ if ($007CHasTypeFlags$007C_$007C(128, matchValue) != null) {
73
+ const literalType = typ_1;
74
+ return new GlueType(8, [new GlueLiteral(0, [literalType.value])]);
75
+ }
76
+ else if ($007CHasTypeFlags$007C_$007C(256, matchValue) != null) {
77
+ const literalType_1 = typ_1;
78
+ return new GlueType(8, [Number.isSafeInteger(literalType_1.value) ? (new GlueLiteral(1, [literalType_1.value])) : (new GlueLiteral(2, [literalType_1.value]))]);
79
+ }
80
+ else {
81
+ return void 0;
82
+ }
83
+ }, toList(typ.types)))]);
84
+ }
85
+
86
+ export function UtilityType_readPartial(reader, typeReferenceNode) {
87
+ const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode);
88
+ const matchValue = typ.aliasTypeArguments;
89
+ if (matchValue != null) {
90
+ const aliasTypeArguments = matchValue;
91
+ if (aliasTypeArguments.length !== 1) {
92
+ return new GlueType(0, []);
93
+ }
94
+ else {
95
+ const symbol = aliasTypeArguments[0].symbol;
96
+ if ((symbol == null) ? true : (symbol.members == null)) {
97
+ return new GlueType(23, []);
98
+ }
99
+ else {
100
+ const patternInput = head(value_2(symbol.members).entries());
101
+ const originalType = value_2(patternInput[1].declarations)[0].parent;
102
+ if (originalType.kind === 264) {
103
+ const interfaceDeclaration = originalType;
104
+ const members = map((declaration) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration), toList(interfaceDeclaration.members));
105
+ return new GlueType(26, [new GlueUtilityType(0, [new GlueInterface(getFullNameOrEmpty(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), originalType), interfaceDeclaration.name.getText(), members, empty(), empty())])]);
106
+ }
107
+ else {
108
+ return new GlueType(0, []);
109
+ }
110
+ }
111
+ }
112
+ }
113
+ else {
114
+ return new GlueType(0, []);
115
+ }
116
+ }
117
+
118
+ export function UtilityType_readRecord(reader, typeReferenceNode) {
119
+ const typeArguments = readTypeArguments(reader, typeReferenceNode);
120
+ return new GlueType(26, [new GlueUtilityType(1, [new GlueRecord(item_1(0, typeArguments), item_1(1, typeArguments))])]);
121
+ }
122
+
27
123
  export function readTypeNode(reader, typeNode) {
28
124
  const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
29
125
  const matchValue = typeNode.kind | 0;
@@ -47,141 +143,61 @@ export function readTypeNode(reader, typeNode) {
47
143
  case 157:
48
144
  return new GlueType(3, [new GluePrimitive(8, [])]);
49
145
  case 159:
50
- return new GlueType(24, []);
146
+ return new GlueType(23, []);
51
147
  case 182:
52
148
  return new GlueType(3, [new GluePrimitive(3, [])]);
53
149
  case 183: {
54
150
  const typeReferenceNode = typeNode;
55
151
  const symbolOpt = checker.getSymbolAtLocation(typeReferenceNode.typeName);
56
- let fullName;
57
- if (symbolOpt != null) {
58
- const symbol = symbolOpt;
59
- fullName = checker.getFullyQualifiedName(symbol);
60
- }
61
- else {
62
- throw new Error(generateReaderError("type node", "Missing symbol", typeReferenceNode));
63
- }
64
- switch (fullName) {
65
- case "Exclude": {
66
- const typ = checker.getTypeFromTypeNode(typeReferenceNode);
67
- return new GlueType(7, [new GlueTypeUnion(choose((typ_1) => {
68
- const matchValue_1 = typ_1.flags | 0;
69
- if ($007CHasTypeFlags$007C_$007C(128, matchValue_1) != null) {
70
- const literalType = typ_1;
71
- return new GlueType(8, [new GlueLiteral(0, [literalType.value])]);
72
- }
73
- else if ($007CHasTypeFlags$007C_$007C(256, matchValue_1) != null) {
74
- const literalType_1 = typ_1;
75
- return new GlueType(8, [Number.isSafeInteger(literalType_1.value) ? (new GlueLiteral(1, [literalType_1.value])) : (new GlueLiteral(2, [literalType_1.value]))]);
76
- }
77
- else {
78
- return void 0;
79
- }
80
- }, toList(typ.types)))]);
152
+ const readTypeReference = (isStandardLibrary) => {
153
+ const matchValue_1 = value_2(symbolOpt).flags | 0;
154
+ if ($007CHasSymbolFlags$007C_$007C(262144, matchValue_1) != null) {
155
+ return new GlueType(16, [value_2(symbolOpt).name]);
81
156
  }
82
- case "Partial": {
83
- const typ_2 = checker.getTypeFromTypeNode(typeReferenceNode);
84
- const matchValue_2 = typ_2.aliasTypeArguments;
85
- if (matchValue_2 != null) {
86
- const aliasTypeArguments = matchValue_2;
87
- if (aliasTypeArguments.length !== 1) {
88
- return new GlueType(0, []);
89
- }
90
- else {
91
- const symbol_1 = aliasTypeArguments[0].symbol;
92
- if ((symbol_1 == null) ? true : (symbol_1.members == null)) {
93
- return new GlueType(24, []);
94
- }
95
- else {
96
- const patternInput = head(value_2(symbol_1.members).entries());
97
- const originalType = value_2(patternInput[1].declarations)[0].parent;
98
- if (originalType.kind === 264) {
99
- const interfaceDeclaration = originalType;
100
- const members = map((declaration) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration), toList(interfaceDeclaration.members));
101
- return new GlueType(14, [new GlueInterface(interfaceDeclaration.name.getText(), members, empty(), empty())]);
102
- }
103
- else {
104
- return new GlueType(0, []);
105
- }
106
- }
107
- }
108
- }
109
- else {
110
- return new GlueType(0, []);
111
- }
157
+ else {
158
+ return new GlueType(13, [new GlueTypeReference(typeReferenceNode.typeName.getText(), getFullNameOrEmpty(checker, typeReferenceNode.typeName), readTypeArguments(reader, typeReferenceNode), isStandardLibrary)]);
112
159
  }
113
- default: {
114
- const matchValue_4 = value_2(symbolOpt).flags | 0;
115
- if ($007CHasSymbolFlags$007C_$007C(262144, matchValue_4) != null) {
116
- return new GlueType(17, [value_2(symbolOpt).name]);
117
- }
118
- else {
119
- return new GlueType(13, [new GlueTypeReference(typeReferenceNode.typeName.getText(), fullName, readTypeArguments(reader, typeReferenceNode))]);
120
- }
160
+ };
161
+ if (isFromEs5Lib(symbolOpt)) {
162
+ const matchValue_2 = getFullNameOrEmpty(checker, typeReferenceNode.typeName);
163
+ switch (matchValue_2) {
164
+ case "Exclude":
165
+ return UtilityType_readExclude(reader, typeReferenceNode);
166
+ case "Partial":
167
+ return UtilityType_readPartial(reader, typeReferenceNode);
168
+ case "Record":
169
+ return UtilityType_readRecord(reader, typeReferenceNode);
170
+ default:
171
+ return readTypeReference(true);
121
172
  }
122
173
  }
174
+ else {
175
+ return readTypeReference(false);
176
+ }
123
177
  }
124
178
  case 184: {
125
179
  const functionTypeNode = typeNode;
126
- return new GlueType(16, [new GlueFunctionType(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](typeNode), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](functionTypeNode.type), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParametersZ17143B5B"](functionTypeNode.parameters))]);
180
+ return new GlueType(15, [new GlueFunctionType(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](typeNode), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](functionTypeNode.type), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParametersZ17143B5B"](functionTypeNode.parameters))]);
127
181
  }
128
182
  case 186: {
129
183
  const typeNodeQuery = typeNode;
130
- const typ_3 = checker.getTypeAtLocation(typeNodeQuery.exprName);
131
- const matchValue_5 = typ_3.flags | 0;
132
- if ($007CHasTypeFlags$007C_$007C(524288, matchValue_5) != null) {
133
- const matchValue_6 = typ_3.symbol.declarations;
134
- if (matchValue_6 == null) {
135
- return new GlueType(3, [new GluePrimitive(6, [])]);
136
- }
137
- else {
138
- const declarations = matchValue_6;
139
- const declaration_1 = declarations[0];
140
- const matchValue_7 = declaration_1.kind | 0;
141
- switch (matchValue_7) {
142
- case 263:
143
- return new GlueType(12, [new GlueClassDeclaration(typ_3.symbol.name, empty(), empty(), empty(), empty())]);
144
- case 267:
145
- return new GlueType(0, []);
146
- default:
147
- return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration_1);
148
- }
149
- }
150
- }
151
- else if ($007CHasTypeFlags$007C_$007C(4, matchValue_5) != null) {
152
- return new GlueType(3, [new GluePrimitive(0, [])]);
153
- }
154
- else if ($007CHasTypeFlags$007C_$007C(8, matchValue_5) != null) {
155
- return new GlueType(3, [new GluePrimitive(5, [])]);
156
- }
157
- else if ($007CHasTypeFlags$007C_$007C(16, matchValue_5) != null) {
158
- return new GlueType(3, [new GluePrimitive(3, [])]);
159
- }
160
- else if ($007CHasTypeFlags$007C_$007C(1, matchValue_5) != null) {
161
- return new GlueType(3, [new GluePrimitive(6, [])]);
162
- }
163
- else if ($007CHasTypeFlags$007C_$007C(16384, matchValue_5) != null) {
164
- return new GlueType(3, [new GluePrimitive(4, [])]);
165
- }
166
- else {
167
- return new GlueType(3, [new GluePrimitive(6, [])]);
168
- }
184
+ return readTypeUsingFlags(reader, checker.getTypeAtLocation(typeNodeQuery.exprName));
169
185
  }
170
186
  case 187: {
171
187
  const typeLiteralNode = typeNode;
172
- return new GlueType(22, [new GlueTypeLiteral(map((declaration_4) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_4), toList(typeLiteralNode.members)))]);
188
+ return new GlueType(21, [new GlueTypeLiteral(map((declaration_2) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_2), toList(typeLiteralNode.members)))]);
173
189
  }
174
190
  case 188: {
175
191
  const arrayTypeNode = typeNode;
176
- return new GlueType(15, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](arrayTypeNode.elementType)]);
192
+ return new GlueType(14, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](arrayTypeNode.elementType)]);
177
193
  }
178
194
  case 189: {
179
195
  const tupleTypeNode = typeNode;
180
- return new GlueType(19, [map((element) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](element), toList(tupleTypeNode.elements))]);
196
+ return new GlueType(18, [map((element) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](element), toList(tupleTypeNode.elements))]);
181
197
  }
182
198
  case 190: {
183
199
  const optionalTypeNode = typeNode;
184
- return new GlueType(23, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](optionalTypeNode.type)]);
200
+ return new GlueType(22, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](optionalTypeNode.type)]);
185
201
  }
186
202
  case 192:
187
203
  return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadUnionTypeNodeZ5A082EC2"](typeNode);
@@ -189,14 +205,14 @@ export function readTypeNode(reader, typeNode) {
189
205
  const intersectionTypeNode = typeNode;
190
206
  const unionOrIntersectionType = checker.getTypeAtLocation(intersectionTypeNode);
191
207
  const properties = choose((property) => {
192
- const matchValue_9 = property.declarations;
193
- if (matchValue_9 == null) {
208
+ const matchValue_4 = property.declarations;
209
+ if (matchValue_4 == null) {
194
210
  throw new Error(generateReaderError("type node", "Missing declarations", typeNode));
195
211
  }
196
212
  else {
197
- const declarations_1 = matchValue_9;
198
- if (declarations_1.length === 1) {
199
- return new IntersectionTypePropertyResult(0, [declarations_1[0]]);
213
+ const declarations = matchValue_4;
214
+ if (declarations.length === 1) {
215
+ return new IntersectionTypePropertyResult(0, [declarations[0]]);
200
216
  }
201
217
  else {
202
218
  return new IntersectionTypePropertyResult(1, []);
@@ -222,7 +238,7 @@ export function readTypeNode(reader, typeNode) {
222
238
  return new GlueType(3, [new GluePrimitive(6, [])]);
223
239
  }
224
240
  else {
225
- return new GlueType(21, [choose((_arg) => {
241
+ return new GlueType(20, [choose((_arg) => {
226
242
  if (_arg.tag === 1) {
227
243
  throw new Error("Sould not happen here");
228
244
  }
@@ -232,14 +248,38 @@ export function readTypeNode(reader, typeNode) {
232
248
  }, properties)]);
233
249
  }
234
250
  }
251
+ case 194: {
252
+ const conditionalTypeNode = typeNode;
253
+ const matchValue_6 = readTypeUsingFlags(reader, checker.getTypeAtLocation(conditionalTypeNode));
254
+ let matchResult, forward;
255
+ if (matchValue_6.tag === 3) {
256
+ if (matchValue_6.fields[0].tag === 6) {
257
+ matchResult = 0;
258
+ }
259
+ else {
260
+ matchResult = 1;
261
+ forward = matchValue_6;
262
+ }
263
+ }
264
+ else {
265
+ matchResult = 1;
266
+ forward = matchValue_6;
267
+ }
268
+ switch (matchResult) {
269
+ case 0:
270
+ return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](conditionalTypeNode.checkType);
271
+ default:
272
+ return forward;
273
+ }
274
+ }
235
275
  case 196: {
236
276
  const parenthesizedTypeNode = typeNode;
237
277
  return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](parenthesizedTypeNode.type);
238
278
  }
239
279
  case 197: {
240
280
  const thisTypeNode = typeNode;
241
- const typ_4 = checker.getTypeAtLocation(thisTypeNode);
242
- return new GlueType(18, [typ_4.symbol.name]);
281
+ const typ_1 = checker.getTypeAtLocation(thisTypeNode);
282
+ return new GlueType(17, [typ_1.symbol.name]);
243
283
  }
244
284
  case 198: {
245
285
  const typeOperatorNode = typeNode;
@@ -247,19 +287,22 @@ export function readTypeNode(reader, typeNode) {
247
287
  }
248
288
  case 201: {
249
289
  const literalTypeNode = typeNode;
250
- const matchValue_8 = tryReadLiteral(literalTypeNode.literal);
251
- if (matchValue_8 == null) {
290
+ const matchValue_3 = tryReadLiteral(literalTypeNode.literal);
291
+ if (matchValue_3 == null) {
252
292
  throw new Error(generateReaderError("type node - literal type", "Could not read literal type", typeNode));
253
293
  }
254
294
  else {
255
- return new GlueType(8, [matchValue_8]);
295
+ return new GlueType(8, [matchValue_3]);
256
296
  }
257
297
  }
258
298
  case 202:
259
299
  return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNamedTupleMemberZ6E17C942"](typeNode);
300
+ case 203:
301
+ return new GlueType(25, []);
260
302
  case 233: {
261
303
  const expression = typeNode;
262
- return new GlueType(13, [new GlueTypeReference(expression.expression.getText(), getFullNameOrEmpty(checker, expression), readTypeArguments(reader, expression))]);
304
+ const symbolOpt_1 = checker.getSymbolAtLocation(expression.expression);
305
+ return new GlueType(13, [new GlueTypeReference(expression.expression.getText(), getFullNameOrEmpty(checker, expression.expression), readTypeArguments(reader, expression), isFromEs5Lib(symbolOpt_1))]);
263
306
  }
264
307
  default: {
265
308
  const item = generateReaderError("type node", toText(interpolate("Unsupported kind %A%P()", [typeNode.kind])), typeNode);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeNode.fs"],"names":["checker","reader","matchValue","typeNode","typeReferenceNode","symbolOpt","fullName","symbol","typ","literalType","aliasTypeArguments","patternInput","originalType","interfaceDeclaration","members","declaration","functionTypeNode","typeNodeQuery","declarations","typeLiteralNode","arrayTypeNode","tupleTypeNode","element","optionalTypeNode","intersectionTypeNode","unionOrIntersectionType","properties","property","_arg1","parenthesizedTypeNode","thisTypeNode","typeOperatorNode","literalTypeNode","expression","item","objectArg"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBQA,oBAAU,AAAAC;AAERC,uBAAA,AAAAC;YAAAD;aAAA;AAMyB,mBAAA,iBAAmB;aAN5C;AAGyB,mBAAA,iBAAmB;aAH5C;AAKwB,mBAAA,iBAAmB;aAL3C;AAI4B,mBAAA,iBAAmB;aAJ/C;AAC2B,mBAAA,iBAAmB;aAD9C;AAyT2B,mBAAA,iBAAmB;aAzT9C;AAE2B,mBAAA,iBAAmB;aAF9C;AA8T2B,mBAAA,iBAAmB;aA9T9C;AAQF,mBAAA,iBAAmB;aARjB;AAuT4B,mBAAA;aAvT5B;AAqI2B,mBAAA,iBAAmB;aArI9C;AAaEE,sCAAoBD;AAEpBE,8BAAY,AAAAL,4BAA8B,AAAAI;AAE1CE;AACM,gBAAA,AAAAD;AAOCE,\u002BBAAUF;AAAA,AARjBC,2BAQiB,AAAAN,8BAA8BO;;;AADxC,gCAJH,oBACI,aACA,kBACAH;;oBAMTE;qBAAW;AACNE,gCACA,AAAAR,4BAA4BI;AAgCN,2BAAA,iBAAjB,kBA1BF;AACOF,6CAAA,AAAAM;AACJ,4BADI,AACJ,6BAAa,KADTN;AAEEO,gDAAcD;AAIU,mCAAA,iBAA5B,oBAF0B,AAAAC;;6BAG5B,IAPI,AAOJ,6BAAa,KAPTP;AAQEO,kDAAcD;AAaT,mCAAA,iBAVL,AACI,qBACI,AAAAC,wBAEJ,oBAA2B,AAAAA,0BAE3B,oBACiB,AAAAA;;;AAItB,mCAAA;;uBAxBR,OADH,AAAAD;;qBA8BW;AACXA,kCAAM,AAAAR,4BAA4BI;AAOhCF,yCAAA,AAAAM;AAAA,wBAAA,A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AtRF;AAySEG,0CAAwB1B;AAE5B,mBAAA,AAAAF,iFAAoB,AAAA4B;;aA3SlB;AA0MEC,iCAAe3B;AAMfK,0BAAM,AAAAR,0BAA0B8B;AAEpC,mBAAA,kBAAkB,AAAAtB;;aAlNhB;AAmTEuB,qCAAmB5B;AAEvB,mBAAA,AAAAF,0FAA4B8B;;aArT1B;AA0LEC,oCAAkB7B;AAKhBD,iCAAA,eAF0B,AAAA8B;AAE1B,gBAAA,AAAA9B;AAGF,gCACI,oBACI,4BACA,\u002BBACAC;;;AANM,uBAAA,iBAAAD;;;aAhMhB;AA4TF,mBAAA,AAAAD,0FAA4BE;aA5T1B;AAiUE8B,\u002BBAAa9B;AAOd,mBAAA,kBALF,sBACU,AAAA8B,iCACI,mBAAmBjC,SAAQiC,aACtB,kBAAkBhC,QAAOgC;;;AAS1CC,yBAJH,oBACI,aACA,OAAA,YAAA,4BAAsB,AAAA/B,kBACtBA;AACDgC,8BAAA,AAAAlC;AAAA,kBAAAkC,eAAAD;AAEH,mBAAA,iBAAmB","file":null,"sourcesContent":null,"sourceRoot":null}
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeNode.fs"],"names":["matchValue","typ","declarations","declaration","reader","typeReferenceNode","literalType","aliasTypeArguments","symbol","patternInput","originalType","interfaceDeclaration","members","typeArguments","checker","typeNode","symbolOpt","readTypeReference","isStandardLibrary","readExclude","readPartial","readRecord","functionTypeNode","typeNodeQuery","readTypeUsingFlags","typeLiteralNode","arrayTypeNode","tupleTypeNode","element","optionalTypeNode","intersectionTypeNode","unionOrIntersectionType","properties","property","_arg1","conditionalTypeNode","forward","parenthesizedTypeNode","thisTypeNode","typeOperatorNode","literalTypeNode","expression","item","objectArg"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAeUA,uBAAA,AAAAC;AACJ,QADI,AACJ,6BAAa,QADTD;AAGIA,6BAAA,AAAAC;AAAA,YAAA,AAAAD;AAoBI,mBAAA,iBAAmB;;;AAnBtB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wB,mBAAmBpB,QARf,AAAAU,0BAA0BqB;6BAWlCC;AAHI,gBAAA,AAAApC;AAAA,oBAAA,AACJA;;;;;AAEAoC,8BAHIpC;;;;;AAGJoC,0BAHIpC;;;;AAEF,2BAAA,AAAAI,iFAAoB,AAAA\u002BB;;2BACXC;;;aAvOX;AAoLEC,0CAAwBtB;AAE5B,mBAAA,AAAAX,iFAAoB,AAAAiC;;aAtLlB;AAqFEC,iCAAevB;AAMfd,0BAAM,AAAAa,0BAA0BwB;AAEpC,mBAAA,kBAAkB,AAAArC;;aA7FhB;AA8LEsC,qCAAmBxB;AAEvB,mBAAA,AAAAX,0FAA4BmC;;aAhM1B;AAqEEC,oCAAkBzB;AAKhBf,iCAAA,eAF0B,AAAAwC;AAE1B,gBAAA,AAAAxC;AAGF,gCACI,oBACI,4BACA,\u002BBACAe;;;AANM,uBAAA,iBAAAf;;;aA3EhB;AAuMF,mBAAA,AAAAI,0FAA4BW;aAvM1B;AAyOiC,mBAAA;aAzOjC;AA4ME0B,\u002BBAAa1B;AAEbC,gCAAY,AAAAF,4BAA6B,AAAA2B;AAS1C,mBAAA,kBANF,sBACU,AAAAA,iCACI,mBAAmB3B,SAAQ,AAAA2B,wBACtB,kBAAkBrC,QAAOqC,aACrB,aAAazB;;;AA2BlC0B,yBAJH,oBACI,aACA,OAAA,YAAA,4BAAsB,AAAA3B,kBACtBA;AACD4B,8BAAA,AAAAvC;AAAA,kBAAAuC,eAAAD;AAEH,mBAAA,iBAAmB","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -1,10 +1,11 @@
1
1
  import { empty, map } from "../../fable_modules/fable-library-js.4.14.0/List.js";
2
+ import { map as map_1 } from "../../fable_modules/fable-library-js.4.14.0/Option.js";
2
3
  import { GlueTypeParameter } from "../GlueAST.js";
3
4
  import { toList } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
4
5
 
5
6
  export function readTypeParameters(reader, typeParameters) {
6
7
  if (typeParameters != null) {
7
- return map((typeParameter) => (new GlueTypeParameter(typeParameter.name.getText(), void 0, void 0)), toList(typeParameters));
8
+ return map((typeParameter) => (new GlueTypeParameter(typeParameter.name.getText(), map_1((typNode) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode), typeParameter.constraint), void 0)), toList(typeParameters));
8
9
  }
9
10
  else {
10
11
  return empty();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeParameters.fs"],"names":["typeParameters","typeParameter"],"mappings":";;;;;AAYU,QAAA,AAAAA;AAKC,eAAA,wBACC,sBACW,AAAAC,8BACM,QACH,UALf,OADHD;;;AAFM,eAAA","file":null,"sourcesContent":null,"sourceRoot":null}
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeParameters.fs"],"names":["typeParameters","typeParameter","reader","typNode"],"mappings":";;;;;;AAWU,QAAA,AAAAA;AAKC,eAAA,wBACC,sBACW,AAAAC,8BAGA,mBAAW,AAAAC,iFAAAC,UADd,AAAAF,2BAEM,UAPf,OADHD;;;AAFM,eAAA","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -23,6 +23,7 @@ export class TypeScriptReader {
23
23
  constructor(checker) {
24
24
  this["checker@25"] = checker;
25
25
  this.warnings = [];
26
+ this.typeMemory = [];
26
27
  }
27
28
  "Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"() {
28
29
  const _ = this;
@@ -32,6 +33,10 @@ export class TypeScriptReader {
32
33
  const _ = this;
33
34
  return _.warnings;
34
35
  }
36
+ "Glutinum.Converter.Reader.Types.ITypeScriptReader.get_TypeMemory"() {
37
+ const _ = this;
38
+ return _.typeMemory;
39
+ }
35
40
  "Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadClassDeclarationZ4558F325"(classDeclaration) {
36
41
  const this$ = this;
37
42
  return readClassDeclaration(this$, classDeclaration);
@@ -54,7 +59,9 @@ export class TypeScriptReader {
54
59
  }
55
60
  "Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"(node) {
56
61
  const this$ = this;
57
- return readNode(this$, node);
62
+ const typ = readNode(this$, node);
63
+ void (this$.typeMemory.push(typ));
64
+ return typ;
58
65
  }
59
66
  "Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeAliasDeclarationZ7FA16745"(typeAliasDeclaration) {
60
67
  const this$ = this;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeScriptReader.fs"],"names":["checker","_","this","classDeclaration","enumDeclaration","functionDeclaration","interfaceDeclaration","moduleDeclaration","node","typeAliasDeclaration","typNode","variableStatement","declaration","parameters","unionType","typeParametersOpt","exportAssignment","namedTupleMember"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBsB,6BAAAA;AAClB;;;AAIaC,kBAAAA;AAA4B,eAAA,AAAAA;;;AAE9BA,kBAAAA;AAAa,eAAA,AAAAA;;;AAEbC,sBAAAA;AAIH,eAAA,qBAAqBA,OAAKC;;;AAEvBD,sBAAAA;AAIyC,eAAA,iBAA5C,oBAAoBA,OAAKE;;;AAEtBF,sBAAAA;AAKA,eAAA,iBADH,wBAAwBA,OAAKG;;;AAG1BH,sBAAAA;AAKA,eAAA,iBADH,yBAAyBA,OAAKI;;;AAG3BJ,sBAAAA;AAKA,eAAA,kBADH,sBAAsBA,OAAKK;;;AAGxBL,sBAAAA;AAA0C,eAAA,SAASA,OAAKM;;;AAExDN,sBAAAA;AAIH,eAAA,yBAAyBA,OAAKO;;;AAE3BP,sBAAAA;AACH,eAAA,AAACA,iFAA6CQ;;;AAE3CR,sBAAAA;AACG,eAAA,CAAA,AAAAQ,oBAEI,iBAAmB,8BADX,aAAaR,OAAbQ;;;AAGfR,sBAAAA;AAIH,eAAA,sBAAsBA,OAAKS;;;AAExBT,sBAAAA;AACH,eAAA,gBAAgBA,OAAKU;;;AAElBV,sBAAAA;AAIH,eAAA,eAAeA,OAAKW;;;AAEjBX,sBAAAA;AACH,eAAA,kBAAkBA,OAAKY;;;AAEpBZ,sBAAAA;AACH,eAAA,qBAAqBA,OAAKM;;;AAEvBN,sBAAAA;AAIH,eAAA,sBAAsBA,OAAKU;;;AAExBV,sBAAAA;AAIH,eAAA,mBAAmBA,OAAKa;;;AAErBb,sBAAAA;AAIH,eAAA,qBAAqBA,OAAKc;;;AAEvBd,sBAAAA;AAIH,eAAA,8BAA8BA,OAAKU;;;AAEhCV,sBAAAA;AAIH,eAAA,yBAAyBA,OAAKM;;;AAE3BN,sBAAAA;AAIH,eAAA,qBAAqBA,OAAKe","file":null,"sourcesContent":null,"sourceRoot":null}
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeScriptReader.fs"],"names":["checker","_","this","classDeclaration","enumDeclaration","functionDeclaration","interfaceDeclaration","moduleDeclaration","typ","node","typeAliasDeclaration","typNode","variableStatement","declaration","parameters","unionType","typeParametersOpt","exportAssignment","namedTupleMember"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBsB,6BAAAA;AAClB;AAKA;;;AAIaC,kBAAAA;AAA4B,eAAA,AAAAA;;;AAE9BA,kBAAAA;AAAa,eAAA,AAAAA;;;AAEbA,kBAAAA;AAAe,eAAA,AAAAA;;;AAEfC,sBAAAA;AAIH,eAAA,qBAAqBA,OAAKC;;;AAEvBD,sBAAAA;AAIyC,eAAA,iBAA5C,oBAAoBA,OAAKE;;;AAEtBF,sBAAAA;AAKA,eAAA,iBADH,wBAAwBA,OAAKG;;;AAG1BH,sBAAAA;AAKA,eAAA,iBADH,yBAAyBA,OAAKI;;;AAG3BJ,sBAAAA;AAKA,eAAA,kBADH,sBAAsBA,OAAKK;;;AAGxBL,sBAAAA;AACCM,oBAAM,SAASN,OAAKO;AACxB,cAAA,AAAAP,sBAAeM;eACfA;;;AAEGN,sBAAAA;AAIH,eAAA,yBAAyBA,OAAKQ;;;AAE3BR,sBAAAA;AACH,eAAA,AAACA,iFAA6CS;;;AAE3CT,sBAAAA;AACG,eAAA,CAAA,AAAAS,oBAEI,iBAAmB,8BADX,aAAaT,OAAbS;;;AAGfT,sBAAAA;AAIH,eAAA,sBAAsBA,OAAKU;;;AAExBV,sBAAAA;AACH,eAAA,gBAAgBA,OAAKW;;;AAElBX,sBAAAA;AAIH,eAAA,eAAeA,OAAKY;;;AAEjBZ,sBAAAA;AACH,eAAA,kBAAkBA,OAAKa;;;AAEpBb,sBAAAA;AACH,eAAA,qBAAqBA,OAAKO;;;AAEvBP,sBAAAA;AAIH,eAAA,sBAAsBA,OAAKW;;;AAExBX,sBAAAA;AAIH,eAAA,mBAAmBA,OAAKc;;;AAErBd,sBAAAA;AAIH,eAAA,qBAAqBA,OAAKe;;;AAEvBf,sBAAAA;AAIH,eAAA,8BAA8BA,OAAKW;;;AAEhCX,sBAAAA;AAIH,eAAA,yBAAyBA,OAAKO;;;AAE3BP,sBAAAA;AAIH,eAAA,qBAAqBA,OAAKgB","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -1,7 +1,7 @@
1
1
  import typescript from "typescript";
2
2
  import { map, empty, singleton, choose, concat } from "../../fable_modules/fable-library-js.4.14.0/List.js";
3
3
  import { defaultArgWith } from "../../fable_modules/fable-library-js.4.14.0/Option.js";
4
- import { $007CHasTypeFlags$007C_$007C, generateReaderError, tryReadLiteral } from "./Utils.js";
4
+ import { isFromEs5Lib, $007CHasTypeFlags$007C_$007C, generateReaderError, tryReadLiteral } from "./Utils.js";
5
5
  import { GlueTypeUnion, GlueTypeReference, GluePrimitive, GlueType } from "../GlueAST.js";
6
6
  import { toList } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
7
7
 
@@ -44,7 +44,8 @@ function readUnionTypeCases(reader, unionTypeNode) {
44
44
  }
45
45
  else if (typescript.isTypeReferenceNode(node_1)) {
46
46
  const typeReferenceNode = node_1;
47
- const symbol = defaultArgWith(checker.getSymbolAtLocation(typeReferenceNode.typeName), () => {
47
+ const symbolOpt = checker.getSymbolAtLocation(typeReferenceNode.typeName);
48
+ const symbol = defaultArgWith(symbolOpt, () => {
48
49
  throw new Error(generateReaderError("union type cases", "Missing symbol", typeReferenceNode));
49
50
  });
50
51
  const matchValue_1 = symbol.declarations;
@@ -65,7 +66,10 @@ function readUnionTypeCases(reader, unionTypeNode) {
65
66
  }
66
67
  else if (declarations.length > 1) {
67
68
  const fullName = checker.getFullyQualifiedName(symbol);
68
- return singleton(new GlueType(13, [new GlueTypeReference(typeReferenceNode.getText(), fullName, empty())]));
69
+ return singleton(new GlueType(13, [new GlueTypeReference(typeReferenceNode.getText(), fullName, empty(), isFromEs5Lib(symbolOpt))]));
70
+ }
71
+ else if (isFromEs5Lib(symbolOpt)) {
72
+ return singleton(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeReferenceNode));
69
73
  }
70
74
  else {
71
75
  const declaration = declarations[0];
@@ -73,8 +77,7 @@ function readUnionTypeCases(reader, unionTypeNode) {
73
77
  return singleton(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration));
74
78
  }
75
79
  else {
76
- const fullName_1 = checker.getFullyQualifiedName(symbol);
77
- return singleton(new GlueType(13, [new GlueTypeReference(typeReferenceNode.getText(), fullName_1, empty())]));
80
+ return singleton(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeReferenceNode));
78
81
  }
79
82
  }
80
83
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/UnionTypeNode.fs"],"names":["checker","reader","removeParenthesizedType","node","parenthesizedTypeNode","literalTypeNode","literalExpression","matchValue","typeReferenceNode","symbol","typ","declarations","fullName","declaration","readUnionTypeCases","unionTypeNode"],"mappings":";;;;;;;;AAaQA,oBAAU,AAAAC;AAMNC;;;kBAAyBC;AAC7B,gBAAG,mCAA2BA;AACtBC,8CAAwBD;2BAEJ,AAAAC;AAAxB;;;uBAEAD;;;;;AAmIL,WAAA,kBADA,OA5HA;AACC,YAAG,6BAAqBA;AAChBE,oCAAkBF;AAElBG,sCAC4B,AAAAD;AAEhC,gBACI,2BAAmBC,qBAAnB,OACG,4BAAoBA;AAOR,uBAAA,UADZ,iBAHA,eADH,eAAeA;AAEX,oCAAS;;;;AAMPC,mCAAA,AAAAD;wBAAAC;yBAAA;yBAAA;AAIC,\u002BBAAA,UADH,iBAAmB;;AAGhB,\u002BBAAA;;;;aACV,IAAG,\u002BBAAuBJ;AACvBK,sCAAoBL;AAOpBM,2BACA,eAHA,AAAAT,4BAA8B,AAAAQ;AAKtB,gCACI,oBACI,oBACA,kBACAA;;AAOdD,iCAAA,AAAAE;AAAA,gBAAA,AAAAF;AAoCEG,4BAAM,AAAAV,wBAAwBS;AAE5BF,qCAAA,AAAAG;AACJ,oBADI,AACJ,6BAAa,GADTH;AAGC,2BAAA,UADH,iBAAmB;;;AAInB,oCACI,oBACI,oBACA,yFACAC;;;;AA/CTG,qCACHJ;AAAA,oBAAG,AAAAI,wBAAqB;AACpB,2BAAA;;qBACC,IAAG,AAAAA,sBAAqB;AACrBC,qCAAW,AAAAZ,8BAA8BS;AAQ1C,2BAAA,UADA,kBALF,sBACU,AAAAD,6BACII,UACK;;;AAMhBC,wCAAc,AAAAF,aAAc;AAG1B,wBAAA,AAAAE,qBAAA;AAE6B,\u002BBAAA,UAA/B,AAAAZ,6EAAgBY;;;AAGZD,2CAAW,AAAAZ,8BAA8BS;AAQ1C,\u002BBAAA,UADA,kBALF,sBACU,AAAAD,6BACII,YACK;;;;;aAiC1B,IAAA,AAAAT,gBAAA;AAIE,mBAAA,AACA,AAAAW,mBAAmBb,QAHHE;;;AASjB,mBAAA,UADH,AAAAF,iFAAoBE;;OAzH7B,IAASD,yBAFT,OADH,AAAAa;;;;WAwI2C,iBAA3C,AAAAD,mBAAmBb,QAAOc","file":null,"sourcesContent":null,"sourceRoot":null}
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/UnionTypeNode.fs"],"names":["checker","reader","removeParenthesizedType","node","parenthesizedTypeNode","literalTypeNode","literalExpression","matchValue","typeReferenceNode","symbolOpt","symbol","typ","declarations","fullName","declaration","readUnionTypeCases","unionTypeNode"],"mappings":";;;;;;;;AAaQA,oBAAU,AAAAC;AAMNC;;;kBAAyBC;AAC7B,gBAAG,mCAA2BA;AACtBC,8CAAwBD;2BAEJ,AAAAC;AAAxB;;;uBAEAD;;;;;AAsHL,WAAA,kBADA,OA/GA;AACC,YAAG,6BAAqBA;AAChBE,oCAAkBF;AAElBG,sCAC4B,AAAAD;AAEhC,gBACI,2BAAmBC,qBAAnB,OACG,4BAAoBA;AAOR,uBAAA,UADZ,iBAHA,eADH,eAAeA;AAEX,oCAAS;;;;AAMPC,mCAAA,AAAAD;wBAAAC;yBAAA;yBAAA;AAIC,\u002BBAAA,UADH,iBAAmB;;AAGhB,\u002BBAAA;;;;aACV,IAAG,\u002BBAAuBJ;AACvBK,sCAAoBL;AAEpBM,8BACA,AAAAT,4BAA8B,AAAAQ;AAE9BE,2BACA,eASID;AAPI,gCACI,oBACI,oBACA,kBACAD;;AAOdD,iCAAA,AAAAG;AAAA,gBAAA,AAAAH;AAmCEI,4BAAM,AAAAX,wBAAwBU;AAE5BH,qCAAA,AAAAI;AACJ,oBADI,AACJ,6BAAa,GADTJ;AAGC,2BAAA,UADH,iBAAmB;;;AAInB,oCACI,oBACI,oBACA,yFACAC;;;;AA9CTI,qCACHL;AAAA,oBAAG,AAAAK,wBAAqB;AACpB,2BAAA;;qBACC,IAAG,AAAAA,sBAAqB;AACrBC,qCAAW,AAAAb,8BAA8BU;AAS1C,2BAAA,UADA,kBANF,sBACU,AAAAF,6BACIK,UACK,SACI,aAAaJ;;qBAKpC,IAAG,aAAaA;AAEd,2BAAA,UADH,AAAAR,iFAAoBO;;;AAKhBM,wCAAc,AAAAF,aAAc;AAG1B,wBAAA,AAAAE,qBAAA;AAE6B,\u002BBAAA,UAA/B,AAAAb,6EAAgBa;;;AAIb,\u002BBAAA,UADH,AAAAb,iFAAoBO;;;;;aAqB1B,IAAA,AAAAL,gBAAA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