@glutinum/cli 0.7.0 → 0.9.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/dist/Glutinum.Converter/FsharpAST.js +45 -14
- package/dist/Glutinum.Converter/FsharpAST.js.map +1 -1
- package/dist/Glutinum.Converter/Generate.js +23 -8
- package/dist/Glutinum.Converter/Generate.js.map +1 -1
- package/dist/Glutinum.Converter/GlueAST.js +67 -19
- package/dist/Glutinum.Converter/GlueAST.js.map +1 -1
- package/dist/Glutinum.Converter/Printer.js +138 -58
- package/dist/Glutinum.Converter/Printer.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +4 -4
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js +19 -5
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +1 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +3 -2
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +1 -1
- package/dist/Glutinum.Converter/Reader/Node.js +1 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js +169 -126
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js +2 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +8 -5
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Utils.js +50 -2
- package/dist/Glutinum.Converter/Reader/Utils.js.map +1 -1
- package/dist/Glutinum.Converter/Transform.js +433 -172
- package/dist/Glutinum.Converter/Transform.js.map +1 -1
- package/dist/Glutinum.Converter/Utils/Naming.js +0 -19
- package/dist/Glutinum.Converter/Utils/Naming.js.map +1 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +57 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +105 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +1 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +20 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +766 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +218 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +1 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +31 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +20 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +1 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +123 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Array.js +1242 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +32 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Async.js +158 -0
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +59 -0
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.js +183 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +115 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.js +282 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +27 -0
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.js +138 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +3 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.js +21 -0
- package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +37 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +65 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Char.js +169 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +121 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.js +184 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +70 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Date.js +749 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +63 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.js +268 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +18 -0
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.js +124 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +45 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.js +212 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +11 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Double.js +46 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +12 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.js +173 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +31 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Event.js +93 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +7 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +27 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +12 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.js +27 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +17 -0
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +69 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +24 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Global.js +8 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +10 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.js +142 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +28 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.js +135 -0
- package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +143 -0
- package/dist/fable_modules/fable-library-js.4.14.0/List.js +1273 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +3 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Long.js +46 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +25 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.js +93 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +178 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Map.js +1396 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +10 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.js +112 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +52 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.js +327 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +39 -0
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.js +233 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +2 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Native.js +8 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +19 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.js +71 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +32 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.js +113 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +28 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Option.js +96 -0
- package/dist/fable_modules/fable-library-js.4.14.0/README.md +3 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +37 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Random.js +170 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +12 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Range.js +45 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +119 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.js +461 -0
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +10 -0
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.js +132 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +37 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Result.js +165 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +165 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.js +1379 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +18 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.js +111 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +190 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Set.js +1789 -0
- package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +50 -0
- package/dist/fable_modules/fable-library-js.4.14.0/String.js +543 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +79 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.js +317 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +38 -0
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.js +162 -0
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +5 -0
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +5 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +15 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.js +122 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +34 -0
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.js +177 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +19 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.js +67 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +58 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Types.js +208 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +2 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.js +4 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +29 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.js +142 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +207 -0
- package/dist/fable_modules/fable-library-js.4.14.0/Util.js +770 -0
- package/dist/fable_modules/fable-library-js.4.14.0/big.d.ts +338 -0
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +5 -0
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.js +826 -0
- package/dist/fable_modules/fable-library-js.4.14.0/package.json +24 -0
- package/dist/fable_modules/project_cracked.json +1 -0
- package/package.json +1 -1
|
@@ -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 {
|
|
4
|
-
import {
|
|
5
|
-
import { exists, concat,
|
|
3
|
+
import { tryReadLiteral, generateReaderError, isFromEs5Lib, getFullNameOrEmpty, $007CHasSymbolFlags$007C_$007C, readTypeArguments, $007CHasTypeFlags$007C_$007C } from "./Utils.js";
|
|
4
|
+
import { GlueTypeLiteral, GlueFunctionType, GlueTypeReference, GlueRecord, 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(25, []);
|
|
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(14, [new GlueInterface(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(15, [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,144 +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(
|
|
146
|
+
return new GlueType(25, []);
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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(18, [value_2(symbolOpt).name]);
|
|
81
156
|
}
|
|
82
|
-
|
|
83
|
-
|
|
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.members == null) {
|
|
93
|
-
return new GlueType(0, []);
|
|
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())]);
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return
|
|
123
|
-
|
|
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);
|
|
124
172
|
}
|
|
125
173
|
}
|
|
174
|
+
else {
|
|
175
|
+
return readTypeReference(false);
|
|
176
|
+
}
|
|
126
177
|
}
|
|
127
178
|
case 184: {
|
|
128
179
|
const functionTypeNode = typeNode;
|
|
129
|
-
return new GlueType(
|
|
180
|
+
return new GlueType(17, [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))]);
|
|
130
181
|
}
|
|
131
182
|
case 186: {
|
|
132
183
|
const typeNodeQuery = typeNode;
|
|
133
|
-
|
|
134
|
-
const matchValue_6 = typ_3.flags | 0;
|
|
135
|
-
if ($007CHasTypeFlags$007C_$007C(524288, matchValue_6) != null) {
|
|
136
|
-
const matchValue_7 = typ_3.symbol.declarations;
|
|
137
|
-
if (matchValue_7 == null) {
|
|
138
|
-
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
const declarations = matchValue_7;
|
|
142
|
-
const declaration_1 = declarations[0];
|
|
143
|
-
const matchValue_8 = declaration_1.kind | 0;
|
|
144
|
-
switch (matchValue_8) {
|
|
145
|
-
case 263:
|
|
146
|
-
return new GlueType(12, [new GlueClassDeclaration(typ_3.symbol.name, empty(), empty(), empty())]);
|
|
147
|
-
case 267:
|
|
148
|
-
return new GlueType(0, []);
|
|
149
|
-
default:
|
|
150
|
-
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration_1);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
else if ($007CHasTypeFlags$007C_$007C(4, matchValue_6) != null) {
|
|
155
|
-
return new GlueType(3, [new GluePrimitive(0, [])]);
|
|
156
|
-
}
|
|
157
|
-
else if ($007CHasTypeFlags$007C_$007C(8, matchValue_6) != null) {
|
|
158
|
-
return new GlueType(3, [new GluePrimitive(5, [])]);
|
|
159
|
-
}
|
|
160
|
-
else if ($007CHasTypeFlags$007C_$007C(16, matchValue_6) != null) {
|
|
161
|
-
return new GlueType(3, [new GluePrimitive(3, [])]);
|
|
162
|
-
}
|
|
163
|
-
else if ($007CHasTypeFlags$007C_$007C(1, matchValue_6) != null) {
|
|
164
|
-
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
165
|
-
}
|
|
166
|
-
else if ($007CHasTypeFlags$007C_$007C(16384, matchValue_6) != null) {
|
|
167
|
-
return new GlueType(3, [new GluePrimitive(4, [])]);
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
171
|
-
}
|
|
184
|
+
return readTypeUsingFlags(reader, checker.getTypeAtLocation(typeNodeQuery.exprName));
|
|
172
185
|
}
|
|
173
186
|
case 187: {
|
|
174
187
|
const typeLiteralNode = typeNode;
|
|
175
|
-
return new GlueType(
|
|
188
|
+
return new GlueType(23, [new GlueTypeLiteral(map((declaration_2) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_2), toList(typeLiteralNode.members)))]);
|
|
176
189
|
}
|
|
177
190
|
case 188: {
|
|
178
191
|
const arrayTypeNode = typeNode;
|
|
179
|
-
return new GlueType(
|
|
192
|
+
return new GlueType(16, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](arrayTypeNode.elementType)]);
|
|
180
193
|
}
|
|
181
194
|
case 189: {
|
|
182
195
|
const tupleTypeNode = typeNode;
|
|
183
|
-
return new GlueType(
|
|
196
|
+
return new GlueType(20, [map((element) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](element), toList(tupleTypeNode.elements))]);
|
|
184
197
|
}
|
|
185
198
|
case 190: {
|
|
186
199
|
const optionalTypeNode = typeNode;
|
|
187
|
-
return new GlueType(
|
|
200
|
+
return new GlueType(24, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](optionalTypeNode.type)]);
|
|
188
201
|
}
|
|
189
202
|
case 192:
|
|
190
203
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadUnionTypeNodeZ5A082EC2"](typeNode);
|
|
@@ -192,20 +205,20 @@ export function readTypeNode(reader, typeNode) {
|
|
|
192
205
|
const intersectionTypeNode = typeNode;
|
|
193
206
|
const unionOrIntersectionType = checker.getTypeAtLocation(intersectionTypeNode);
|
|
194
207
|
const properties = choose((property) => {
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
208
|
+
const matchValue_4 = property.declarations;
|
|
209
|
+
if (matchValue_4 == null) {
|
|
197
210
|
throw new Error(generateReaderError("type node", "Missing declarations", typeNode));
|
|
198
211
|
}
|
|
199
212
|
else {
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
return new IntersectionTypePropertyResult(0, [
|
|
213
|
+
const declarations = matchValue_4;
|
|
214
|
+
if (declarations.length === 1) {
|
|
215
|
+
return new IntersectionTypePropertyResult(0, [declarations[0]]);
|
|
203
216
|
}
|
|
204
217
|
else {
|
|
205
218
|
return new IntersectionTypePropertyResult(1, []);
|
|
206
219
|
}
|
|
207
220
|
}
|
|
208
|
-
}, unionOrIntersectionType.isUnion() ? List_distinct(concat(map((
|
|
221
|
+
}, unionOrIntersectionType.isUnion() ? List_distinct(concat(map((arg) => toList(checker.getPropertiesOfType(arg)), toList(unionOrIntersectionType.types))), {
|
|
209
222
|
Equals: equals,
|
|
210
223
|
GetHashCode: structuralHash,
|
|
211
224
|
}) : toList(unionOrIntersectionType.getProperties()));
|
|
@@ -225,7 +238,7 @@ export function readTypeNode(reader, typeNode) {
|
|
|
225
238
|
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
226
239
|
}
|
|
227
240
|
else {
|
|
228
|
-
return new GlueType(
|
|
241
|
+
return new GlueType(22, [choose((_arg) => {
|
|
229
242
|
if (_arg.tag === 1) {
|
|
230
243
|
throw new Error("Sould not happen here");
|
|
231
244
|
}
|
|
@@ -235,14 +248,38 @@ export function readTypeNode(reader, typeNode) {
|
|
|
235
248
|
}, properties)]);
|
|
236
249
|
}
|
|
237
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
|
+
}
|
|
238
275
|
case 196: {
|
|
239
276
|
const parenthesizedTypeNode = typeNode;
|
|
240
277
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](parenthesizedTypeNode.type);
|
|
241
278
|
}
|
|
242
279
|
case 197: {
|
|
243
280
|
const thisTypeNode = typeNode;
|
|
244
|
-
const
|
|
245
|
-
return new GlueType(
|
|
281
|
+
const typ_1 = checker.getTypeAtLocation(thisTypeNode);
|
|
282
|
+
return new GlueType(19, [typ_1.symbol.name]);
|
|
246
283
|
}
|
|
247
284
|
case 198: {
|
|
248
285
|
const typeOperatorNode = typeNode;
|
|
@@ -250,16 +287,22 @@ export function readTypeNode(reader, typeNode) {
|
|
|
250
287
|
}
|
|
251
288
|
case 201: {
|
|
252
289
|
const literalTypeNode = typeNode;
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
290
|
+
const matchValue_3 = tryReadLiteral(literalTypeNode.literal);
|
|
291
|
+
if (matchValue_3 == null) {
|
|
255
292
|
throw new Error(generateReaderError("type node - literal type", "Could not read literal type", typeNode));
|
|
256
293
|
}
|
|
257
294
|
else {
|
|
258
|
-
return new GlueType(8, [
|
|
295
|
+
return new GlueType(8, [matchValue_3]);
|
|
259
296
|
}
|
|
260
297
|
}
|
|
261
298
|
case 202:
|
|
262
299
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNamedTupleMemberZ6E17C942"](typeNode);
|
|
300
|
+
case 203:
|
|
301
|
+
return new GlueType(27, []);
|
|
302
|
+
case 233: {
|
|
303
|
+
const expression = typeNode;
|
|
304
|
+
return new GlueType(13, [new GlueTypeReference(expression.expression.getText(), getFullNameOrEmpty(checker, expression), readTypeArguments(reader, expression), false)]);
|
|
305
|
+
}
|
|
263
306
|
default: {
|
|
264
307
|
const item = generateReaderError("type node", toText(interpolate("Unsupported kind %A%P()", [typeNode.kind])), typeNode);
|
|
265
308
|
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeNode.fs"],"names":["
|
|
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;;;AAnBtBE,iCACCF;AAAAG,gCAAc,AAAAD,aAAc;AAE1BF,iCAAA,AAAAG;oBAAAH;qBAAA;AASC,2BAAA,kBAPH,yBACW,AAAAC,iBACQ,SACL,SACO,SACC;qBAPpB;AAa\u002BB,2BAAA;;AAC9B,2BAAA,AAAAG,6EAAgBD;;;;SAG7B,IAxBI,AAwBJ,6BAAa,GAxBTH;AAyBF,eAAA,iBAAmB;;SACrB,IA1BI,AA0BJ,6BAAa,GA1BTA;AA2BF,eAAA,iBAAmB;;SACrB,IA5BI,AA4BJ,6BAAa,IA5BTA;AA4BiC,eAAA,iBAAmB;;SACxD,IA7BI,AA6BJ,6BAAa,GA7BTA;AA6B6B,eAAA,iBAAmB;;SACpD,IA9BI,AA8BJ,6BAAa,OA9BTA;AA8B8B,eAAA,iBAAmB;;;AAChD,eAAA,iBAAmB;;;;;AAOlBC,gBACA,AAAAG,8FAAmCC;AA6Bb,WAAA,iBAAjB,kBAvBF;AACOL,2BAAA,AAAAC;AACJ,YADI,AACJ,6BAAa,KADTD;AAEEM,gCAAcL;AAIU,mBAAA,iBAA5B,oBAF0B,AAAAK;;aAG5B,IAPI,AAOJ,6BAAa,KAPTN;AAQEM,kCAAcL;AAUT,mBAAA,iBAPL,AACI,qBAAkC,AAAAK,wBAElC,oBAA2B,AAAAA,0BAE3B,oBAA\u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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(),
|
|
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":"
|
|
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}
|
|
@@ -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
|
|
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
|
-
|
|
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;;;;;
|
|
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;AAIE,mBAAA,AACA,AAAAY,mBAAmBd,QAHHE;;;AASjB,mBAAA,UADH,AAAAF,iFAAoBE;;OA5G7B,IAASD,yBAFT,OADH,AAAAc;;;;WA2H2C,iBAA3C,AAAAD,mBAAmBd,QAAOe","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -3,9 +3,10 @@ import { tryParse } from "../../fable_modules/fable-library-js.4.14.0/Int32.js";
|
|
|
3
3
|
import { FSharpRef } from "../../fable_modules/fable-library-js.4.14.0/Types.js";
|
|
4
4
|
import { GlueAccessor, GlueLiteral } from "../GlueAST.js";
|
|
5
5
|
import { tryParse as tryParse_1 } from "../../fable_modules/fable-library-js.4.14.0/Double.js";
|
|
6
|
-
import { interpolate, toText } from "../../fable_modules/fable-library-js.4.14.0/String.js";
|
|
6
|
+
import { endsWith, interpolate, toText } from "../../fable_modules/fable-library-js.4.14.0/String.js";
|
|
7
7
|
import { class_type } from "../../fable_modules/fable-library-js.4.14.0/Reflection.js";
|
|
8
|
-
import { exists } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
8
|
+
import { toList, exists } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
9
|
+
import { collect, empty, map } from "../../fable_modules/fable-library-js.4.14.0/List.js";
|
|
9
10
|
|
|
10
11
|
export function $007CHasTypeFlags$007C_$007C(flag, flags) {
|
|
11
12
|
if ((flags & flag) !== 0) {
|
|
@@ -151,4 +152,51 @@ export function ModifierUtil_HasModifier_Z687DC302(modifiers, modifier) {
|
|
|
151
152
|
return ModifierUtil_HasModifier_Z39CCF48F(modifiers, modifier);
|
|
152
153
|
}
|
|
153
154
|
|
|
155
|
+
export function readTypeArguments(reader, node) {
|
|
156
|
+
const matchValue = node.typeArguments;
|
|
157
|
+
if (matchValue != null) {
|
|
158
|
+
return map((arg) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](arg), toList(matchValue));
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return empty();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function readHeritageClauses(reader, heritageClauses) {
|
|
166
|
+
if (heritageClauses == null) {
|
|
167
|
+
return empty();
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
return collect((clause) => map((typNode) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode), toList(clause.types)), toList(heritageClauses));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Determine if the type is from the ES5 library
|
|
176
|
+
*
|
|
177
|
+
* This is to detect native utility types usage
|
|
178
|
+
*/
|
|
179
|
+
export function isFromEs5Lib(symbolOpt) {
|
|
180
|
+
if (symbolOpt != null) {
|
|
181
|
+
const symbol = symbolOpt;
|
|
182
|
+
const matchValue = symbol.declarations;
|
|
183
|
+
if (matchValue != null) {
|
|
184
|
+
const declarations = matchValue;
|
|
185
|
+
if (declarations[0].parent.kind === 312) {
|
|
186
|
+
const sourceFile = declarations[0].parent;
|
|
187
|
+
return endsWith(sourceFile.fileName, "lib/lib.es5.d.ts");
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
154
202
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Glutinum.Converter/Reader/Utils.fs"],"names":["flags","flag","text","isNumericString","matchValue","outArg","expression","literal","tryReadNumericLiteral","sourceFile","node","lineAndChar","line","column","errorContext","reason","checker","symbol","tryGetFullName","modifiers","modifier","GetAccessor","currentModifier","HasModifier"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/Glutinum.Converter/Reader/Utils.fs"],"names":["flags","flag","text","isNumericString","matchValue","outArg","expression","literal","tryReadNumericLiteral","sourceFile","node","lineAndChar","line","column","errorContext","reason","checker","symbol","tryGetFullName","modifiers","modifier","GetAccessor","currentModifier","HasModifier","reader","heritageClauses","typNode","clause","symbolOpt","declarations"],"mappings":";;;;;;;;;;;AASI,QAAG,CAAA,AAAIA,QAAcC,UAAQ;AACzB,eAAA,KAAI;;;AAEJ,eAAA;;;;;AAGJ,QAAG,CAAA,AAAID,QAAcC,UAAQ;AACzB,eAAA,KAAI;;;AAEJ,eAAA;;;;;AAGJ,QAAG,CAAA,AAAID,QAAcC,UAAQ;AACzB,eAAA,KAAI;;;AAEJ,eAAA;;;;;AAGJ,QAAA,CAAA,OAASC,UAAO;AAAuD,eAAA,CAA7B,aAARA;;;eAAlC;;;;;AAGA,QAAG,AAAAC,gBAAgBD;AAETE;AAAAC;AAAAD,sBAAA,SAAsBF,s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