@glutinum/cli 0.10.0 → 0.12.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 +48 -0
- package/dist/Glutinum.Converter/FsharpAST.js +76 -21
- package/dist/Glutinum.Converter/FsharpAST.js.map +1 -1
- package/dist/Glutinum.Converter/Generate.js +5 -7
- package/dist/Glutinum.Converter/Generate.js.map +1 -1
- package/dist/Glutinum.Converter/GlueAST.js +90 -14
- package/dist/Glutinum.Converter/GlueAST.js.map +1 -1
- package/dist/Glutinum.Converter/Log.js +5 -5
- package/dist/Glutinum.Converter/Log.js.map +1 -1
- package/dist/Glutinum.Converter/Merge.js +7 -7
- package/dist/Glutinum.Converter/Merge.js.map +1 -1
- package/dist/Glutinum.Converter/Printer.js +203 -106
- package/dist/Glutinum.Converter/Printer.js.map +1 -1
- package/dist/Glutinum.Converter/Read.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js +20 -19
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Documentation.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +4 -3
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +2 -2
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +5 -6
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +42 -0
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +1 -0
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Node.js +8 -5
- package/dist/Glutinum.Converter/Reader/Node.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Parameters.js +7 -4
- package/dist/Glutinum.Converter/Reader/Parameters.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Report.js +35 -0
- package/dist/Glutinum.Converter/Reader/Report.js.map +1 -0
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +5 -0
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js +250 -69
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +31 -26
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +127 -0
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +1 -0
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +7 -2
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +6 -9
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/Utils.js +35 -13
- package/dist/Glutinum.Converter/Reader/Utils.js.map +1 -1
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +2 -2
- package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +1 -1
- package/dist/Glutinum.Converter/Transform.js +614 -211
- package/dist/Glutinum.Converter/Transform.js.map +1 -1
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +745 -0
- package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +1 -0
- package/dist/Glutinum.Converter/Utils/Naming.js +6 -2
- package/dist/Glutinum.Converter/Utils/Naming.js.map +1 -1
- package/dist/Program.js +2 -2
- package/dist/Program.js.map +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AssemblyInfo.fs +19 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs +207 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js +127 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOption.fs +81 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs +183 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js +37 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionOp.fs +24 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResult.fs +439 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs +217 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOp.fs +24 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs +75 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +26 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs +238 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionOp.fs +24 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidation.fs +190 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs +194 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationOp.fs +35 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +51 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs +218 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js +358 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Option.fs +331 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +186 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionOp.fs +21 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs +644 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js +45 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs +155 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js +23 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOp.fs +45 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs +201 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js +65 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs +146 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionOp.fs +57 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +19 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +31 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +22 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Validation.fs +172 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs +148 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +1 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationOp.fs +35 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOption.fs +151 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +165 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +3 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +3 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
- package/dist/fable_modules/project_cracked.json +1 -1
- package/package.json +3 -2
- package/src/Glutinum.Converter/js/bootstrap.js +16 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { bool_type, array_type, string_type, record_type, list_type, class_type } from "../fable_modules/fable-library-js.4.14.0/Reflection.js";
|
|
2
2
|
import { printf, toFail, interpolate, toText, join, trimStart } from "../fable_modules/fable-library-js.4.14.0/String.js";
|
|
3
3
|
import { Record } from "../fable_modules/fable-library-js.4.14.0/Types.js";
|
|
4
|
-
import {
|
|
5
|
-
import { empty as empty_1, singleton as singleton_1, collect, append, delay, toList } from "../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
6
|
-
import { exists, item, concat, tryFind, choose, collect as collect_1, ofArray, forAll, filter, mapIndexed, length, partition, sortBy, map, append as append_1, head as head_1, tail, singleton, empty, isEmpty } from "../fable_modules/fable-library-js.4.14.0/List.js";
|
|
4
|
+
import { FSharpSingleErasedCaseUnion, FSharpJSApi, FSharpTypeParameterInfo_Create_Z6CFD3565, FSharpEnum, FSharpEnumCase, FSharpUnionCaseNamed, FSharpStaticMemberInfo, FSharpAccessor, FSharpMember, FSharpMemberInfo, FSharpMemberInfoBody, FSharpClass, FSharpConstructor, FSharpAccessibility, FSharpExplicitField, FSharpParameter, FSharpTypeAlias, FSharpDelegate, FSharpFunctionType, FSharpTypeReference, FSharpThisType, FSharpUnion, FSharpUnionCase, FSharpInterface, FSharpTypeParameter, FSharpMapped, FSharpPrimitive, FSharpLiteral, FSharpCommentTypeParam, FSharpCommentParam, FSharpXmlDoc, FSharpAttribute, FSharpType, FSharpModule, FSharpType_$reflection, FSharpXmlDoc_$reflection, FSharpAttribute_$reflection } from "./FsharpAST.js";
|
|
7
5
|
import { sanitizeNameWithResult, removeSurroundingQuotes, sanitizeName } from "./Utils/Naming.js";
|
|
6
|
+
import { empty as empty_1, singleton as singleton_1, collect, append, delay, toList } from "../fable_modules/fable-library-js.4.14.0/Seq.js";
|
|
7
|
+
import { item, concat, collect as collect_1, forAll, exists, filter, tryFind, mapIndexed, partition, ofArray, length, choose, tryHead, iterate, sortBy, map, append as append_1, head as head_1, tail, singleton, empty, isEmpty } from "../fable_modules/fable-library-js.4.14.0/List.js";
|
|
8
8
|
import { bind, unwrap, value as value_4, map as map_1, defaultArg } from "../fable_modules/fable-library-js.4.14.0/Option.js";
|
|
9
|
-
import { int32ToString, safeHash, equals, comparePrimitives } from "../fable_modules/fable-library-js.4.14.0/Util.js";
|
|
10
|
-
import { GlueType,
|
|
9
|
+
import { int32ToString, safeHash, equals, disposeSafe, getEnumerator, comparePrimitives } from "../fable_modules/fable-library-js.4.14.0/Util.js";
|
|
10
|
+
import { GlueTypeUnion, GlueType, GlueLiteral__ToText, GlueMember, GlueProperty, GlueAccessor, GlueConstructor, GlueType__get_Name } from "./GlueAST.js";
|
|
11
11
|
import { List_distinct } from "../fable_modules/fable-library-js.4.14.0/Seq2.js";
|
|
12
12
|
import { apply as apply_1 } from "./Merge.js";
|
|
13
13
|
|
|
@@ -16,6 +16,8 @@ export class Reporter {
|
|
|
16
16
|
this["Warnings@"] = [];
|
|
17
17
|
this["Errors@"] = [];
|
|
18
18
|
this["HasRegEpx@"] = false;
|
|
19
|
+
this["HasReadonlyArray@"] = false;
|
|
20
|
+
this["HasIterable@"] = false;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -65,17 +67,19 @@ export function TransformCommentResult_$reflection() {
|
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
export class TransformResult extends Record {
|
|
68
|
-
constructor(FSharpAST, Warnings, Errors, IncludeRegExpAlias) {
|
|
70
|
+
constructor(FSharpAST, Warnings, Errors, IncludeRegExpAlias, IncludeReadonlyArrayAlias, IncludeIterableAlias) {
|
|
69
71
|
super();
|
|
70
72
|
this.FSharpAST = FSharpAST;
|
|
71
73
|
this.Warnings = Warnings;
|
|
72
74
|
this.Errors = Errors;
|
|
73
75
|
this.IncludeRegExpAlias = IncludeRegExpAlias;
|
|
76
|
+
this.IncludeReadonlyArrayAlias = IncludeReadonlyArrayAlias;
|
|
77
|
+
this.IncludeIterableAlias = IncludeIterableAlias;
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
export function TransformResult_$reflection() {
|
|
78
|
-
return record_type("Glutinum.Converter.Transform.TransformResult", [], TransformResult, () => [["FSharpAST", list_type(FSharpType_$reflection())], ["Warnings", array_type(string_type)], ["Errors", array_type(string_type)], ["IncludeRegExpAlias", bool_type]]);
|
|
82
|
+
return record_type("Glutinum.Converter.Transform.TransformResult", [], TransformResult, () => [["FSharpAST", list_type(FSharpType_$reflection())], ["Warnings", array_type(string_type)], ["Errors", array_type(string_type)], ["IncludeRegExpAlias", bool_type], ["IncludeReadonlyArrayAlias", bool_type], ["IncludeIterableAlias", bool_type]]);
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
export function Reporter__get_Warnings(__) {
|
|
@@ -94,6 +98,22 @@ export function Reporter__set_HasRegEpx_Z1FBCCD16(__, v) {
|
|
|
94
98
|
__["HasRegEpx@"] = v;
|
|
95
99
|
}
|
|
96
100
|
|
|
101
|
+
export function Reporter__get_HasReadonlyArray(__) {
|
|
102
|
+
return __["HasReadonlyArray@"];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function Reporter__set_HasReadonlyArray_Z1FBCCD16(__, v) {
|
|
106
|
+
__["HasReadonlyArray@"] = v;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function Reporter__get_HasIterable(__) {
|
|
110
|
+
return __["HasIterable@"];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function Reporter__set_HasIterable_Z1FBCCD16(__, v) {
|
|
114
|
+
__["HasIterable@"] = v;
|
|
115
|
+
}
|
|
116
|
+
|
|
97
117
|
export function TransformContext__get_FullName(__) {
|
|
98
118
|
return __["FullName@"];
|
|
99
119
|
}
|
|
@@ -118,6 +138,14 @@ export function TransformContext__ExposeRegExp(_) {
|
|
|
118
138
|
Reporter__set_HasRegEpx_Z1FBCCD16(_.reporter, true);
|
|
119
139
|
}
|
|
120
140
|
|
|
141
|
+
export function TransformContext__ExposeReadonlyArray(_) {
|
|
142
|
+
Reporter__set_HasReadonlyArray_Z1FBCCD16(_.reporter, true);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function TransformContext__ExposeIterable(_) {
|
|
146
|
+
Reporter__set_HasIterable_Z1FBCCD16(_.reporter, true);
|
|
147
|
+
}
|
|
148
|
+
|
|
121
149
|
export function TransformContext__ExposeType_Z1D58A540(_, typ) {
|
|
122
150
|
const matchValue = _.parent;
|
|
123
151
|
if (matchValue != null) {
|
|
@@ -130,7 +158,7 @@ export function TransformContext__ExposeType_Z1D58A540(_, typ) {
|
|
|
130
158
|
}
|
|
131
159
|
|
|
132
160
|
export function TransformContext__PushScope_Z721C83C5(this$, scopeName) {
|
|
133
|
-
const childContext = TransformContext_$ctor_Z4CBC0890(this$.reporter, scopeName, this$.typeMemory, this$);
|
|
161
|
+
const childContext = TransformContext_$ctor_Z4CBC0890(this$.reporter, sanitizeName(scopeName), this$.typeMemory, this$);
|
|
134
162
|
void (this$.modules.push(childContext));
|
|
135
163
|
return childContext;
|
|
136
164
|
}
|
|
@@ -142,7 +170,7 @@ export function TransformContext__ToList(_) {
|
|
|
142
170
|
return empty();
|
|
143
171
|
}
|
|
144
172
|
else {
|
|
145
|
-
return singleton(new FSharpType(
|
|
173
|
+
return singleton(new FSharpType(4, [new FSharpModule(_.currentScopeName, false, types)]));
|
|
146
174
|
}
|
|
147
175
|
}
|
|
148
176
|
else {
|
|
@@ -158,39 +186,55 @@ export function TransformContext__AddError_Z721C83C5(_, error) {
|
|
|
158
186
|
void (Reporter__get_Errors(_.reporter).push(error));
|
|
159
187
|
}
|
|
160
188
|
|
|
189
|
+
export function TransformContext__ExposeTypeAlias_Z721C83C5(this$, name) {
|
|
190
|
+
switch (name) {
|
|
191
|
+
case "RegExp": {
|
|
192
|
+
TransformContext__ExposeRegExp(this$);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
case "ReadonlyArray": {
|
|
196
|
+
TransformContext__ExposeReadonlyArray(this$);
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
case "Iterable": {
|
|
200
|
+
TransformContext__ExposeIterable(this$);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
default:
|
|
204
|
+
0;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function TransformContext__ExposeTypeAlias_1CE4A880(this$, typ) {
|
|
209
|
+
if (typ.tag === 13) {
|
|
210
|
+
const typeReference = typ.fields[0];
|
|
211
|
+
if (typeReference.IsStandardLibrary) {
|
|
212
|
+
TransformContext__ExposeTypeAlias_Z721C83C5(this$, typeReference.Name);
|
|
213
|
+
}
|
|
214
|
+
return typ;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
return typ;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
161
221
|
function mapTypeNameToFableCoreAwareName(context, typeReference) {
|
|
222
|
+
let mappedName;
|
|
162
223
|
if (typeReference.IsStandardLibrary) {
|
|
163
224
|
const matchValue = typeReference.Name;
|
|
164
|
-
|
|
165
|
-
case "Date":
|
|
166
|
-
return "JS.Date";
|
|
167
|
-
case "Promise":
|
|
168
|
-
return "JS.Promise";
|
|
169
|
-
case "Uint8Array":
|
|
170
|
-
return "JS.Uint8Array";
|
|
171
|
-
case "ReadonlyArray":
|
|
172
|
-
return "ResizeArray";
|
|
173
|
-
case "Array":
|
|
174
|
-
return "ResizeArray";
|
|
175
|
-
case "Boolean":
|
|
176
|
-
return "bool";
|
|
177
|
-
case "RegExp": {
|
|
178
|
-
TransformContext__ExposeRegExp(context);
|
|
179
|
-
return "RegExp";
|
|
180
|
-
}
|
|
181
|
-
default:
|
|
182
|
-
return matchValue;
|
|
183
|
-
}
|
|
225
|
+
mappedName = ((matchValue === "Date") ? "JS.Date" : ((matchValue === "Promise") ? "JS.Promise" : ((matchValue === "Uint8Array") ? "JS.Uint8Array" : ((matchValue === "Array") ? "ResizeArray" : ((matchValue === "Boolean") ? "bool" : ((matchValue === "Function") ? "Action" : ((matchValue === "Error") ? "Exception" : matchValue)))))));
|
|
184
226
|
}
|
|
185
227
|
else {
|
|
186
|
-
|
|
228
|
+
mappedName = typeReference.Name;
|
|
187
229
|
}
|
|
230
|
+
TransformContext__ExposeTypeAlias_Z721C83C5(context, mappedName);
|
|
231
|
+
return mappedName;
|
|
188
232
|
}
|
|
189
233
|
|
|
190
234
|
function unwrapOptionIfAlreadyOptional(context, typ, isOptional) {
|
|
191
235
|
const typ$0027 = transformType(context, typ);
|
|
192
236
|
if (isOptional) {
|
|
193
|
-
if (typ$0027.tag ===
|
|
237
|
+
if (typ$0027.tag === 3) {
|
|
194
238
|
return typ$0027.fields[0];
|
|
195
239
|
}
|
|
196
240
|
else {
|
|
@@ -353,13 +397,138 @@ function transformPrimitive(gluePrimitive) {
|
|
|
353
397
|
return new FSharpPrimitive(6, []);
|
|
354
398
|
case 10:
|
|
355
399
|
return new FSharpPrimitive(6, []);
|
|
400
|
+
case 11:
|
|
401
|
+
return new FSharpPrimitive(6, []);
|
|
356
402
|
default:
|
|
357
403
|
return new FSharpPrimitive(0, []);
|
|
358
404
|
}
|
|
359
405
|
}
|
|
360
406
|
|
|
361
407
|
function transformTupleType(context, glueTypes) {
|
|
362
|
-
return new FSharpType(
|
|
408
|
+
return new FSharpType(12, [map((glueType) => transformType(context, glueType), glueTypes)]);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export function TypeLiteral_tryFindIterableType(context, typeLiteralInfo) {
|
|
412
|
+
const makeIterable = (typeParameter) => (new FSharpType(7, [new FSharpMapped("Iterable", singleton(typeParameter))]));
|
|
413
|
+
const makeIterableObj = () => makeIterable(new FSharpTypeParameter(0, [new FSharpType(18, [])]));
|
|
414
|
+
return map_1((methodSignature_1) => {
|
|
415
|
+
const matchValue = methodSignature_1.Type;
|
|
416
|
+
switch (matchValue.tag) {
|
|
417
|
+
case 13: {
|
|
418
|
+
const typeReference = matchValue.fields[0];
|
|
419
|
+
if (typeReference.Name === "IterableIterator") {
|
|
420
|
+
return makeIterable(new FSharpTypeParameter(0, [transformType(context, head_1(typeReference.TypeArguments))]));
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
return makeIterableObj();
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
case 21: {
|
|
427
|
+
let returnType = new FSharpTypeParameter(0, [new FSharpType(18, [])]);
|
|
428
|
+
const enumerator = getEnumerator(matchValue.fields[0].Members);
|
|
429
|
+
try {
|
|
430
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
431
|
+
const m = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
432
|
+
let matchResult, nextMethodSignature_1;
|
|
433
|
+
if (m.tag === 6) {
|
|
434
|
+
if (m.fields[0].Name === "next") {
|
|
435
|
+
matchResult = 0;
|
|
436
|
+
nextMethodSignature_1 = m.fields[0];
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
matchResult = 1;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
matchResult = 1;
|
|
444
|
+
}
|
|
445
|
+
switch (matchResult) {
|
|
446
|
+
case 0: {
|
|
447
|
+
const matchValue_1 = nextMethodSignature_1.Type;
|
|
448
|
+
if (matchValue_1.tag === 21) {
|
|
449
|
+
iterate((_arg_1) => {
|
|
450
|
+
let matchResult_1, property_1;
|
|
451
|
+
if (_arg_1.tag === 1) {
|
|
452
|
+
if (_arg_1.fields[0].Name === "value") {
|
|
453
|
+
matchResult_1 = 0;
|
|
454
|
+
property_1 = _arg_1.fields[0];
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
matchResult_1 = 1;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
matchResult_1 = 1;
|
|
462
|
+
}
|
|
463
|
+
switch (matchResult_1) {
|
|
464
|
+
case 0: {
|
|
465
|
+
returnType = (new FSharpTypeParameter(0, [transformType(context, property_1.Type)]));
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
case 1: {
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}, matchValue_1.fields[0].Members);
|
|
473
|
+
}
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
finally {
|
|
480
|
+
disposeSafe(enumerator);
|
|
481
|
+
}
|
|
482
|
+
return makeIterable(returnType);
|
|
483
|
+
}
|
|
484
|
+
default:
|
|
485
|
+
return makeIterableObj();
|
|
486
|
+
}
|
|
487
|
+
}, tryHead(choose((_arg) => {
|
|
488
|
+
if (_arg.tag === 6) {
|
|
489
|
+
const methodSignature = _arg.fields[0];
|
|
490
|
+
if (methodSignature.Name === "[Symbol.iterator]") {
|
|
491
|
+
TransformContext__ExposeIterable(context);
|
|
492
|
+
return methodSignature;
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
return void 0;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
return void 0;
|
|
500
|
+
}
|
|
501
|
+
}, typeLiteralInfo.Members)));
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function UtilityType_transformReadOnly(context, readonlyInfo, makeTypeAlias) {
|
|
505
|
+
if (readonlyInfo.tag === 1) {
|
|
506
|
+
const interfaces = readonlyInfo.fields[0];
|
|
507
|
+
const patternInput = sanitizeNameAndPushScope(`U${length(interfaces)}`, context);
|
|
508
|
+
const unionType = new FSharpType(1, [new FSharpUnion(empty(), patternInput[0], map((glueInterface) => {
|
|
509
|
+
const context_2 = TransformContext__PushScope_Z721C83C5(patternInput[1], `ReadOnly${glueInterface.Name}`);
|
|
510
|
+
const initialInterface = transformInterface(context_2, glueInterface);
|
|
511
|
+
const adaptedInterface = new FSharpInterface(initialInterface.Attributes, initialInterface.Name, initialInterface.OriginalName, initialInterface.TypeParameters, TransformMembers_forceReadonly(initialInterface.Members), initialInterface.Inheritance);
|
|
512
|
+
TransformContext__ExposeType_Z1D58A540(context_2, new FSharpType(5, [new FSharpInterface(adaptedInterface.Attributes, TransformContext__get_CurrentScopeName(context_2), adaptedInterface.OriginalName, adaptedInterface.TypeParameters, adaptedInterface.Members, adaptedInterface.Inheritance)]));
|
|
513
|
+
return new FSharpUnionCase(1, [new FSharpType(5, [new FSharpInterface(adaptedInterface.Attributes, TransformContext__get_FullName(context_2), adaptedInterface.OriginalName, adaptedInterface.TypeParameters, adaptedInterface.Members, adaptedInterface.Inheritance)])]);
|
|
514
|
+
}, interfaces), false)]);
|
|
515
|
+
if (makeTypeAlias == null) {
|
|
516
|
+
return unionType;
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
return makeTypeAlias(unionType);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
const interfaceTyp = new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), TransformContext__get_CurrentScopeName(context), TransformContext__get_CurrentScopeName(context), empty(), TransformMembers_forceReadonly(TransformMembers_toFSharpMember(context, readonlyInfo.fields[0])), empty())]);
|
|
524
|
+
if (makeTypeAlias == null) {
|
|
525
|
+
TransformContext__ExposeType_Z1D58A540(context, interfaceTyp);
|
|
526
|
+
return new FSharpType(7, [new FSharpMapped(TransformContext__get_FullName(context), empty())]);
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
return interfaceTyp;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
363
532
|
}
|
|
364
533
|
|
|
365
534
|
function transformType(context_mut, glueType_mut) {
|
|
@@ -369,19 +538,23 @@ function transformType(context_mut, glueType_mut) {
|
|
|
369
538
|
const context = context_mut, glueType = glueType_mut;
|
|
370
539
|
switch (glueType.tag) {
|
|
371
540
|
case 3:
|
|
372
|
-
return new FSharpType(
|
|
541
|
+
return new FSharpType(8, [transformPrimitive(glueType.fields[0])]);
|
|
373
542
|
case 25:
|
|
374
|
-
return new FSharpType(
|
|
543
|
+
return new FSharpType(8, [new FSharpPrimitive(0, [])]);
|
|
375
544
|
case 22:
|
|
376
|
-
return new FSharpType(
|
|
377
|
-
case 17:
|
|
378
|
-
|
|
545
|
+
return new FSharpType(3, [transformType(context, glueType.fields[0])]);
|
|
546
|
+
case 17: {
|
|
547
|
+
const thisTypeInfo = glueType.fields[0];
|
|
548
|
+
return new FSharpType(15, [new FSharpThisType(thisTypeInfo.Name, transformTypeParameters(context, thisTypeInfo.TypeParameters))]);
|
|
549
|
+
}
|
|
379
550
|
case 18:
|
|
380
551
|
return transformTupleType(context, glueType.fields[0]);
|
|
552
|
+
case 29:
|
|
553
|
+
return transformReadOnly(context, glueType.fields[0]);
|
|
381
554
|
case 7: {
|
|
382
|
-
const patternInput = partition((
|
|
383
|
-
if (
|
|
384
|
-
const primitiveInfo_1 =
|
|
555
|
+
const patternInput = partition((glueType_3) => {
|
|
556
|
+
if (glueType_3.tag === 3) {
|
|
557
|
+
const primitiveInfo_1 = glueType_3.fields[0];
|
|
385
558
|
switch (primitiveInfo_1.tag) {
|
|
386
559
|
case 7:
|
|
387
560
|
case 8:
|
|
@@ -397,7 +570,7 @@ function transformType(context_mut, glueType_mut) {
|
|
|
397
570
|
const others = patternInput[1];
|
|
398
571
|
const isOptional = !isEmpty(patternInput[0]);
|
|
399
572
|
if (isOptional && (length(others) === 1)) {
|
|
400
|
-
return new FSharpType(
|
|
573
|
+
return new FSharpType(3, [transformType(context, head_1(others))]);
|
|
401
574
|
}
|
|
402
575
|
else if (length(others) === 1) {
|
|
403
576
|
context_mut = context;
|
|
@@ -412,28 +585,56 @@ function transformType(context_mut, glueType_mut) {
|
|
|
412
585
|
}
|
|
413
586
|
else {
|
|
414
587
|
TransformContext__ExposeType_Z1D58A540(context, matchValue);
|
|
415
|
-
return new FSharpType(
|
|
588
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
416
589
|
}
|
|
417
590
|
}
|
|
418
591
|
}
|
|
419
592
|
case 13: {
|
|
420
593
|
const typeReference = glueType.fields[0];
|
|
421
|
-
return new FSharpType(
|
|
594
|
+
return new FSharpType(11, [new FSharpTypeReference(mapTypeNameToFableCoreAwareName(context, typeReference), typeReference.FullName, map((glueType_4) => transformType(context, glueType_4), typeReference.TypeArguments), defaultArg(map_1((glueType_6) => transformType(context, glueType_6), tryFind((glueType_5) => {
|
|
595
|
+
if (glueType_5.tag === 1) {
|
|
596
|
+
return glueType_5.fields[0].FullName === typeReference.FullName;
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
return false;
|
|
600
|
+
}
|
|
601
|
+
}, TransformContext__get_TypeMemory(context))), new FSharpType(10, [])))]);
|
|
422
602
|
}
|
|
423
603
|
case 14:
|
|
424
|
-
return new FSharpType(
|
|
604
|
+
return new FSharpType(14, [transformType(context, glueType.fields[0])]);
|
|
425
605
|
case 12: {
|
|
426
606
|
const classDeclaration = glueType.fields[0];
|
|
427
|
-
return new FSharpType(
|
|
607
|
+
return new FSharpType(11, [new FSharpTypeReference(classDeclaration.Name, classDeclaration.Name, empty(), new FSharpType(10, []))]);
|
|
428
608
|
}
|
|
429
609
|
case 16:
|
|
430
|
-
return new FSharpType(
|
|
610
|
+
return new FSharpType(13, [glueType.fields[0]]);
|
|
431
611
|
case 15: {
|
|
432
612
|
const functionTypeInfo = glueType.fields[0];
|
|
433
|
-
|
|
613
|
+
const paremeters = filter((parameter) => (parameter.Name !== "this"), functionTypeInfo.Parameters);
|
|
614
|
+
let matchResult;
|
|
615
|
+
if (!isEmpty(paremeters)) {
|
|
616
|
+
if (isEmpty(tail(paremeters))) {
|
|
617
|
+
matchResult = 0;
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
matchResult = 1;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
matchResult = 0;
|
|
625
|
+
}
|
|
626
|
+
switch (matchResult) {
|
|
627
|
+
case 0:
|
|
628
|
+
return new FSharpType(16, [new FSharpFunctionType(map((parameter_1) => transformParameter(context, parameter_1), paremeters), transformType(context, functionTypeInfo.Type))]);
|
|
629
|
+
default: {
|
|
630
|
+
const typParameters = transformTypeParameters(context, filter((typeParameter) => exists((parameter_2) => (typeParameter.Name === GlueType__get_Name(parameter_2.Type)), paremeters), functionTypeInfo.TypeParameters));
|
|
631
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(20, [new FSharpDelegate(TransformContext__get_CurrentScopeName(context), typParameters, map((parameter_3) => transformParameter(context, parameter_3), paremeters), transformType(context, functionTypeInfo.Type))]));
|
|
632
|
+
return new FSharpType(9, [new FSharpTypeAlias(empty(), TransformContext__get_FullName(context), empty(), new FSharpType(10, []), typParameters)]);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
434
635
|
}
|
|
435
636
|
case 1:
|
|
436
|
-
return new FSharpType(
|
|
637
|
+
return new FSharpType(5, [transformInterface(context, glueType.fields[0])]);
|
|
437
638
|
case 21: {
|
|
438
639
|
const typeLiteralInfo = glueType.fields[0];
|
|
439
640
|
if (forAll((_arg) => {
|
|
@@ -450,24 +651,32 @@ function transformType(context_mut, glueType_mut) {
|
|
|
450
651
|
return false;
|
|
451
652
|
}
|
|
452
653
|
}, typeLiteralInfo.Members)) {
|
|
453
|
-
const typeLiteralParameters = sortBy((_arg_1) => _arg_1.IsOptional, map((
|
|
454
|
-
const matchValue_1 =
|
|
455
|
-
if (matchValue_1.tag ===
|
|
456
|
-
return new FSharpParameter(
|
|
654
|
+
const typeLiteralParameters = sortBy((_arg_1) => _arg_1.IsOptional, map((parameter_4) => {
|
|
655
|
+
const matchValue_1 = parameter_4.Type;
|
|
656
|
+
if (matchValue_1.tag === 3) {
|
|
657
|
+
return new FSharpParameter(parameter_4.Attributes, parameter_4.Name, true, matchValue_1.fields[0]);
|
|
457
658
|
}
|
|
458
659
|
else {
|
|
459
|
-
return
|
|
660
|
+
return parameter_4;
|
|
460
661
|
}
|
|
461
662
|
}, TransformMembers_toFSharpParameters(context, typeLiteralInfo.Members)), {
|
|
462
663
|
Compare: comparePrimitives,
|
|
463
664
|
});
|
|
464
|
-
const explicitFields = map((
|
|
465
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(
|
|
665
|
+
const explicitFields = map((parameter_5) => (new FSharpExplicitField(parameter_5.Name, parameter_5.IsOptional ? (new FSharpType(3, [parameter_5.Type])) : parameter_5.Type)), typeLiteralParameters);
|
|
666
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(17, [new FSharpClass(ofArray([new FSharpAttribute(17, []), new FSharpAttribute(8, [])]), TransformContext__get_CurrentScopeName(context), empty(), new FSharpConstructor(typeLiteralParameters, ofArray([new FSharpAttribute(18, []), new FSharpAttribute(2, [])]), new FSharpAccessibility(0, [])), empty(), explicitFields)]));
|
|
466
667
|
}
|
|
467
668
|
else {
|
|
468
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(
|
|
669
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), TransformContext__get_CurrentScopeName(context), "", empty(), TransformMembers_toFSharpMember(context, typeLiteralInfo.Members), toList(delay(() => {
|
|
670
|
+
const matchValue_2 = TypeLiteral_tryFindIterableType(context, typeLiteralInfo);
|
|
671
|
+
if (matchValue_2 == null) {
|
|
672
|
+
return empty_1();
|
|
673
|
+
}
|
|
674
|
+
else {
|
|
675
|
+
return singleton_1(matchValue_2);
|
|
676
|
+
}
|
|
677
|
+
})))]));
|
|
469
678
|
}
|
|
470
|
-
return new FSharpType(
|
|
679
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
471
680
|
}
|
|
472
681
|
case 24: {
|
|
473
682
|
context_mut = context;
|
|
@@ -480,13 +689,13 @@ function transformType(context_mut, glueType_mut) {
|
|
|
480
689
|
continue transformType;
|
|
481
690
|
}
|
|
482
691
|
case 9: {
|
|
483
|
-
const
|
|
484
|
-
if (
|
|
485
|
-
return new FSharpType(
|
|
692
|
+
const matchValue_3 = TypeAliasDeclaration_tryTransformKeyOf(TransformContext__get_CurrentScopeName(context), glueType.fields[0]);
|
|
693
|
+
if (matchValue_3 == null) {
|
|
694
|
+
return new FSharpType(18, []);
|
|
486
695
|
}
|
|
487
696
|
else {
|
|
488
|
-
TransformContext__ExposeType_Z1D58A540(context,
|
|
489
|
-
return new FSharpType(
|
|
697
|
+
TransformContext__ExposeType_Z1D58A540(context, matchValue_3);
|
|
698
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
490
699
|
}
|
|
491
700
|
}
|
|
492
701
|
case 19: {
|
|
@@ -495,57 +704,98 @@ function transformType(context_mut, glueType_mut) {
|
|
|
495
704
|
continue transformType;
|
|
496
705
|
}
|
|
497
706
|
case 0:
|
|
498
|
-
return new FSharpType(
|
|
707
|
+
return new FSharpType(18, []);
|
|
499
708
|
case 8: {
|
|
500
709
|
const glueLiteral = glueType.fields[0];
|
|
501
710
|
switch (glueLiteral.tag) {
|
|
502
711
|
case 1:
|
|
503
|
-
return new FSharpType(
|
|
712
|
+
return new FSharpType(8, [new FSharpPrimitive(1, [])]);
|
|
504
713
|
case 2:
|
|
505
|
-
return new FSharpType(
|
|
714
|
+
return new FSharpType(8, [new FSharpPrimitive(2, [])]);
|
|
506
715
|
case 3:
|
|
507
|
-
return new FSharpType(
|
|
716
|
+
return new FSharpType(8, [new FSharpPrimitive(3, [])]);
|
|
508
717
|
case 4:
|
|
509
|
-
return new FSharpType(
|
|
718
|
+
return new FSharpType(8, [new FSharpPrimitive(6, [])]);
|
|
510
719
|
default:
|
|
511
|
-
return new FSharpType(
|
|
720
|
+
return new FSharpType(8, [new FSharpPrimitive(0, [])]);
|
|
512
721
|
}
|
|
513
722
|
}
|
|
514
723
|
case 6: {
|
|
515
724
|
const functionDeclaration = glueType.fields[0];
|
|
516
|
-
return new FSharpType(
|
|
725
|
+
return new FSharpType(16, [new FSharpFunctionType(map((parameter_6) => transformParameter(context, parameter_6), functionDeclaration.Parameters), transformType(context, functionDeclaration.Type))]);
|
|
517
726
|
}
|
|
518
727
|
case 20: {
|
|
519
728
|
const members_1 = glueType.fields[0];
|
|
520
729
|
if (isEmpty(members_1)) {
|
|
521
|
-
return new FSharpType(
|
|
730
|
+
return new FSharpType(18, []);
|
|
522
731
|
}
|
|
523
732
|
else {
|
|
524
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(
|
|
525
|
-
return new FSharpType(
|
|
733
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), TransformContext__get_CurrentScopeName(context), TransformContext__get_CurrentScopeName(context), empty(), TransformMembers_toFSharpMember(context, members_1), empty())]));
|
|
734
|
+
return new FSharpType(7, [new FSharpMapped(TransformContext__get_FullName(context), empty())]);
|
|
526
735
|
}
|
|
527
736
|
}
|
|
528
737
|
case 26: {
|
|
529
738
|
const utilityType = glueType.fields[0];
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
739
|
+
let matchResult_1, innerType;
|
|
740
|
+
switch (utilityType.tag) {
|
|
741
|
+
case 1: {
|
|
742
|
+
matchResult_1 = 1;
|
|
743
|
+
break;
|
|
744
|
+
}
|
|
745
|
+
case 2: {
|
|
746
|
+
matchResult_1 = 2;
|
|
747
|
+
innerType = utilityType.fields[0];
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
750
|
+
case 3: {
|
|
751
|
+
matchResult_1 = 2;
|
|
752
|
+
innerType = utilityType.fields[0];
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
case 4: {
|
|
756
|
+
matchResult_1 = 3;
|
|
757
|
+
break;
|
|
758
|
+
}
|
|
759
|
+
case 5: {
|
|
760
|
+
matchResult_1 = 4;
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
default:
|
|
764
|
+
matchResult_1 = 0;
|
|
533
765
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
766
|
+
switch (matchResult_1) {
|
|
767
|
+
case 0: {
|
|
768
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(5, [(originalInterface = transformInterface(context, utilityType.fields[0]), Interface_makePartial(TransformContext__get_CurrentScopeName(context), originalInterface))]));
|
|
769
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
770
|
+
}
|
|
771
|
+
case 1: {
|
|
772
|
+
TransformContext__ExposeType_Z1D58A540(context, transformRecord(context, TransformContext__get_CurrentScopeName(context), empty(), utilityType.fields[0]));
|
|
773
|
+
return new FSharpType(7, [new FSharpMapped(TransformContext__get_FullName(context), empty())]);
|
|
774
|
+
}
|
|
775
|
+
case 2: {
|
|
776
|
+
context_mut = context;
|
|
777
|
+
glueType_mut = innerType;
|
|
778
|
+
continue transformType;
|
|
779
|
+
}
|
|
780
|
+
case 3: {
|
|
781
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), TransformContext__get_CurrentScopeName(context), TransformContext__get_CurrentScopeName(context), empty(), TransformMembers_toFSharpMember(context, utilityType.fields[0]), empty())]));
|
|
782
|
+
return new FSharpType(7, [new FSharpMapped(TransformContext__get_FullName(context), empty())]);
|
|
783
|
+
}
|
|
784
|
+
default:
|
|
785
|
+
return UtilityType_transformReadOnly(context, utilityType.fields[0], void 0);
|
|
537
786
|
}
|
|
538
787
|
}
|
|
539
788
|
case 5:
|
|
540
|
-
return new FSharpType(
|
|
789
|
+
return new FSharpType(7, [new FSharpMapped(glueType.fields[0].Name, empty())]);
|
|
790
|
+
case 27:
|
|
541
791
|
case 11:
|
|
542
792
|
case 10:
|
|
543
793
|
case 4: {
|
|
544
794
|
TransformContext__AddError_Z721C83C5(context, toText(interpolate("Could not transform type: %A%P()", [glueType])));
|
|
545
|
-
return new FSharpType(
|
|
795
|
+
return new FSharpType(10, []);
|
|
546
796
|
}
|
|
547
797
|
default:
|
|
548
|
-
return new FSharpType(
|
|
798
|
+
return new FSharpType(18, []);
|
|
549
799
|
}
|
|
550
800
|
break;
|
|
551
801
|
}
|
|
@@ -553,7 +803,7 @@ function transformType(context_mut, glueType_mut) {
|
|
|
553
803
|
|
|
554
804
|
function transformExports(context, isTopLevel, exports) {
|
|
555
805
|
const context_1 = TransformContext__PushScope_Z721C83C5(context, "Exports");
|
|
556
|
-
return new FSharpType(
|
|
806
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(7, []), new FSharpAttribute(6, [])]), "Exports", "Exports", empty(), collect_1((_arg) => {
|
|
557
807
|
let Attributes_1, Parameters_1;
|
|
558
808
|
let matchResult, info, info_1, info_2, moduleDeclaration, glueType, glueType_1;
|
|
559
809
|
switch (_arg.tag) {
|
|
@@ -611,12 +861,12 @@ function transformExports(context, isTopLevel, exports) {
|
|
|
611
861
|
return map((constructorInfo) => {
|
|
612
862
|
let Attributes_2, Parameters_2;
|
|
613
863
|
const xmlDocInfo_2 = transformComment(constructorInfo.Documentation);
|
|
614
|
-
return new FSharpMember(0, [(Attributes_2 = toList(delay(() => append(isTopLevel ? append(singleton_1(new FSharpAttribute(3, [info_2.Name, "REPLACE_ME_WITH_MODULE_NAME"])), delay(() => singleton_1(new FSharpAttribute(13, [])))) : singleton_1(new FSharpAttribute(14, [info_2.Name])), delay(() => xmlDocInfo_2.ObsoleteAttributes)))), (Parameters_2 = map((parameter_1) => transformParameter(context_4, parameter_1), constructorInfo.Parameters), new FSharpMemberInfo(Attributes_2, patternInput_2[0], info_2.Name, transformTypeParameters(context_4, info_2.TypeParameters), Parameters_2, new FSharpType(
|
|
864
|
+
return new FSharpMember(0, [(Attributes_2 = toList(delay(() => append(isTopLevel ? append(singleton_1(new FSharpAttribute(3, [info_2.Name, "REPLACE_ME_WITH_MODULE_NAME"])), delay(() => singleton_1(new FSharpAttribute(13, [])))) : singleton_1(new FSharpAttribute(14, [info_2.Name])), delay(() => xmlDocInfo_2.ObsoleteAttributes)))), (Parameters_2 = map((parameter_1) => transformParameter(context_4, parameter_1), constructorInfo.Parameters), new FSharpMemberInfo(Attributes_2, patternInput_2[0], info_2.Name, transformTypeParameters(context_4, info_2.TypeParameters), Parameters_2, new FSharpType(7, [new FSharpMapped(sanitizeName(info_2.Name), transformTypeParameters(context_4, info_2.TypeParameters))]), false, isTopLevel, void 0, new FSharpAccessibility(0, []), xmlDocInfo_2.XmlDoc, new FSharpMemberInfoBody(0, []))))]);
|
|
615
865
|
}, isEmpty(info_2.Constructors) ? singleton(new GlueConstructor(empty(), empty())) : info_2.Constructors);
|
|
616
866
|
}
|
|
617
867
|
case 3: {
|
|
618
868
|
const sanitizedName = sanitizeName(moduleDeclaration.Name);
|
|
619
|
-
return singleton(new FSharpMember(1, [new FSharpMemberInfo(ofArray([new FSharpAttribute(4, ["REPLACE_ME_WITH_MODULE_NAME"]), new FSharpAttribute(0, [`Emit("$0.${removeSurroundingQuotes(moduleDeclaration.Name)}")`])]), sanitizedName + "_", `${moduleDeclaration.Name}.Exports`, empty(), empty(), new FSharpType(
|
|
869
|
+
return singleton(new FSharpMember(1, [new FSharpMemberInfo(ofArray([new FSharpAttribute(4, ["REPLACE_ME_WITH_MODULE_NAME"]), new FSharpAttribute(0, [`Emit("$0.${removeSurroundingQuotes(moduleDeclaration.Name)}")`])]), sanitizedName + "_", `${moduleDeclaration.Name}.Exports`, empty(), empty(), new FSharpType(7, [new FSharpMapped(`${sanitizedName}.Exports`, empty())]), false, isTopLevel, new FSharpAccessor(0, []), new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]));
|
|
620
870
|
}
|
|
621
871
|
case 4: {
|
|
622
872
|
const patternInput_3 = sanitizeNameAndPushScope(GlueType__get_Name(glueType), context_1);
|
|
@@ -631,7 +881,7 @@ function transformExports(context, isTopLevel, exports) {
|
|
|
631
881
|
function transformParameter(context, parameter) {
|
|
632
882
|
let typ;
|
|
633
883
|
const computedType = unwrapOptionIfAlreadyOptional(TransformContext__PushScope_Z721C83C5(context, parameter.Name), parameter.Type, parameter.IsOptional);
|
|
634
|
-
typ = (parameter.IsSpread ? ((computedType.tag ===
|
|
884
|
+
typ = (parameter.IsSpread ? ((computedType.tag === 14) ? computedType.fields[0] : computedType) : computedType);
|
|
635
885
|
return new FSharpParameter(toList(delay(() => (parameter.IsSpread ? singleton_1(new FSharpAttribute(19, [])) : empty_1()))), sanitizeName(parameter.Name), parameter.IsOptional, typ);
|
|
636
886
|
}
|
|
637
887
|
|
|
@@ -647,16 +897,16 @@ function transformAccessor(accessor) {
|
|
|
647
897
|
}
|
|
648
898
|
|
|
649
899
|
function TransformMembers_toFSharpMember(context, members) {
|
|
650
|
-
return choose((
|
|
651
|
-
switch (
|
|
900
|
+
return choose((_arg_4) => {
|
|
901
|
+
switch (_arg_4.tag) {
|
|
652
902
|
case 4: {
|
|
653
|
-
const callSignatureInfo =
|
|
903
|
+
const callSignatureInfo = _arg_4.fields[0];
|
|
654
904
|
const patternInput_1 = sanitizeNameAndPushScope("Invoke", context);
|
|
655
905
|
const context_2 = patternInput_1[1];
|
|
656
906
|
return new FSharpMember(0, [new FSharpMemberInfo(singleton(new FSharpAttribute(1, [])), patternInput_1[0], "Invoke", empty(), map((parameter_2) => transformParameter(context_2, parameter_2), callSignatureInfo.Parameters), transformType(context_2, callSignatureInfo.Type), false, false, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
657
907
|
}
|
|
658
908
|
case 1: {
|
|
659
|
-
const propertyInfo =
|
|
909
|
+
const propertyInfo = _arg_4.fields[0];
|
|
660
910
|
const patternInput_2 = sanitizeNameAndPushScope(propertyInfo.Name, context);
|
|
661
911
|
const xmlDocInfo = transformComment(propertyInfo.Documentation);
|
|
662
912
|
if (propertyInfo.IsPrivate && !propertyInfo.IsStatic) {
|
|
@@ -667,98 +917,138 @@ function TransformMembers_toFSharpMember(context, members) {
|
|
|
667
917
|
}
|
|
668
918
|
}
|
|
669
919
|
case 2: {
|
|
670
|
-
const getAccessorInfo_1 =
|
|
920
|
+
const getAccessorInfo_1 = _arg_4.fields[0];
|
|
671
921
|
const patternInput_3 = sanitizeNameAndPushScope(getAccessorInfo_1.Name, context);
|
|
672
922
|
const xmlDocInfo_1 = transformComment(getAccessorInfo_1.Documentation);
|
|
673
923
|
return new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo_1.ObsoleteAttributes)), patternInput_3[0], getAccessorInfo_1.Name, empty(), empty(), transformType(patternInput_3[1], getAccessorInfo_1.Type), false, getAccessorInfo_1.IsStatic, new FSharpAccessor(0, []), new FSharpAccessibility(0, []), xmlDocInfo_1.XmlDoc, new FSharpMemberInfoBody(0, []))]);
|
|
674
924
|
}
|
|
675
925
|
case 3: {
|
|
676
|
-
const setAccessorInfo_1 =
|
|
926
|
+
const setAccessorInfo_1 = _arg_4.fields[0];
|
|
677
927
|
const patternInput_4 = sanitizeNameAndPushScope(setAccessorInfo_1.Name, context);
|
|
678
928
|
const xmlDocInfo_2 = transformComment(setAccessorInfo_1.Documentation);
|
|
679
929
|
return new FSharpMember(1, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo_2.ObsoleteAttributes)), patternInput_4[0], setAccessorInfo_1.Name, empty(), empty(), transformType(patternInput_4[1], setAccessorInfo_1.ArgumentType), false, setAccessorInfo_1.IsStatic, new FSharpAccessor(1, []), new FSharpAccessibility(0, []), xmlDocInfo_2.XmlDoc, new FSharpMemberInfoBody(0, []))]);
|
|
680
930
|
}
|
|
681
931
|
case 5: {
|
|
682
|
-
const indexSignature =
|
|
932
|
+
const indexSignature = _arg_4.fields[0];
|
|
683
933
|
const patternInput_5 = sanitizeNameAndPushScope("Item", context);
|
|
684
934
|
const context_6 = patternInput_5[1];
|
|
685
|
-
return new FSharpMember(1, [new FSharpMemberInfo(singleton(new FSharpAttribute(16, [])), patternInput_5[0], "Item", empty(), map((parameter_3) => transformParameter(context_6, parameter_3), indexSignature.Parameters), transformType(context_6, indexSignature.Type), false, false, new FSharpAccessor(2, []), new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
935
|
+
return new FSharpMember(1, [new FSharpMemberInfo(singleton(new FSharpAttribute(16, [])), patternInput_5[0], "Item", empty(), map((parameter_3) => transformParameter(context_6, parameter_3), indexSignature.Parameters), transformType(context_6, indexSignature.Type), false, false, indexSignature.IsReadOnly ? (new FSharpAccessor(0, [])) : (new FSharpAccessor(2, [])), new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
686
936
|
}
|
|
687
937
|
case 6: {
|
|
688
|
-
const methodSignature =
|
|
938
|
+
const methodSignature = _arg_4.fields[0];
|
|
689
939
|
const patternInput_6 = sanitizeNameAndPushScope(methodSignature.Name, context);
|
|
690
940
|
const context_7 = patternInput_6[1];
|
|
691
941
|
const xmlDocInfo_3 = transformComment(methodSignature.Documentation);
|
|
692
942
|
return new FSharpMember(0, [new FSharpMemberInfo(toList(delay(() => xmlDocInfo_3.ObsoleteAttributes)), patternInput_6[0], methodSignature.Name, empty(), map((parameter_4) => transformParameter(context_7, parameter_4), methodSignature.Parameters), transformType(context_7, methodSignature.Type), false, false, void 0, new FSharpAccessibility(0, []), xmlDocInfo_3.XmlDoc, new FSharpMemberInfoBody(0, []))]);
|
|
693
943
|
}
|
|
694
944
|
case 7: {
|
|
695
|
-
const constructSignature =
|
|
945
|
+
const constructSignature = _arg_4.fields[0];
|
|
696
946
|
const patternInput_7 = sanitizeNameAndPushScope("Create", context);
|
|
697
947
|
const context_8 = patternInput_7[1];
|
|
698
948
|
return new FSharpMember(0, [new FSharpMemberInfo(singleton(new FSharpAttribute(13, [])), patternInput_7[0], "Create", empty(), map((parameter_5) => transformParameter(context_8, parameter_5), constructSignature.Parameters), transformType(context_8, constructSignature.Type), false, false, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
699
949
|
}
|
|
700
950
|
default: {
|
|
701
|
-
const methodInfo =
|
|
951
|
+
const methodInfo = _arg_4.fields[0];
|
|
702
952
|
const patternInput = sanitizeNameAndPushScope(methodInfo.Name, context);
|
|
703
|
-
const
|
|
953
|
+
const name_1 = patternInput[0];
|
|
704
954
|
const context_1 = patternInput[1];
|
|
705
955
|
if (methodInfo.IsStatic) {
|
|
706
|
-
return new FSharpMember(2, [new FSharpStaticMemberInfo(empty(),
|
|
956
|
+
return new FSharpMember(2, [new FSharpStaticMemberInfo(empty(), name_1, methodInfo.Name, empty(), map((parameter) => transformParameter(context_1, parameter), methodInfo.Parameters), transformType(context_1, methodInfo.Type), methodInfo.IsOptional, void 0, new FSharpAccessibility(0, []))]);
|
|
707
957
|
}
|
|
708
958
|
else {
|
|
709
|
-
return new FSharpMember(0, [new FSharpMemberInfo(empty(),
|
|
959
|
+
return new FSharpMember(0, [new FSharpMemberInfo(empty(), name_1, methodInfo.Name, empty(), map((parameter_1) => transformParameter(context_1, parameter_1), methodInfo.Parameters), transformType(context_1, methodInfo.Type), methodInfo.IsOptional, methodInfo.IsStatic, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))]);
|
|
710
960
|
}
|
|
711
961
|
}
|
|
712
962
|
}
|
|
713
|
-
}, choose((
|
|
714
|
-
switch (
|
|
963
|
+
}, choose((_arg_1) => {
|
|
964
|
+
switch (_arg_1.tag) {
|
|
715
965
|
case 3: {
|
|
716
|
-
const associatedGetAccessor = tryFind((
|
|
717
|
-
if (
|
|
718
|
-
return
|
|
966
|
+
const associatedGetAccessor = tryFind((_arg_3) => {
|
|
967
|
+
if (_arg_3.tag === 2) {
|
|
968
|
+
return _arg_1.fields[0].Name === _arg_3.fields[0].Name;
|
|
719
969
|
}
|
|
720
970
|
else {
|
|
721
971
|
return false;
|
|
722
972
|
}
|
|
723
973
|
}, members);
|
|
724
974
|
if (associatedGetAccessor == null) {
|
|
725
|
-
return
|
|
975
|
+
return _arg_1;
|
|
726
976
|
}
|
|
727
977
|
else {
|
|
728
978
|
return void 0;
|
|
729
979
|
}
|
|
730
980
|
}
|
|
731
981
|
case 4:
|
|
732
|
-
return
|
|
982
|
+
return _arg_1;
|
|
733
983
|
case 0:
|
|
734
|
-
return
|
|
984
|
+
return _arg_1;
|
|
735
985
|
case 1:
|
|
736
|
-
return
|
|
986
|
+
return _arg_1;
|
|
737
987
|
case 5:
|
|
738
|
-
return
|
|
988
|
+
return _arg_1;
|
|
739
989
|
case 6:
|
|
740
|
-
return
|
|
990
|
+
return _arg_1;
|
|
741
991
|
case 7:
|
|
742
|
-
return
|
|
992
|
+
return _arg_1;
|
|
743
993
|
default: {
|
|
744
|
-
const getAccessorInfo =
|
|
745
|
-
const associatedSetAccessor = tryFind((
|
|
746
|
-
if (
|
|
747
|
-
return getAccessorInfo.Name ===
|
|
994
|
+
const getAccessorInfo = _arg_1.fields[0];
|
|
995
|
+
const associatedSetAccessor = tryFind((_arg_2) => {
|
|
996
|
+
if (_arg_2.tag === 3) {
|
|
997
|
+
return getAccessorInfo.Name === _arg_2.fields[0].Name;
|
|
748
998
|
}
|
|
749
999
|
else {
|
|
750
1000
|
return false;
|
|
751
1001
|
}
|
|
752
1002
|
}, members);
|
|
753
1003
|
if (associatedSetAccessor == null) {
|
|
754
|
-
return
|
|
1004
|
+
return _arg_1;
|
|
755
1005
|
}
|
|
756
1006
|
else {
|
|
757
1007
|
return new GlueMember(1, [new GlueProperty(getAccessorInfo.Name, getAccessorInfo.Documentation, getAccessorInfo.Type, getAccessorInfo.IsStatic, false, new GlueAccessor(2, []), getAccessorInfo.IsPrivate)]);
|
|
758
1008
|
}
|
|
759
1009
|
}
|
|
760
1010
|
}
|
|
761
|
-
},
|
|
1011
|
+
}, filter((_arg) => {
|
|
1012
|
+
let matchResult, name;
|
|
1013
|
+
switch (_arg.tag) {
|
|
1014
|
+
case 2:
|
|
1015
|
+
case 3:
|
|
1016
|
+
case 1:
|
|
1017
|
+
case 4:
|
|
1018
|
+
case 7:
|
|
1019
|
+
case 5: {
|
|
1020
|
+
matchResult = 1;
|
|
1021
|
+
break;
|
|
1022
|
+
}
|
|
1023
|
+
case 6: {
|
|
1024
|
+
matchResult = 0;
|
|
1025
|
+
name = _arg.fields[0].Name;
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
default: {
|
|
1029
|
+
matchResult = 0;
|
|
1030
|
+
name = _arg.fields[0].Name;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
switch (matchResult) {
|
|
1034
|
+
case 0:
|
|
1035
|
+
return name !== "[Symbol.iterator]";
|
|
1036
|
+
default:
|
|
1037
|
+
return true;
|
|
1038
|
+
}
|
|
1039
|
+
}, members)));
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function TransformMembers_forceReadonly(members) {
|
|
1043
|
+
return map((_arg) => {
|
|
1044
|
+
if (_arg.tag === 1) {
|
|
1045
|
+
const property = _arg.fields[0];
|
|
1046
|
+
return new FSharpMember(1, [new FSharpMemberInfo(property.Attributes, property.Name, property.OriginalName, property.TypeParameters, property.Parameters, property.Type, property.IsOptional, property.IsStatic, new FSharpAccessor(0, []), property.Accessibility, property.XmlDoc, property.Body)]);
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
return _arg;
|
|
1050
|
+
}
|
|
1051
|
+
}, members);
|
|
762
1052
|
}
|
|
763
1053
|
|
|
764
1054
|
function TransformMembers_toFSharpParameters(context, members) {
|
|
@@ -845,7 +1135,7 @@ function transformInterface(context, info) {
|
|
|
845
1135
|
else {
|
|
846
1136
|
return void 0;
|
|
847
1137
|
}
|
|
848
|
-
}, info.HeritageClauses)));
|
|
1138
|
+
}, map((typ) => TransformContext__ExposeTypeAlias_1CE4A880(context_1, typ), info.HeritageClauses))));
|
|
849
1139
|
const standardMembers = TransformMembers_toFSharpMember(context_1, info.Members);
|
|
850
1140
|
const inheritance = filter((heritageClause_1) => {
|
|
851
1141
|
if (heritageClause_1.tag === 13) {
|
|
@@ -855,7 +1145,7 @@ function transformInterface(context, info) {
|
|
|
855
1145
|
else {
|
|
856
1146
|
return true;
|
|
857
1147
|
}
|
|
858
|
-
}, info.HeritageClauses);
|
|
1148
|
+
}, map((typ_1) => TransformContext__ExposeTypeAlias_1CE4A880(context_1, typ_1), info.HeritageClauses));
|
|
859
1149
|
const Members = append_1(standardMembers, membersComingFromPartial);
|
|
860
1150
|
return new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), patternInput[0], info.Name, transformTypeParameters(context_1, info.TypeParameters), Members, map((glueType_1) => transformType(context_1, glueType_1), inheritance));
|
|
861
1151
|
}
|
|
@@ -864,7 +1154,7 @@ export function Interface_makePartial(name, originalInterface) {
|
|
|
864
1154
|
return new FSharpInterface(originalInterface.Attributes, name, originalInterface.OriginalName, originalInterface.TypeParameters, map((m) => {
|
|
865
1155
|
if (m.tag === 1) {
|
|
866
1156
|
const property = m.fields[0];
|
|
867
|
-
if (property.Type.tag ===
|
|
1157
|
+
if (property.Type.tag === 3) {
|
|
868
1158
|
return m;
|
|
869
1159
|
}
|
|
870
1160
|
else {
|
|
@@ -976,7 +1266,7 @@ export function TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType) {
|
|
|
976
1266
|
default:
|
|
977
1267
|
return void 0;
|
|
978
1268
|
}
|
|
979
|
-
}, glueType.fields[0].Members) : empty();
|
|
1269
|
+
}, glueType.fields[0].Members) : ((glueType.tag === 4) ? map((m_1) => (new FSharpUnionCase(0, [new FSharpUnionCaseNamed(empty(), sanitizeName(m_1.Name))])), glueType.fields[0].Members) : empty());
|
|
980
1270
|
if (isEmpty(cases)) {
|
|
981
1271
|
return void 0;
|
|
982
1272
|
}
|
|
@@ -989,7 +1279,7 @@ export function TypeAliasDeclaration_transformKeyOf(context, aliasName, glueType
|
|
|
989
1279
|
const matchValue = TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType);
|
|
990
1280
|
if (matchValue == null) {
|
|
991
1281
|
TransformContext__AddWarning_Z721C83C5(context, `Could not transform KeyOf: ${aliasName}`);
|
|
992
|
-
return new FSharpType(
|
|
1282
|
+
return new FSharpType(10, []);
|
|
993
1283
|
}
|
|
994
1284
|
else {
|
|
995
1285
|
return matchValue;
|
|
@@ -997,7 +1287,7 @@ export function TypeAliasDeclaration_transformKeyOf(context, aliasName, glueType
|
|
|
997
1287
|
}
|
|
998
1288
|
|
|
999
1289
|
export function TypeAliasDeclaration_transformLiteral(xmlDoc, typeAliasName, literalInfo) {
|
|
1000
|
-
const makeTypeAlias = (primitiveType) => (new FSharpType(
|
|
1290
|
+
const makeTypeAlias = (primitiveType) => (new FSharpType(9, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, new FSharpType(8, [primitiveType]), empty())]));
|
|
1001
1291
|
switch (literalInfo.tag) {
|
|
1002
1292
|
case 1:
|
|
1003
1293
|
return makeTypeAlias(new FSharpPrimitive(1, []));
|
|
@@ -1019,19 +1309,23 @@ function transformRecord(context, name, typeParameters, recordInfo) {
|
|
|
1019
1309
|
let parameters;
|
|
1020
1310
|
const patternInput_1 = sanitizeNameAndPushScope("key", context_1);
|
|
1021
1311
|
parameters = singleton(new FSharpParameter(empty(), patternInput_1[0], false, transformType(patternInput_1[1], recordInfo.KeyType)));
|
|
1022
|
-
return new FSharpType(
|
|
1312
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), name_1, name_1, transformTypeParameters(context_1, typeParameters), singleton(new FSharpMember(1, [new FSharpMemberInfo(singleton(new FSharpAttribute(16, [])), "Item", "Item", empty(), parameters, transformType(context_1, recordInfo.ValueType), false, false, new FSharpAccessor(2, []), new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))])), empty())]);
|
|
1023
1313
|
}
|
|
1024
1314
|
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1315
|
+
function transformTypeParameter(context, typeParameter) {
|
|
1316
|
+
return new FSharpTypeParameter(1, [FSharpTypeParameterInfo_Create_Z6CFD3565(typeParameter.Name, unwrap(bind((glueType) => {
|
|
1027
1317
|
const matchValue = transformType(context, glueType);
|
|
1028
|
-
if (matchValue.tag ===
|
|
1318
|
+
if (matchValue.tag === 16) {
|
|
1029
1319
|
return void 0;
|
|
1030
1320
|
}
|
|
1031
1321
|
else {
|
|
1032
1322
|
return matchValue;
|
|
1033
1323
|
}
|
|
1034
|
-
}, typeParameter.Constraint)), unwrap(map_1((glueType_1) => transformType(context, glueType_1), typeParameter.Default)))
|
|
1324
|
+
}, typeParameter.Constraint)), unwrap(map_1((glueType_1) => transformType(context, glueType_1), typeParameter.Default)))]);
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
function transformTypeParameters(context, typeParameters) {
|
|
1328
|
+
return map((typeParameter) => transformTypeParameter(context, typeParameter), typeParameters);
|
|
1035
1329
|
}
|
|
1036
1330
|
|
|
1037
1331
|
function tryOptimizeUnionType(context, typeName, cases) {
|
|
@@ -1165,94 +1459,163 @@ function tryOptimizeUnionType(context, typeName, cases) {
|
|
|
1165
1459
|
return empty();
|
|
1166
1460
|
}
|
|
1167
1461
|
}, cases);
|
|
1168
|
-
return new FSharpType(
|
|
1462
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeName, TransformContext__get_CurrentScopeName(context), empty(), members, empty())]);
|
|
1169
1463
|
}
|
|
1170
1464
|
else {
|
|
1171
1465
|
return void 0;
|
|
1172
1466
|
}
|
|
1173
1467
|
}
|
|
1174
1468
|
|
|
1469
|
+
function transformMappedTypeMembers(context, mappedType) {
|
|
1470
|
+
const matchValue = mappedType.TypeParameter.Constraint;
|
|
1471
|
+
let matchResult, idxTyp, invalid_2;
|
|
1472
|
+
if (matchValue != null) {
|
|
1473
|
+
if (matchValue.tag === 10) {
|
|
1474
|
+
matchResult = 0;
|
|
1475
|
+
idxTyp = matchValue.fields[0];
|
|
1476
|
+
}
|
|
1477
|
+
else {
|
|
1478
|
+
matchResult = 1;
|
|
1479
|
+
invalid_2 = matchValue;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
else {
|
|
1483
|
+
matchResult = 1;
|
|
1484
|
+
invalid_2 = matchValue;
|
|
1485
|
+
}
|
|
1486
|
+
switch (matchResult) {
|
|
1487
|
+
case 0: {
|
|
1488
|
+
const matchValue_1 = idxTyp.ObjectType;
|
|
1489
|
+
let matchResult_1, glueTypes, invalid_1;
|
|
1490
|
+
switch (matchValue_1.tag) {
|
|
1491
|
+
case 29: {
|
|
1492
|
+
if (matchValue_1.fields[0].tag === 18) {
|
|
1493
|
+
matchResult_1 = 0;
|
|
1494
|
+
glueTypes = matchValue_1.fields[0].fields[0];
|
|
1495
|
+
}
|
|
1496
|
+
else {
|
|
1497
|
+
matchResult_1 = 1;
|
|
1498
|
+
invalid_1 = matchValue_1;
|
|
1499
|
+
}
|
|
1500
|
+
break;
|
|
1501
|
+
}
|
|
1502
|
+
case 18: {
|
|
1503
|
+
matchResult_1 = 0;
|
|
1504
|
+
glueTypes = matchValue_1.fields[0];
|
|
1505
|
+
break;
|
|
1506
|
+
}
|
|
1507
|
+
default: {
|
|
1508
|
+
matchResult_1 = 1;
|
|
1509
|
+
invalid_1 = matchValue_1;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
switch (matchResult_1) {
|
|
1513
|
+
case 0:
|
|
1514
|
+
return choose((_arg) => {
|
|
1515
|
+
if (_arg.tag === 8) {
|
|
1516
|
+
return new GlueMember(1, [new GlueProperty(GlueLiteral__ToText(_arg.fields[0]), empty(), defaultArg(mappedType.Type, new GlueType(23, [])), false, false, new GlueAccessor(2, []), false)]);
|
|
1517
|
+
}
|
|
1518
|
+
else {
|
|
1519
|
+
TransformContext__AddError_Z721C83C5(context, toText(interpolate("MappedType: Unexpected type for member %A%P()", [_arg])));
|
|
1520
|
+
return void 0;
|
|
1521
|
+
}
|
|
1522
|
+
}, glueTypes);
|
|
1523
|
+
default: {
|
|
1524
|
+
TransformContext__AddError_Z721C83C5(context, toText(interpolate("MappedType: Unexpected type for members %A%P()", [invalid_1])));
|
|
1525
|
+
return empty();
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
default: {
|
|
1530
|
+
TransformContext__AddError_Z721C83C5(context, toText(interpolate("MappedType: Unexpected type for members %A%P()", [invalid_2])));
|
|
1531
|
+
return empty();
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
function transformReadOnly(context, glueType) {
|
|
1537
|
+
if (glueType.tag === 14) {
|
|
1538
|
+
TransformContext__ExposeReadonlyArray(context);
|
|
1539
|
+
return new FSharpType(19, [new FSharpJSApi(transformType(context, glueType.fields[0]))]);
|
|
1540
|
+
}
|
|
1541
|
+
else {
|
|
1542
|
+
return transformType(context, glueType);
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1175
1546
|
function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
1547
|
+
let matchValue_2, glueType_2;
|
|
1176
1548
|
const patternInput = sanitizeNameAndPushScope(glueTypeAliasDeclaration.Name, context);
|
|
1177
1549
|
const typeAliasName = patternInput[0];
|
|
1178
1550
|
const context_1 = patternInput[1];
|
|
1179
1551
|
const xmlDoc = transformComment(glueTypeAliasDeclaration.Documentation);
|
|
1552
|
+
const makeTypeAlias = (typ) => (new FSharpType(9, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, typ, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters))]));
|
|
1180
1553
|
const matchValue = glueTypeAliasDeclaration.Type;
|
|
1181
1554
|
switch (matchValue.tag) {
|
|
1182
1555
|
case 9:
|
|
1183
1556
|
return TypeAliasDeclaration_transformKeyOf(context_1, glueTypeAliasDeclaration.Name, matchValue.fields[0]);
|
|
1184
|
-
case 10:
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
switch (m.tag) {
|
|
1192
|
-
case 1: {
|
|
1193
|
-
typ_1 = m.fields[0].Type;
|
|
1194
|
-
break;
|
|
1195
|
-
}
|
|
1196
|
-
case 2: {
|
|
1197
|
-
typ_1 = m.fields[0].Type;
|
|
1198
|
-
break;
|
|
1199
|
-
}
|
|
1200
|
-
case 3: {
|
|
1201
|
-
typ_1 = m.fields[0].ArgumentType;
|
|
1202
|
-
break;
|
|
1203
|
-
}
|
|
1204
|
-
case 4: {
|
|
1205
|
-
typ_1 = m.fields[0].Type;
|
|
1206
|
-
break;
|
|
1207
|
-
}
|
|
1208
|
-
case 7: {
|
|
1209
|
-
typ_1 = m.fields[0].Type;
|
|
1210
|
-
break;
|
|
1211
|
-
}
|
|
1212
|
-
case 6: {
|
|
1213
|
-
typ_1 = m.fields[0].Type;
|
|
1214
|
-
break;
|
|
1215
|
-
}
|
|
1216
|
-
case 5: {
|
|
1217
|
-
typ_1 = m.fields[0].Type;
|
|
1218
|
-
break;
|
|
1219
|
-
}
|
|
1220
|
-
default:
|
|
1221
|
-
typ_1 = m.fields[0].Type;
|
|
1557
|
+
case 10:
|
|
1558
|
+
return makeTypeAlias((matchValue_2 = matchValue.fields[0].IndexType, (matchValue_2.tag === 9) ? ((glueType_2 = matchValue_2.fields[0], (glueType_2.tag === 1) ? transformType(context_1, new GlueType(7, [new GlueTypeUnion(List_distinct(collect_1((m) => {
|
|
1559
|
+
let typ_2;
|
|
1560
|
+
switch (m.tag) {
|
|
1561
|
+
case 1: {
|
|
1562
|
+
typ_2 = m.fields[0].Type;
|
|
1563
|
+
break;
|
|
1222
1564
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1565
|
+
case 2: {
|
|
1566
|
+
typ_2 = m.fields[0].Type;
|
|
1567
|
+
break;
|
|
1225
1568
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1569
|
+
case 3: {
|
|
1570
|
+
typ_2 = m.fields[0].ArgumentType;
|
|
1571
|
+
break;
|
|
1228
1572
|
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1573
|
+
case 4: {
|
|
1574
|
+
typ_2 = m.fields[0].Type;
|
|
1575
|
+
break;
|
|
1576
|
+
}
|
|
1577
|
+
case 7: {
|
|
1578
|
+
typ_2 = m.fields[0].Type;
|
|
1579
|
+
break;
|
|
1580
|
+
}
|
|
1581
|
+
case 6: {
|
|
1582
|
+
typ_2 = m.fields[0].Type;
|
|
1583
|
+
break;
|
|
1584
|
+
}
|
|
1585
|
+
case 5: {
|
|
1586
|
+
typ_2 = m.fields[0].Type;
|
|
1587
|
+
break;
|
|
1588
|
+
}
|
|
1589
|
+
default:
|
|
1590
|
+
typ_2 = m.fields[0].Type;
|
|
1591
|
+
}
|
|
1592
|
+
if (typ_2.tag === 7) {
|
|
1593
|
+
return typ_2.fields[0].fields[0];
|
|
1594
|
+
}
|
|
1595
|
+
else {
|
|
1596
|
+
return singleton(typ_2);
|
|
1597
|
+
}
|
|
1598
|
+
}, glueType_2.fields[0].Members), {
|
|
1599
|
+
Equals: equals,
|
|
1600
|
+
GetHashCode: safeHash,
|
|
1601
|
+
}))])) : (new FSharpType(10, [])))) : (new FSharpType(10, []))));
|
|
1239
1602
|
case 8:
|
|
1240
1603
|
return TypeAliasDeclaration_transformLiteral(xmlDoc, typeAliasName, matchValue.fields[0]);
|
|
1241
1604
|
case 3:
|
|
1242
|
-
return new FSharpType(8, [
|
|
1605
|
+
return makeTypeAlias(new FSharpType(8, [transformPrimitive(matchValue.fields[0])]));
|
|
1243
1606
|
case 25:
|
|
1244
|
-
return new FSharpType(8, [new
|
|
1607
|
+
return makeTypeAlias(new FSharpType(8, [new FSharpPrimitive(0, [])]));
|
|
1245
1608
|
case 13: {
|
|
1246
1609
|
const typeReference = matchValue.fields[0];
|
|
1247
1610
|
const mappedName = mapTypeNameToFableCoreAwareName(context_1, typeReference);
|
|
1248
1611
|
const context_2 = TransformContext__PushScope_Z721C83C5(context_1, mappedName);
|
|
1249
|
-
const handleDefaultCase = () => (
|
|
1250
|
-
const
|
|
1612
|
+
const handleDefaultCase = () => makeTypeAlias(transformType(context_2, new GlueType(13, [typeReference])));
|
|
1613
|
+
const matchValue_3 = typeReference.TypeArguments;
|
|
1251
1614
|
let matchResult_1, head;
|
|
1252
|
-
if (!isEmpty(
|
|
1253
|
-
if (isEmpty(tail(
|
|
1615
|
+
if (!isEmpty(matchValue_3)) {
|
|
1616
|
+
if (isEmpty(tail(matchValue_3))) {
|
|
1254
1617
|
matchResult_1 = 0;
|
|
1255
|
-
head = head_1(
|
|
1618
|
+
head = head_1(matchValue_3);
|
|
1256
1619
|
}
|
|
1257
1620
|
else {
|
|
1258
1621
|
matchResult_1 = 1;
|
|
@@ -1267,8 +1630,8 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1267
1630
|
const makeInterfaceTyp = (name) => (new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), name, glueTypeAliasDeclaration.Name, empty(), TransformMembers_toFSharpMember(context_2, head.fields[0]), empty()));
|
|
1268
1631
|
const exposedType = makeInterfaceTyp("ReturnType");
|
|
1269
1632
|
const typeArgument = makeInterfaceTyp(TransformContext__get_FullName(context_2) + ".ReturnType");
|
|
1270
|
-
TransformContext__ExposeType_Z1D58A540(TransformContext__PushScope_Z721C83C5(context_2, typeReference.Name), new FSharpType(
|
|
1271
|
-
return new FSharpType(
|
|
1633
|
+
TransformContext__ExposeType_Z1D58A540(TransformContext__PushScope_Z721C83C5(context_2, typeReference.Name), new FSharpType(5, [exposedType]));
|
|
1634
|
+
return new FSharpType(9, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, new FSharpType(11, [new FSharpTypeReference(mappedName, typeReference.FullName, singleton(new FSharpType(5, [typeArgument])), new FSharpType(10, []))]), empty())]);
|
|
1272
1635
|
}
|
|
1273
1636
|
else {
|
|
1274
1637
|
return handleDefaultCase();
|
|
@@ -1278,30 +1641,67 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1278
1641
|
}
|
|
1279
1642
|
}
|
|
1280
1643
|
case 14:
|
|
1281
|
-
return
|
|
1644
|
+
return makeTypeAlias(transformType(context_1, new GlueType(14, [matchValue.fields[0]])));
|
|
1282
1645
|
case 26: {
|
|
1283
1646
|
const utilityType = matchValue.fields[0];
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1647
|
+
switch (utilityType.tag) {
|
|
1648
|
+
case 1:
|
|
1649
|
+
return transformRecord(context_1, typeAliasName, glueTypeAliasDeclaration.TypeParameters, utilityType.fields[0]);
|
|
1650
|
+
case 2:
|
|
1651
|
+
return makeTypeAlias(transformType(TransformContext__PushScope_Z721C83C5(context_1, "ReturnType"), utilityType.fields[0]));
|
|
1652
|
+
case 3:
|
|
1653
|
+
return makeTypeAlias(transformType(context_1, utilityType.fields[0]));
|
|
1654
|
+
case 4:
|
|
1655
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), TransformMembers_toFSharpMember(context_1, utilityType.fields[0]), empty())]);
|
|
1656
|
+
case 5:
|
|
1657
|
+
return UtilityType_transformReadOnly(context_1, utilityType.fields[0], makeTypeAlias);
|
|
1658
|
+
default:
|
|
1659
|
+
return new FSharpType(5, [Interface_makePartial(typeAliasName, transformInterface(context_1, utilityType.fields[0]))]);
|
|
1289
1660
|
}
|
|
1290
1661
|
}
|
|
1291
1662
|
case 15: {
|
|
1292
1663
|
const functionType = matchValue.fields[0];
|
|
1293
|
-
return new FSharpType(
|
|
1664
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), singleton(new FSharpMember(0, [new FSharpMemberInfo(singleton(new FSharpAttribute(1, [])), "Invoke", "Invoke", empty(), map((parameter) => transformParameter(context_1, parameter), functionType.Parameters), transformType(context_1, functionType.Type), false, false, void 0, new FSharpAccessibility(0, []), empty(), new FSharpMemberInfoBody(0, []))])), empty())]);
|
|
1294
1665
|
}
|
|
1295
1666
|
case 18:
|
|
1296
|
-
return
|
|
1667
|
+
return makeTypeAlias(transformTupleType(context_1, matchValue.fields[0]));
|
|
1297
1668
|
case 20:
|
|
1298
|
-
return new FSharpType(
|
|
1299
|
-
case 21:
|
|
1300
|
-
|
|
1669
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), TransformMembers_toFSharpMember(context_1, matchValue.fields[0]), empty())]);
|
|
1670
|
+
case 21: {
|
|
1671
|
+
const typeLiteralInfo = matchValue.fields[0];
|
|
1672
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), TransformMembers_toFSharpMember(context_1, typeLiteralInfo.Members), toList(delay(() => {
|
|
1673
|
+
const matchValue_4 = TypeLiteral_tryFindIterableType(context_1, typeLiteralInfo);
|
|
1674
|
+
if (matchValue_4 == null) {
|
|
1675
|
+
return empty_1();
|
|
1676
|
+
}
|
|
1677
|
+
else {
|
|
1678
|
+
return singleton_1(matchValue_4);
|
|
1679
|
+
}
|
|
1680
|
+
})))]);
|
|
1681
|
+
}
|
|
1301
1682
|
case 23:
|
|
1302
|
-
return
|
|
1683
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1303
1684
|
case 16:
|
|
1304
|
-
return
|
|
1685
|
+
return makeTypeAlias(new FSharpType(13, [matchValue.fields[0]]));
|
|
1686
|
+
case 27:
|
|
1687
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeAliasName, glueTypeAliasDeclaration.Name, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters), TransformMembers_toFSharpMember(context_1, transformMappedTypeMembers(context_1, matchValue.fields[0])), empty())]);
|
|
1688
|
+
case 28: {
|
|
1689
|
+
const matchValue_5 = glueTypeAliasDeclaration.TypeParameters;
|
|
1690
|
+
if (!isEmpty(matchValue_5)) {
|
|
1691
|
+
if (isEmpty(tail(matchValue_5))) {
|
|
1692
|
+
return new FSharpType(2, [new FSharpSingleErasedCaseUnion(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, transformTypeParameter(context_1, head_1(matchValue_5)))]);
|
|
1693
|
+
}
|
|
1694
|
+
else {
|
|
1695
|
+
TransformContext__AddWarning_Z721C83C5(context_1, `${glueTypeAliasDeclaration.Name} contains a ConstructorType with multiple type parameters, please open an issue at https://github.com/glutinum-org/cli/issues`);
|
|
1696
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
else {
|
|
1700
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
case 29:
|
|
1704
|
+
return makeTypeAlias(transformReadOnly(context_1, matchValue.fields[0]));
|
|
1305
1705
|
case 12:
|
|
1306
1706
|
case 4:
|
|
1307
1707
|
case 1:
|
|
@@ -1314,11 +1714,11 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1314
1714
|
case 24:
|
|
1315
1715
|
case 19:
|
|
1316
1716
|
case 22:
|
|
1317
|
-
return new FSharpType(
|
|
1717
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1318
1718
|
default: {
|
|
1319
1719
|
const matchValue_1 = tryOptimizeUnionType(context_1, typeAliasName, matchValue.fields[0].fields[0]);
|
|
1320
1720
|
if (matchValue_1 == null) {
|
|
1321
|
-
return
|
|
1721
|
+
return makeTypeAlias(transformType(context_1, matchValue));
|
|
1322
1722
|
}
|
|
1323
1723
|
else {
|
|
1324
1724
|
return matchValue_1;
|
|
@@ -1328,14 +1728,14 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1328
1728
|
}
|
|
1329
1729
|
|
|
1330
1730
|
function transformModuleDeclaration(typeMemory, reporter, moduleDeclaration) {
|
|
1331
|
-
return new FSharpType(
|
|
1731
|
+
return new FSharpType(4, [new FSharpModule(sanitizeName(moduleDeclaration.Name), moduleDeclaration.IsRecursive, transform(typeMemory, reporter, false, moduleDeclaration.Types))]);
|
|
1332
1732
|
}
|
|
1333
1733
|
|
|
1334
1734
|
function transformClassDeclaration(context, classDeclaration) {
|
|
1335
1735
|
let Members;
|
|
1336
1736
|
const patternInput = sanitizeNameAndPushScope(classDeclaration.Name, context);
|
|
1337
1737
|
const context_1 = patternInput[1];
|
|
1338
|
-
return new FSharpType(
|
|
1738
|
+
return new FSharpType(5, [(Members = TransformMembers_toFSharpMember(context_1, classDeclaration.Members), new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), patternInput[0], classDeclaration.Name, transformTypeParameters(context_1, classDeclaration.TypeParameters), Members, map((arg) => transformType(context_1, TransformContext__ExposeTypeAlias_1CE4A880(context_1, arg)), classDeclaration.HeritageClauses)))]);
|
|
1339
1739
|
}
|
|
1340
1740
|
|
|
1341
1741
|
function transformToFsharp(context, glueTypes) {
|
|
@@ -1355,9 +1755,11 @@ function transformToFsharp(context, glueTypes) {
|
|
|
1355
1755
|
return transformClassDeclaration(context, exportedType.fields[0]);
|
|
1356
1756
|
}
|
|
1357
1757
|
else {
|
|
1358
|
-
return new FSharpType(
|
|
1758
|
+
return new FSharpType(10, []);
|
|
1359
1759
|
}
|
|
1360
1760
|
}
|
|
1761
|
+
case 28:
|
|
1762
|
+
case 27:
|
|
1361
1763
|
case 15:
|
|
1362
1764
|
case 16:
|
|
1363
1765
|
case 14:
|
|
@@ -1378,10 +1780,11 @@ function transformToFsharp(context, glueTypes) {
|
|
|
1378
1780
|
case 19:
|
|
1379
1781
|
case 25:
|
|
1380
1782
|
case 26:
|
|
1783
|
+
case 29:
|
|
1381
1784
|
case 17:
|
|
1382
|
-
return new FSharpType(
|
|
1785
|
+
return new FSharpType(10, []);
|
|
1383
1786
|
default:
|
|
1384
|
-
return new FSharpType(
|
|
1787
|
+
return new FSharpType(5, [transformInterface(context, _arg.fields[0])]);
|
|
1385
1788
|
}
|
|
1386
1789
|
}, glueTypes);
|
|
1387
1790
|
}
|
|
@@ -1436,7 +1839,7 @@ function transform(typeMemory, reporter, isTopLevel, glueAst) {
|
|
|
1436
1839
|
|
|
1437
1840
|
export function apply(typeMemory, glueAst) {
|
|
1438
1841
|
const reporter = Reporter_$ctor();
|
|
1439
|
-
return new TransformResult(apply_1(transform(typeMemory, reporter, true, glueAst)), Reporter__get_Warnings(reporter), Reporter__get_Errors(reporter), Reporter__get_HasRegEpx(reporter));
|
|
1842
|
+
return new TransformResult(apply_1(transform(typeMemory, reporter, true, glueAst)), Reporter__get_Warnings(reporter), Reporter__get_Errors(reporter), Reporter__get_HasRegEpx(reporter), Reporter__get_HasReadonlyArray(reporter), Reporter__get_HasIterable(reporter));
|
|
1440
1843
|
}
|
|
1441
1844
|
|
|
1442
1845
|
//# sourceMappingURL=Transform.js.map
|