@glutinum/cli 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -7
- package/dist/Glutinum.Converter/FsharpAST.js +152 -20
- package/dist/Glutinum.Converter/FsharpAST.js.map +1 -1
- package/dist/Glutinum.Converter/Generate.js +17 -5
- package/dist/Glutinum.Converter/Generate.js.map +1 -1
- package/dist/Glutinum.Converter/GlueAST.js +97 -17
- package/dist/Glutinum.Converter/GlueAST.js.map +1 -1
- package/dist/Glutinum.Converter/Log.js +9 -5
- package/dist/Glutinum.Converter/Log.js.map +1 -1
- package/dist/Glutinum.Converter/Printer.js +486 -132
- package/dist/Glutinum.Converter/Printer.js.map +1 -1
- package/dist/Glutinum.Converter/Read.js +8 -5
- package/dist/Glutinum.Converter/Read.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +14 -6
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js +50 -0
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +1 -0
- package/dist/Glutinum.Converter/Reader/Documentation.js +119 -0
- package/dist/Glutinum.Converter/Reader/Documentation.js.map +1 -0
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +9 -8
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +42 -0
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +1 -0
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +13 -4
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +4 -2
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +3 -3
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +3 -3
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Node.js +23 -11
- package/dist/Glutinum.Converter/Reader/Node.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Parameters.js +3 -3
- package/dist/Glutinum.Converter/Reader/Parameters.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +5 -5
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js +150 -18
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +28 -21
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js +2 -2
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +102 -77
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +14 -8
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Utils.js +73 -7
- package/dist/Glutinum.Converter/Reader/Utils.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +13 -7
- package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +1 -1
- package/dist/Glutinum.Converter/Transform.js +559 -193
- package/dist/Glutinum.Converter/Transform.js.map +1 -1
- package/dist/Glutinum.Converter/TypeScript.js +1 -1
- package/dist/Glutinum.Converter/Utils/Keywords.js +3 -3
- package/dist/Glutinum.Converter/Utils/List.js +62 -0
- package/dist/Glutinum.Converter/Utils/List.js.map +1 -0
- package/dist/Glutinum.Converter/Utils/Naming.js +73 -6
- package/dist/Glutinum.Converter/Utils/Naming.js.map +1 -1
- package/dist/Glutinum.Converter/Utils/String.js +6 -1
- package/dist/Glutinum.Converter/Utils/String.js.map +1 -1
- package/dist/Program.js +9 -10
- package/dist/Program.js.map +1 -1
- package/package.json +22 -3
- package/dist/Glutinum.Converter/Reader/NamedDeclaration.js +0 -36
- package/dist/Glutinum.Converter/Reader/NamedDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Types.js +0 -16
- package/dist/Glutinum.Converter/Reader/Types.js.map +0 -1
- package/dist/fable_modules/fable-library.4.5.0/Array.d.ts +0 -120
- package/dist/fable_modules/fable-library.4.5.0/Array.js +0 -1204
- package/dist/fable_modules/fable-library.4.5.0/Async.d.ts +0 -32
- package/dist/fable_modules/fable-library.4.5.0/Async.js +0 -158
- package/dist/fable_modules/fable-library.4.5.0/AsyncBuilder.d.ts +0 -59
- package/dist/fable_modules/fable-library.4.5.0/AsyncBuilder.js +0 -183
- package/dist/fable_modules/fable-library.4.5.0/BigInt.d.ts +0 -115
- package/dist/fable_modules/fable-library.4.5.0/BigInt.js +0 -282
- package/dist/fable_modules/fable-library.4.5.0/BitConverter.d.ts +0 -27
- package/dist/fable_modules/fable-library.4.5.0/BitConverter.js +0 -138
- package/dist/fable_modules/fable-library.4.5.0/Boolean.d.ts +0 -3
- package/dist/fable_modules/fable-library.4.5.0/Boolean.js +0 -21
- package/dist/fable_modules/fable-library.4.5.0/CHANGELOG.md +0 -11
- package/dist/fable_modules/fable-library.4.5.0/Char.d.ts +0 -65
- package/dist/fable_modules/fable-library.4.5.0/Char.js +0 -169
- package/dist/fable_modules/fable-library.4.5.0/Choice.d.ts +0 -138
- package/dist/fable_modules/fable-library.4.5.0/Choice.js +0 -227
- package/dist/fable_modules/fable-library.4.5.0/Date.d.ts +0 -70
- package/dist/fable_modules/fable-library.4.5.0/Date.js +0 -451
- package/dist/fable_modules/fable-library.4.5.0/DateOffset.d.ts +0 -63
- package/dist/fable_modules/fable-library.4.5.0/DateOffset.js +0 -268
- package/dist/fable_modules/fable-library.4.5.0/DateOnly.d.ts +0 -18
- package/dist/fable_modules/fable-library.4.5.0/DateOnly.js +0 -124
- package/dist/fable_modules/fable-library.4.5.0/Decimal.d.ts +0 -45
- package/dist/fable_modules/fable-library.4.5.0/Decimal.js +0 -212
- package/dist/fable_modules/fable-library.4.5.0/Double.d.ts +0 -11
- package/dist/fable_modules/fable-library.4.5.0/Double.js +0 -46
- package/dist/fable_modules/fable-library.4.5.0/Encoding.d.ts +0 -12
- package/dist/fable_modules/fable-library.4.5.0/Encoding.js +0 -173
- package/dist/fable_modules/fable-library.4.5.0/Event.d.ts +0 -31
- package/dist/fable_modules/fable-library.4.5.0/Event.js +0 -93
- package/dist/fable_modules/fable-library.4.5.0/FSharp.Collections.d.ts +0 -7
- package/dist/fable_modules/fable-library.4.5.0/FSharp.Collections.js +0 -27
- package/dist/fable_modules/fable-library.4.5.0/FSharp.Core.d.ts +0 -17
- package/dist/fable_modules/fable-library.4.5.0/FSharp.Core.js +0 -69
- package/dist/fable_modules/fable-library.4.5.0/Global.d.ts +0 -24
- package/dist/fable_modules/fable-library.4.5.0/Global.js +0 -8
- package/dist/fable_modules/fable-library.4.5.0/Guid.d.ts +0 -10
- package/dist/fable_modules/fable-library.4.5.0/Guid.js +0 -142
- package/dist/fable_modules/fable-library.4.5.0/Int32.d.ts +0 -28
- package/dist/fable_modules/fable-library.4.5.0/Int32.js +0 -135
- package/dist/fable_modules/fable-library.4.5.0/List.d.ts +0 -143
- package/dist/fable_modules/fable-library.4.5.0/List.js +0 -1273
- package/dist/fable_modules/fable-library.4.5.0/Long.d.ts +0 -3
- package/dist/fable_modules/fable-library.4.5.0/Long.js +0 -46
- package/dist/fable_modules/fable-library.4.5.0/MailboxProcessor.d.ts +0 -25
- package/dist/fable_modules/fable-library.4.5.0/MailboxProcessor.js +0 -93
- package/dist/fable_modules/fable-library.4.5.0/Map.d.ts +0 -178
- package/dist/fable_modules/fable-library.4.5.0/Map.js +0 -1396
- package/dist/fable_modules/fable-library.4.5.0/MapUtil.d.ts +0 -10
- package/dist/fable_modules/fable-library.4.5.0/MapUtil.js +0 -112
- package/dist/fable_modules/fable-library.4.5.0/MutableMap.d.ts +0 -52
- package/dist/fable_modules/fable-library.4.5.0/MutableMap.js +0 -326
- package/dist/fable_modules/fable-library.4.5.0/MutableSet.d.ts +0 -39
- package/dist/fable_modules/fable-library.4.5.0/MutableSet.js +0 -232
- package/dist/fable_modules/fable-library.4.5.0/Native.d.ts +0 -2
- package/dist/fable_modules/fable-library.4.5.0/Native.js +0 -8
- package/dist/fable_modules/fable-library.4.5.0/Numeric.d.ts +0 -19
- package/dist/fable_modules/fable-library.4.5.0/Numeric.js +0 -71
- package/dist/fable_modules/fable-library.4.5.0/Observable.d.ts +0 -32
- package/dist/fable_modules/fable-library.4.5.0/Observable.js +0 -113
- package/dist/fable_modules/fable-library.4.5.0/Option.d.ts +0 -28
- package/dist/fable_modules/fable-library.4.5.0/Option.js +0 -96
- package/dist/fable_modules/fable-library.4.5.0/README.md +0 -3
- package/dist/fable_modules/fable-library.4.5.0/Random.d.ts +0 -37
- package/dist/fable_modules/fable-library.4.5.0/Random.js +0 -170
- package/dist/fable_modules/fable-library.4.5.0/Range.d.ts +0 -12
- package/dist/fable_modules/fable-library.4.5.0/Range.js +0 -45
- package/dist/fable_modules/fable-library.4.5.0/Reflection.d.ts +0 -119
- package/dist/fable_modules/fable-library.4.5.0/Reflection.js +0 -461
- package/dist/fable_modules/fable-library.4.5.0/RegExp.d.ts +0 -10
- package/dist/fable_modules/fable-library.4.5.0/RegExp.js +0 -132
- package/dist/fable_modules/fable-library.4.5.0/Seq.d.ts +0 -165
- package/dist/fable_modules/fable-library.4.5.0/Seq.js +0 -1379
- package/dist/fable_modules/fable-library.4.5.0/Seq2.d.ts +0 -18
- package/dist/fable_modules/fable-library.4.5.0/Seq2.js +0 -111
- package/dist/fable_modules/fable-library.4.5.0/Set.d.ts +0 -190
- package/dist/fable_modules/fable-library.4.5.0/Set.js +0 -1789
- package/dist/fable_modules/fable-library.4.5.0/String.d.ts +0 -49
- package/dist/fable_modules/fable-library.4.5.0/String.js +0 -540
- package/dist/fable_modules/fable-library.4.5.0/System.Collections.Generic.d.ts +0 -71
- package/dist/fable_modules/fable-library.4.5.0/System.Collections.Generic.js +0 -307
- package/dist/fable_modules/fable-library.4.5.0/System.Text.d.ts +0 -30
- package/dist/fable_modules/fable-library.4.5.0/System.Text.js +0 -110
- package/dist/fable_modules/fable-library.4.5.0/SystemException.d.ts +0 -5
- package/dist/fable_modules/fable-library.4.5.0/SystemException.js +0 -5
- package/dist/fable_modules/fable-library.4.5.0/TimeOnly.d.ts +0 -15
- package/dist/fable_modules/fable-library.4.5.0/TimeOnly.js +0 -122
- package/dist/fable_modules/fable-library.4.5.0/TimeSpan.d.ts +0 -34
- package/dist/fable_modules/fable-library.4.5.0/TimeSpan.js +0 -177
- package/dist/fable_modules/fable-library.4.5.0/Timer.d.ts +0 -19
- package/dist/fable_modules/fable-library.4.5.0/Timer.js +0 -67
- package/dist/fable_modules/fable-library.4.5.0/Types.d.ts +0 -58
- package/dist/fable_modules/fable-library.4.5.0/Types.js +0 -208
- package/dist/fable_modules/fable-library.4.5.0/Unicode.13.0.0.d.ts +0 -2
- package/dist/fable_modules/fable-library.4.5.0/Unicode.13.0.0.js +0 -4
- package/dist/fable_modules/fable-library.4.5.0/Uri.d.ts +0 -29
- package/dist/fable_modules/fable-library.4.5.0/Uri.js +0 -142
- package/dist/fable_modules/fable-library.4.5.0/Util.d.ts +0 -207
- package/dist/fable_modules/fable-library.4.5.0/Util.js +0 -781
- package/dist/fable_modules/fable-library.4.5.0/lib/big.d.ts +0 -5
- package/dist/fable_modules/fable-library.4.5.0/lib/big.js +0 -826
- package/dist/fable_modules/fable-library.4.5.0/package.json +0 -23
- package/dist/fable_modules/project_cracked.json +0 -1
|
@@ -6,23 +6,23 @@ export function readTypeAliasDeclaration(reader, declaration) {
|
|
|
6
6
|
switch (matchValue) {
|
|
7
7
|
case 192: {
|
|
8
8
|
const unionTypeNode = declaration.type;
|
|
9
|
-
typ = reader["Glutinum.Converter.Reader.Types.
|
|
9
|
+
typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadUnionTypeNodeZ5A082EC2"](unionTypeNode);
|
|
10
10
|
break;
|
|
11
11
|
}
|
|
12
12
|
case 198: {
|
|
13
13
|
const typeOperatorNode = declaration.type;
|
|
14
|
-
typ = reader["Glutinum.Converter.Reader.Types.
|
|
14
|
+
typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeOperatorNodeZ6830FC33"](typeOperatorNode);
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
17
17
|
case 199: {
|
|
18
18
|
const declaration_1 = declaration.type;
|
|
19
|
-
typ = reader["Glutinum.Converter.Reader.Types.
|
|
19
|
+
typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadIndexedAccessTypeZ5577BC0A"](declaration_1);
|
|
20
20
|
break;
|
|
21
21
|
}
|
|
22
22
|
default:
|
|
23
|
-
typ = reader["Glutinum.Converter.Reader.Types.
|
|
23
|
+
typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](declaration.type);
|
|
24
24
|
}
|
|
25
|
-
return new GlueType(5, [new GlueTypeAliasDeclaration(declaration.name.getText(), typ, reader["Glutinum.Converter.Reader.Types.
|
|
25
|
+
return new GlueType(5, [new GlueTypeAliasDeclaration(declaration.name.getText(), typ, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"](declaration.typeParameters))]);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
//# sourceMappingURL=TypeAliasDeclaration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeAliasDeclaration.fs"],"names":["typ","matchValue","declaration","unionTypeNode","reader","typeOperatorNode"],"mappings":";;;AAYQA;AACMC,uBAAA,AAAAC;YAAAD;aAAA;AAEEE,kCAAgB,AAAAD;AAEpB,AALJF,kBAKI,AAAAI,
|
|
1
|
+
{"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeAliasDeclaration.fs"],"names":["typ","matchValue","declaration","unionTypeNode","reader","typeOperatorNode"],"mappings":";;;AAYQA;AACMC,uBAAA,AAAAC;YAAAD;aAAA;AAEEE,kCAAgB,AAAAD;AAEpB,AALJF,kBAKI,AAAAI,uFAAyBD;;;aAJvB;AAOEE,qCAAmB,AAAAH;AACvB,AATJF,kBASI,AAAAI,0FAA4BC;;;aAR1B;AAWEH,kCAAc,AAAAA;AAClB,AAbJF,kBAaI,AAAAI,2FAA6BF;;;;AAE1B,AAfPF,kBAeO,AAAAI,iFAAoB,AAAAF;;AAO5B,WAAA,iBALH,6BACW,AAAAA,4BACAF,KACU,AAAAI,uFAA0B,AAAAF","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Union } from "../../fable_modules/fable-library-js.4.14.0/Types.js";
|
|
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 { tryReadLiteral, $007CHasSymbolFlags$007C_$007C, $007CHasTypeFlags$007C_$007C, generateReaderError } from "./Utils.js";
|
|
5
|
+
import { exists, empty, map, choose } from "../../fable_modules/fable-library-js.4.14.0/List.js";
|
|
6
|
+
import { head, toList } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
7
|
+
import { value as value_2 } from "../../fable_modules/fable-library-js.4.14.0/Option.js";
|
|
8
|
+
import { interpolate, toText } from "../../fable_modules/fable-library-js.4.14.0/String.js";
|
|
9
|
+
|
|
10
|
+
class IntersectionTypePropertyResult extends Union {
|
|
11
|
+
constructor(tag, fields) {
|
|
12
|
+
super();
|
|
13
|
+
this.tag = tag;
|
|
14
|
+
this.fields = fields;
|
|
15
|
+
}
|
|
16
|
+
cases() {
|
|
17
|
+
return ["Single", "ForceAny"];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function IntersectionTypePropertyResult_$reflection() {
|
|
22
|
+
return union_type("Glutinum.Converter.Reader.TypeNode.IntersectionTypePropertyResult", [], IntersectionTypePropertyResult, () => [[["Item", class_type("TypeScript.Ts.Declaration")]], []]);
|
|
23
|
+
}
|
|
7
24
|
|
|
8
25
|
export function readTypeNode(reader, typeNode) {
|
|
9
|
-
const checker = reader["Glutinum.Converter.Reader.Types.
|
|
26
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
10
27
|
const matchValue = typeNode.kind | 0;
|
|
11
28
|
switch (matchValue) {
|
|
12
29
|
case 106:
|
|
@@ -19,10 +36,14 @@ export function readTypeNode(reader, typeNode) {
|
|
|
19
36
|
return new GlueType(3, [new GluePrimitive(3, [])]);
|
|
20
37
|
case 150:
|
|
21
38
|
return new GlueType(3, [new GluePrimitive(5, [])]);
|
|
39
|
+
case 151:
|
|
40
|
+
return new GlueType(3, [new GluePrimitive(9, [])]);
|
|
22
41
|
case 154:
|
|
23
42
|
return new GlueType(3, [new GluePrimitive(0, [])]);
|
|
24
43
|
case 157:
|
|
25
44
|
return new GlueType(3, [new GluePrimitive(8, [])]);
|
|
45
|
+
case 159:
|
|
46
|
+
return new GlueType(23, []);
|
|
26
47
|
case 182:
|
|
27
48
|
return new GlueType(3, [new GluePrimitive(3, [])]);
|
|
28
49
|
case 183: {
|
|
@@ -72,7 +93,7 @@ export function readTypeNode(reader, typeNode) {
|
|
|
72
93
|
const originalType = value_2(patternInput[1].declarations)[0].parent;
|
|
73
94
|
if (originalType.kind === 264) {
|
|
74
95
|
const interfaceDeclaration = originalType;
|
|
75
|
-
const members = map((declaration) => reader["Glutinum.Converter.Reader.Types.
|
|
96
|
+
const members = map((declaration) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration), toList(interfaceDeclaration.members));
|
|
76
97
|
return new GlueType(14, [new GlueInterface(interfaceDeclaration.name.getText(), members, empty())]);
|
|
77
98
|
}
|
|
78
99
|
else {
|
|
@@ -93,7 +114,7 @@ export function readTypeNode(reader, typeNode) {
|
|
|
93
114
|
else {
|
|
94
115
|
let typeArguments_1;
|
|
95
116
|
const matchValue_5 = typeReferenceNode.typeArguments;
|
|
96
|
-
typeArguments_1 = ((matchValue_5 != null) ? map((arg) => reader["Glutinum.Converter.Reader.Types.
|
|
117
|
+
typeArguments_1 = ((matchValue_5 != null) ? map((arg) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](arg), toList(matchValue_5)) : empty());
|
|
97
118
|
return new GlueType(13, [new GlueTypeReference(typeReferenceNode.typeName.getText(), fullName, typeArguments_1)]);
|
|
98
119
|
}
|
|
99
120
|
}
|
|
@@ -101,27 +122,138 @@ export function readTypeNode(reader, typeNode) {
|
|
|
101
122
|
}
|
|
102
123
|
case 184: {
|
|
103
124
|
const functionTypeNode = typeNode;
|
|
104
|
-
return new GlueType(16, [new GlueFunctionType(reader["Glutinum.Converter.Reader.Types.
|
|
125
|
+
return new GlueType(16, [new GlueFunctionType(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](functionTypeNode.type), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParametersZ17143B5B"](functionTypeNode.parameters))]);
|
|
105
126
|
}
|
|
106
127
|
case 186: {
|
|
107
128
|
const typeNodeQuery = typeNode;
|
|
108
|
-
const typ_3 = checker.getTypeAtLocation(typeNodeQuery);
|
|
109
|
-
const matchValue_6 = typ_3.
|
|
110
|
-
if ($
|
|
111
|
-
|
|
129
|
+
const typ_3 = checker.getTypeAtLocation(typeNodeQuery.exprName);
|
|
130
|
+
const matchValue_6 = typ_3.flags | 0;
|
|
131
|
+
if ($007CHasTypeFlags$007C_$007C(524288, matchValue_6) != null) {
|
|
132
|
+
const matchValue_7 = typ_3.symbol.declarations;
|
|
133
|
+
if (matchValue_7 == null) {
|
|
134
|
+
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
const declarations = matchValue_7;
|
|
138
|
+
const declaration_1 = declarations[0];
|
|
139
|
+
if (declaration_1.kind === 263) {
|
|
140
|
+
return new GlueType(12, [new GlueClassDeclaration(typ_3.symbol.name, empty(), empty(), empty())]);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration_1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if ($007CHasTypeFlags$007C_$007C(4, matchValue_6) != null) {
|
|
148
|
+
return new GlueType(3, [new GluePrimitive(0, [])]);
|
|
149
|
+
}
|
|
150
|
+
else if ($007CHasTypeFlags$007C_$007C(8, matchValue_6) != null) {
|
|
151
|
+
return new GlueType(3, [new GluePrimitive(5, [])]);
|
|
152
|
+
}
|
|
153
|
+
else if ($007CHasTypeFlags$007C_$007C(16, matchValue_6) != null) {
|
|
154
|
+
return new GlueType(3, [new GluePrimitive(3, [])]);
|
|
155
|
+
}
|
|
156
|
+
else if ($007CHasTypeFlags$007C_$007C(1, matchValue_6) != null) {
|
|
157
|
+
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
158
|
+
}
|
|
159
|
+
else if ($007CHasTypeFlags$007C_$007C(16384, matchValue_6) != null) {
|
|
160
|
+
return new GlueType(3, [new GluePrimitive(4, [])]);
|
|
112
161
|
}
|
|
113
162
|
else {
|
|
114
163
|
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
115
164
|
}
|
|
116
165
|
}
|
|
166
|
+
case 187: {
|
|
167
|
+
const typeLiteralNode = typeNode;
|
|
168
|
+
return new GlueType(21, [new GlueTypeLiteral(map((declaration_4) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_4), toList(typeLiteralNode.members)))]);
|
|
169
|
+
}
|
|
117
170
|
case 188: {
|
|
118
171
|
const arrayTypeNode = typeNode;
|
|
119
|
-
return new GlueType(15, [reader["Glutinum.Converter.Reader.Types.
|
|
172
|
+
return new GlueType(15, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](arrayTypeNode.elementType)]);
|
|
173
|
+
}
|
|
174
|
+
case 189: {
|
|
175
|
+
const tupleTypeNode = typeNode;
|
|
176
|
+
return new GlueType(19, [map((element) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](element), toList(tupleTypeNode.elements))]);
|
|
177
|
+
}
|
|
178
|
+
case 190: {
|
|
179
|
+
const optionalTypeNode = typeNode;
|
|
180
|
+
return new GlueType(22, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](optionalTypeNode.type)]);
|
|
120
181
|
}
|
|
121
182
|
case 192:
|
|
122
|
-
return reader["Glutinum.Converter.Reader.Types.
|
|
123
|
-
|
|
124
|
-
|
|
183
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadUnionTypeNodeZ5A082EC2"](typeNode);
|
|
184
|
+
case 193: {
|
|
185
|
+
const intersectionTypeNode = typeNode;
|
|
186
|
+
const unionOrIntersectionType = checker.getTypeAtLocation(intersectionTypeNode);
|
|
187
|
+
const properties = choose((property) => {
|
|
188
|
+
const matchValue_10 = property.declarations;
|
|
189
|
+
if (matchValue_10 == null) {
|
|
190
|
+
throw new Error(generateReaderError("type node", "Missing declarations", typeNode));
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
const declarations_1 = matchValue_10;
|
|
194
|
+
if (declarations_1.length === 1) {
|
|
195
|
+
return new IntersectionTypePropertyResult(0, [declarations_1[0]]);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return new IntersectionTypePropertyResult(1, []);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}, toList(unionOrIntersectionType.getProperties()));
|
|
202
|
+
if (exists((property_1) => {
|
|
203
|
+
if (property_1.tag === 0) {
|
|
204
|
+
if (property_1.fields[0].kind === 174) {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
}, properties)) {
|
|
215
|
+
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
return new GlueType(20, [choose((_arg) => {
|
|
219
|
+
if (_arg.tag === 1) {
|
|
220
|
+
throw new Error("Sould not happen here");
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](_arg.fields[0]);
|
|
224
|
+
}
|
|
225
|
+
}, properties)]);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
case 196: {
|
|
229
|
+
const parenthesizedTypeNode = typeNode;
|
|
230
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](parenthesizedTypeNode.type);
|
|
231
|
+
}
|
|
232
|
+
case 197: {
|
|
233
|
+
const thisTypeNode = typeNode;
|
|
234
|
+
const typ_4 = checker.getTypeAtLocation(thisTypeNode);
|
|
235
|
+
return new GlueType(18, [typ_4.symbol.name]);
|
|
236
|
+
}
|
|
237
|
+
case 198: {
|
|
238
|
+
const typeOperatorNode = typeNode;
|
|
239
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeOperatorNodeZ6830FC33"](typeOperatorNode);
|
|
240
|
+
}
|
|
241
|
+
case 201: {
|
|
242
|
+
const literalTypeNode = typeNode;
|
|
243
|
+
const matchValue_9 = tryReadLiteral(literalTypeNode.literal);
|
|
244
|
+
if (matchValue_9 == null) {
|
|
245
|
+
throw new Error(generateReaderError("type node - literal type", "Could not read literal type", typeNode));
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
return new GlueType(8, [matchValue_9]);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
default: {
|
|
252
|
+
const item = generateReaderError("type node", toText(interpolate("Unsupported kind %A%P()", [typeNode.kind])), typeNode);
|
|
253
|
+
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
254
|
+
void (objectArg.push(item));
|
|
255
|
+
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
256
|
+
}
|
|
125
257
|
}
|
|
126
258
|
}
|
|
127
259
|
|
|
@@ -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","typeArguments","functionTypeNode","typeNodeQuery","arrayTypeNode"],"mappings":"
|
|
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","typeArguments","functionTypeNode","typeNodeQuery","declarations","typeLiteralNode","arrayTypeNode","tupleTypeNode","element","optionalTypeNode","intersectionTypeNode","unionOrIntersectionType","properties","property","_arg1","parenthesizedTypeNode","thisTypeNode","typeOperatorNode","literalTypeNode","item","objectArg"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBQA,oBAAU,AAAAC;AAERC,uBAAA,AAAAC;YAAAD;aAAA;AAMyB,mBAAA,iBAAmB;aAN5C;AAGyB,mBAAA,iB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,eAAAD;AAEH,mBAAA,iBAAmB","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -1,35 +1,42 @@
|
|
|
1
1
|
import typescript from "typescript";
|
|
2
2
|
import { generateReaderError } from "./Utils.js";
|
|
3
|
-
import { GlueType } from "../GlueAST.js";
|
|
4
|
-
import { interpolate, toText } from "../../fable_modules/fable-library.4.
|
|
3
|
+
import { GluePrimitive, GlueType } from "../GlueAST.js";
|
|
4
|
+
import { interpolate, toText } from "../../fable_modules/fable-library-js.4.14.0/String.js";
|
|
5
5
|
|
|
6
6
|
export function readTypeOperatorNode(reader, node) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
const matchValue = node.operator | 0;
|
|
8
|
+
switch (matchValue) {
|
|
9
|
+
case 143:
|
|
10
|
+
if (typescript.isTypeReferenceNode(node.type)) {
|
|
11
|
+
const typeReferenceNode = node.type;
|
|
12
|
+
const symbolOpt = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getSymbolAtLocation(typeReferenceNode.typeName);
|
|
13
|
+
if (symbolOpt != null) {
|
|
14
|
+
const symbol = symbolOpt;
|
|
15
|
+
const matchValue_1 = symbol.declarations;
|
|
16
|
+
if (matchValue_1 == null) {
|
|
17
|
+
throw new Error(generateReaderError("type operator (keyof)", "Missing declarations", node));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const declarations = matchValue_1;
|
|
21
|
+
const interfaceDeclaration = declarations[0];
|
|
22
|
+
return new GlueType(9, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadInterfaceDeclaration1CB6FA10"](interfaceDeclaration)]);
|
|
23
|
+
}
|
|
16
24
|
}
|
|
17
25
|
else {
|
|
18
|
-
|
|
19
|
-
const interfaceDeclaration = declarations[0];
|
|
20
|
-
return new GlueType(9, [reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadInterfaceDeclaration1CB6FA10"](interfaceDeclaration)]);
|
|
26
|
+
throw new Error(generateReaderError("type operator (keyof)", "Missing symbol", node));
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
29
|
else {
|
|
24
|
-
throw new Error(generateReaderError("type operator (keyof)", "
|
|
30
|
+
throw new Error(generateReaderError("type operator (keyof)", toText(interpolate("Was expecting a type reference instead got a Node of type %A%P()", [node.type.kind])), node));
|
|
25
31
|
}
|
|
32
|
+
case 148:
|
|
33
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](node.type);
|
|
34
|
+
default: {
|
|
35
|
+
const item = generateReaderError("type operator", toText(interpolate("Unsupported operator %A%P()", [node.operator])), node);
|
|
36
|
+
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
37
|
+
void (objectArg.push(item));
|
|
38
|
+
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
26
39
|
}
|
|
27
|
-
else {
|
|
28
|
-
throw new Error(generateReaderError("type operator (keyof)", toText(interpolate("Was expecting a type reference instead got a Node of type %A%P()", [node.type.kind])), node));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
throw new Error(generateReaderError("type operator", toText(interpolate("Unsupported operator %A%P()", [node.operator])), node));
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeOperatorNode.fs"],"names":["node","typeReferenceNode","symbolOpt","reader","symbol","
|
|
1
|
+
{"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeOperatorNode.fs"],"names":["matchValue","node","typeReferenceNode","symbolOpt","reader","symbol","declarations","interfaceDeclaration","item","objectArg"],"mappings":";;;;;;AAYUA,uBAAA,AAAAC;YAAAD;aAAA;AAEF,gBAAG,\u002BBAAuB,AAAAC;AAClBC,0CAAoB,AAAAD;AAGpBE,kCACA,AAAAC,8FAAqC,AAAAF;AAEnC,oBAAA,AAAAC;AAQCE,mCACGF;AAAAH,yCAAA,AAAAK;AAAA,wBAAA,AAAAL;AAaC,wCAJH,oBACI,yBACA,wBACAC;;;AAXDK,6CACCN;AAAAO,qDACA,AAAAD,aAAa;AAGd,\u002BBAAA,iBADH,AAAAF,6FAAgCG;;;;AARjC,oCAJH,oBACI,yBACA,kBACAN;;;;AAwBL,gCAJH,oBACI,yBACA,OAAA,YAAA,qEAA\u002BD,AAAAA,mBAC/DA;;aArCN;AAwC6B,mBAAA,AAAAG,iFAAoB,AAAAH;;AAOhDO,yBAJH,oBACI,iBACA,OAAA,YAAA,gCAA0B,AAAAP,kBAC1BA;AACDQ,8BAAA,AAAAL;AAAA,kBAAAK,eAAAD;AAEH,mBAAA,iBAAmB","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { empty, map } from "../../fable_modules/fable-library.4.
|
|
1
|
+
import { empty, map } from "../../fable_modules/fable-library-js.4.14.0/List.js";
|
|
2
2
|
import { GlueTypeParameter } from "../GlueAST.js";
|
|
3
|
-
import { toList } from "../../fable_modules/fable-library.4.
|
|
3
|
+
import { toList } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
4
4
|
|
|
5
5
|
export function readTypeParameters(reader, typeParameters) {
|
|
6
6
|
if (typeParameters != null) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readClassDeclaration } from "./ClassDeclaration.js";
|
|
2
|
-
import { GluePrimitive, GlueType } from "../GlueAST.js";
|
|
3
2
|
import { readEnumDeclaration } from "./EnumDeclaration.js";
|
|
3
|
+
import { GluePrimitive, GlueType } from "../GlueAST.js";
|
|
4
4
|
import { readFunctionDeclaration } from "./FunctionDeclaration.js";
|
|
5
5
|
import { readInterfaceDeclaration } from "./InterfaceDeclaration.js";
|
|
6
6
|
import { readModuleDeclaration } from "./ModuleDeclaration.js";
|
|
@@ -8,88 +8,113 @@ import { readNode } from "./Node.js";
|
|
|
8
8
|
import { readTypeAliasDeclaration } from "./TypeAliasDeclaration.js";
|
|
9
9
|
import { readTypeNode } from "./TypeNode.js";
|
|
10
10
|
import { readVariableStatement } from "./VariableStatement.js";
|
|
11
|
-
import {
|
|
11
|
+
import { readDeclaration } from "./Declaration.js";
|
|
12
12
|
import { readParameters } from "./Parameters.js";
|
|
13
13
|
import { readUnionTypeNode } from "./UnionTypeNode.js";
|
|
14
14
|
import { readTypeOperatorNode } from "./TypeOperatorNode.js";
|
|
15
15
|
import { readIndexedAccessType } from "./IndexedAccessType.js";
|
|
16
16
|
import { readTypeParameters } from "./TypeParameters.js";
|
|
17
|
-
import {
|
|
17
|
+
import { readExportAssignment } from "./ExportAssignment.js";
|
|
18
|
+
import { readDocumentationForNode, readDocumentationForSignature } from "./Documentation.js";
|
|
19
|
+
import { class_type } from "../../fable_modules/fable-library-js.4.14.0/Reflection.js";
|
|
20
|
+
|
|
21
|
+
export class TypeScriptReader {
|
|
22
|
+
constructor(checker) {
|
|
23
|
+
this["checker@24"] = checker;
|
|
24
|
+
this.warnings = [];
|
|
25
|
+
}
|
|
26
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"() {
|
|
27
|
+
const _ = this;
|
|
28
|
+
return _["checker@24"];
|
|
29
|
+
}
|
|
30
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"() {
|
|
31
|
+
const _ = this;
|
|
32
|
+
return _.warnings;
|
|
33
|
+
}
|
|
34
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadClassDeclarationZ4558F325"(classDeclaration) {
|
|
35
|
+
const this$ = this;
|
|
36
|
+
return readClassDeclaration(this$, classDeclaration);
|
|
37
|
+
}
|
|
38
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadEnumDeclaration49F76106"(enumDeclaration) {
|
|
39
|
+
const this$ = this;
|
|
40
|
+
return new GlueType(4, [readEnumDeclaration(this$, enumDeclaration)]);
|
|
41
|
+
}
|
|
42
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadFunctionDeclarationZ72EBD329"(functionDeclaration) {
|
|
43
|
+
const this$ = this;
|
|
44
|
+
return new GlueType(6, [readFunctionDeclaration(this$, functionDeclaration)]);
|
|
45
|
+
}
|
|
46
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadInterfaceDeclaration1CB6FA10"(interfaceDeclaration) {
|
|
47
|
+
const this$ = this;
|
|
48
|
+
return new GlueType(1, [readInterfaceDeclaration(this$, interfaceDeclaration)]);
|
|
49
|
+
}
|
|
50
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadModuleDeclarationC29C54F"(moduleDeclaration) {
|
|
51
|
+
const this$ = this;
|
|
52
|
+
return new GlueType(11, [readModuleDeclaration(this$, moduleDeclaration)]);
|
|
53
|
+
}
|
|
54
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"(node) {
|
|
55
|
+
const this$ = this;
|
|
56
|
+
return readNode(this$, node);
|
|
57
|
+
}
|
|
58
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeAliasDeclarationZ7FA16745"(typeAliasDeclaration) {
|
|
59
|
+
const this$ = this;
|
|
60
|
+
return readTypeAliasDeclaration(this$, typeAliasDeclaration);
|
|
61
|
+
}
|
|
62
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"(typNode) {
|
|
63
|
+
const this$ = this;
|
|
64
|
+
return this$["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](typNode);
|
|
65
|
+
}
|
|
66
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"(typNode) {
|
|
67
|
+
const this$ = this;
|
|
68
|
+
return (typNode == null) ? (new GlueType(3, [new GluePrimitive(4, [])])) : readTypeNode(this$, typNode);
|
|
69
|
+
}
|
|
70
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadVariableStatementZ66C4BA0A"(variableStatement) {
|
|
71
|
+
const this$ = this;
|
|
72
|
+
return readVariableStatement(this$, variableStatement);
|
|
73
|
+
}
|
|
74
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"(declaration) {
|
|
75
|
+
const this$ = this;
|
|
76
|
+
return readDeclaration(this$, declaration);
|
|
77
|
+
}
|
|
78
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParametersZ17143B5B"(parameters) {
|
|
79
|
+
const this$ = this;
|
|
80
|
+
return readParameters(this$, parameters);
|
|
81
|
+
}
|
|
82
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadUnionTypeNodeZ5A082EC2"(unionType) {
|
|
83
|
+
const this$ = this;
|
|
84
|
+
return readUnionTypeNode(this$, unionType);
|
|
85
|
+
}
|
|
86
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeOperatorNodeZ6830FC33"(node) {
|
|
87
|
+
const this$ = this;
|
|
88
|
+
return readTypeOperatorNode(this$, node);
|
|
89
|
+
}
|
|
90
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadIndexedAccessTypeZ5577BC0A"(declaration) {
|
|
91
|
+
const this$ = this;
|
|
92
|
+
return readIndexedAccessType(this$, declaration);
|
|
93
|
+
}
|
|
94
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"(typeParametersOpt) {
|
|
95
|
+
const this$ = this;
|
|
96
|
+
return readTypeParameters(this$, typeParametersOpt);
|
|
97
|
+
}
|
|
98
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadExportAssignmentZ3497D0FE"(exportAssignment) {
|
|
99
|
+
const this$ = this;
|
|
100
|
+
return readExportAssignment(this$, exportAssignment);
|
|
101
|
+
}
|
|
102
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromSignature61B89E55"(declaration) {
|
|
103
|
+
const this$ = this;
|
|
104
|
+
return readDocumentationForSignature(this$, declaration);
|
|
105
|
+
}
|
|
106
|
+
"Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"(node) {
|
|
107
|
+
const this$ = this;
|
|
108
|
+
return readDocumentationForNode(this$, node);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function TypeScriptReader_$reflection() {
|
|
113
|
+
return class_type("Glutinum.Converter.Reader.TypeScriptReader.TypeScriptReader", void 0, TypeScriptReader);
|
|
114
|
+
}
|
|
18
115
|
|
|
19
|
-
export function
|
|
20
|
-
return new (
|
|
21
|
-
constructor() {
|
|
22
|
-
super(checker);
|
|
23
|
-
}
|
|
24
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.get_checker"() {
|
|
25
|
-
return checker;
|
|
26
|
-
}
|
|
27
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadClassDeclarationZ4558F325"(classDeclaration) {
|
|
28
|
-
const this$ = this;
|
|
29
|
-
return new GlueType(12, [readClassDeclaration(this$, classDeclaration)]);
|
|
30
|
-
}
|
|
31
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadEnumDeclaration49F76106"(enumDeclaration) {
|
|
32
|
-
const this$_1 = this;
|
|
33
|
-
return new GlueType(4, [readEnumDeclaration(this$_1, enumDeclaration)]);
|
|
34
|
-
}
|
|
35
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadFunctionDeclarationZ72EBD329"(functionDeclaration) {
|
|
36
|
-
const this$_2 = this;
|
|
37
|
-
return new GlueType(6, [readFunctionDeclaration(this$_2, functionDeclaration)]);
|
|
38
|
-
}
|
|
39
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadInterfaceDeclaration1CB6FA10"(interfaceDeclaration) {
|
|
40
|
-
const this$_3 = this;
|
|
41
|
-
return new GlueType(1, [readInterfaceDeclaration(this$_3, interfaceDeclaration)]);
|
|
42
|
-
}
|
|
43
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadModuleDeclarationC29C54F"(moduleDeclaration) {
|
|
44
|
-
const this$_4 = this;
|
|
45
|
-
return new GlueType(11, [readModuleDeclaration(this$_4, moduleDeclaration)]);
|
|
46
|
-
}
|
|
47
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadNode6C0FD055"(node) {
|
|
48
|
-
const this$_5 = this;
|
|
49
|
-
return readNode(this$_5, node);
|
|
50
|
-
}
|
|
51
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeAliasDeclarationZ7FA16745"(typeAliasDeclaration) {
|
|
52
|
-
const this$_6 = this;
|
|
53
|
-
return readTypeAliasDeclaration(this$_6, typeAliasDeclaration);
|
|
54
|
-
}
|
|
55
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNode24A678AD"(typNode) {
|
|
56
|
-
const this$_7 = this;
|
|
57
|
-
return this$_7["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](typNode);
|
|
58
|
-
}
|
|
59
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"(typNode_1) {
|
|
60
|
-
const this$_8 = this;
|
|
61
|
-
return (typNode_1 == null) ? (new GlueType(3, [new GluePrimitive(4, [])])) : readTypeNode(this$_8, typNode_1);
|
|
62
|
-
}
|
|
63
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadVariableStatementZ66C4BA0A"(variableStatement) {
|
|
64
|
-
const this$_9 = this;
|
|
65
|
-
return readVariableStatement(this$_9, variableStatement);
|
|
66
|
-
}
|
|
67
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadNamedDeclaration2A58F896"(declaration) {
|
|
68
|
-
const this$_10 = this;
|
|
69
|
-
return readNamedDeclaration(this$_10, declaration);
|
|
70
|
-
}
|
|
71
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadParametersZ17143B5B"(parameters) {
|
|
72
|
-
const this$_11 = this;
|
|
73
|
-
return readParameters(this$_11, parameters);
|
|
74
|
-
}
|
|
75
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadUnionTypeNodeZ5A082EC2"(unionType) {
|
|
76
|
-
const this$_12 = this;
|
|
77
|
-
return readUnionTypeNode(this$_12, unionType);
|
|
78
|
-
}
|
|
79
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeOperatorNodeZ6830FC33"(node_1) {
|
|
80
|
-
const this$_13 = this;
|
|
81
|
-
return readTypeOperatorNode(this$_13, node_1);
|
|
82
|
-
}
|
|
83
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadIndexedAccessTypeZ5577BC0A"(declaration_1) {
|
|
84
|
-
const this$_14 = this;
|
|
85
|
-
return readIndexedAccessType(this$_14, declaration_1);
|
|
86
|
-
}
|
|
87
|
-
"Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeParameters4088FB9E"(typeParametersOpt) {
|
|
88
|
-
const this$_15 = this;
|
|
89
|
-
return readTypeParameters(this$_15, typeParametersOpt);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
)();
|
|
116
|
+
export function TypeScriptReader_$ctor_Z51F60704(checker) {
|
|
117
|
+
return new TypeScriptReader(checker);
|
|
93
118
|
}
|
|
94
119
|
|
|
95
120
|
//# sourceMappingURL=TypeScriptReader.js.map
|
|
@@ -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"],"mappings":"
|
|
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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBsB,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","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import typescript from "typescript";
|
|
2
|
-
import { map, empty, singleton, choose, concat } from "../../fable_modules/fable-library.4.
|
|
3
|
-
import { defaultArgWith } from "../../fable_modules/fable-library.4.
|
|
2
|
+
import { map, empty, singleton, choose, concat } from "../../fable_modules/fable-library-js.4.14.0/List.js";
|
|
3
|
+
import { defaultArgWith } from "../../fable_modules/fable-library-js.4.14.0/Option.js";
|
|
4
4
|
import { $007CHasTypeFlags$007C_$007C, generateReaderError, tryReadLiteral } from "./Utils.js";
|
|
5
5
|
import { GlueTypeUnion, GlueTypeReference, GluePrimitive, GlueType } from "../GlueAST.js";
|
|
6
|
-
import { toList } from "../../fable_modules/fable-library.4.
|
|
6
|
+
import { toList } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
7
7
|
|
|
8
8
|
function readUnionTypeCases(reader, unionTypeNode) {
|
|
9
|
-
const checker = reader["Glutinum.Converter.Reader.Types.
|
|
9
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
10
10
|
const removeParenthesizedType = (node_mut) => {
|
|
11
11
|
removeParenthesizedType:
|
|
12
12
|
while (true) {
|
|
@@ -50,8 +50,8 @@ function readUnionTypeCases(reader, unionTypeNode) {
|
|
|
50
50
|
const matchValue_1 = symbol.declarations;
|
|
51
51
|
if (matchValue_1 == null) {
|
|
52
52
|
const typ = checker.getTypeOfSymbol(symbol);
|
|
53
|
-
const
|
|
54
|
-
if ($007CHasTypeFlags$007C_$007C(1,
|
|
53
|
+
const matchValue_3 = typ.flags | 0;
|
|
54
|
+
if ($007CHasTypeFlags$007C_$007C(1, matchValue_3) != null) {
|
|
55
55
|
return singleton(new GlueType(3, [new GluePrimitive(6, [])]));
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
@@ -69,7 +69,13 @@ function readUnionTypeCases(reader, unionTypeNode) {
|
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
const declaration = declarations[0];
|
|
72
|
-
|
|
72
|
+
if (declaration.kind === 265) {
|
|
73
|
+
return singleton(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const fullName_1 = checker.getFullyQualifiedName(symbol);
|
|
77
|
+
return singleton(new GlueType(13, [new GlueTypeReference(typeReferenceNode.getText(), fullName_1, empty())]));
|
|
78
|
+
}
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
81
|
}
|
|
@@ -77,7 +83,7 @@ function readUnionTypeCases(reader, unionTypeNode) {
|
|
|
77
83
|
return readUnionTypeCases(reader, node_1).fields[0];
|
|
78
84
|
}
|
|
79
85
|
else {
|
|
80
|
-
return singleton(reader["Glutinum.Converter.Reader.Types.
|
|
86
|
+
return singleton(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](node_1));
|
|
81
87
|
}
|
|
82
88
|
}, map(removeParenthesizedType, toList(unionTypeNode.types)))));
|
|
83
89
|
}
|
|
@@ -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;
|
|
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;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