@glutinum/cli 0.10.0 → 0.11.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 +57 -17
- 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 +71 -13
- 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/Printer.js +153 -73
- package/dist/Glutinum.Converter/Printer.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/EnumDeclaration.js +4 -3
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.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/MappedTypeNode.js +42 -0
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +1 -0
- 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 +97 -27
- 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/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 +1 -11
- 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 +327 -154
- package/dist/Glutinum.Converter/Transform.js.map +1 -1
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +735 -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, FSharpTypeParameter_Create_Z6CFD3565, FSharpEnum, FSharpEnumCase, FSharpUnionCaseNamed, FSharpStaticMemberInfo, FSharpAccessor, FSharpMember, FSharpMemberInfo, FSharpMemberInfoBody, FSharpMapped, FSharpInterface, FSharpClass, FSharpConstructor, FSharpAccessibility, FSharpExplicitField, FSharpParameter, FSharpTypeAlias, FSharpDelegate, FSharpFunctionType, FSharpTypeReference, FSharpUnion, FSharpUnionCase, FSharpThisType, 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, tryFind, choose, collect as collect_1, ofArray, forAll, exists, 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";
|
|
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
9
|
import { int32ToString, safeHash, equals, comparePrimitives } from "../fable_modules/fable-library-js.4.14.0/Util.js";
|
|
10
|
-
import { GlueType,
|
|
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,7 @@ export class Reporter {
|
|
|
16
16
|
this["Warnings@"] = [];
|
|
17
17
|
this["Errors@"] = [];
|
|
18
18
|
this["HasRegEpx@"] = false;
|
|
19
|
+
this["HasReadonlyArray@"] = false;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -65,17 +66,18 @@ export function TransformCommentResult_$reflection() {
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
export class TransformResult extends Record {
|
|
68
|
-
constructor(FSharpAST, Warnings, Errors, IncludeRegExpAlias) {
|
|
69
|
+
constructor(FSharpAST, Warnings, Errors, IncludeRegExpAlias, IncludeReadonlyArrayAlias) {
|
|
69
70
|
super();
|
|
70
71
|
this.FSharpAST = FSharpAST;
|
|
71
72
|
this.Warnings = Warnings;
|
|
72
73
|
this.Errors = Errors;
|
|
73
74
|
this.IncludeRegExpAlias = IncludeRegExpAlias;
|
|
75
|
+
this.IncludeReadonlyArrayAlias = IncludeReadonlyArrayAlias;
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
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]]);
|
|
80
|
+
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]]);
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
export function Reporter__get_Warnings(__) {
|
|
@@ -94,6 +96,14 @@ export function Reporter__set_HasRegEpx_Z1FBCCD16(__, v) {
|
|
|
94
96
|
__["HasRegEpx@"] = v;
|
|
95
97
|
}
|
|
96
98
|
|
|
99
|
+
export function Reporter__get_HasReadonlyArray(__) {
|
|
100
|
+
return __["HasReadonlyArray@"];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function Reporter__set_HasReadonlyArray_Z1FBCCD16(__, v) {
|
|
104
|
+
__["HasReadonlyArray@"] = v;
|
|
105
|
+
}
|
|
106
|
+
|
|
97
107
|
export function TransformContext__get_FullName(__) {
|
|
98
108
|
return __["FullName@"];
|
|
99
109
|
}
|
|
@@ -118,6 +128,10 @@ export function TransformContext__ExposeRegExp(_) {
|
|
|
118
128
|
Reporter__set_HasRegEpx_Z1FBCCD16(_.reporter, true);
|
|
119
129
|
}
|
|
120
130
|
|
|
131
|
+
export function TransformContext__ExposeReadonlyArray(_) {
|
|
132
|
+
Reporter__set_HasReadonlyArray_Z1FBCCD16(_.reporter, true);
|
|
133
|
+
}
|
|
134
|
+
|
|
121
135
|
export function TransformContext__ExposeType_Z1D58A540(_, typ) {
|
|
122
136
|
const matchValue = _.parent;
|
|
123
137
|
if (matchValue != null) {
|
|
@@ -130,7 +144,7 @@ export function TransformContext__ExposeType_Z1D58A540(_, typ) {
|
|
|
130
144
|
}
|
|
131
145
|
|
|
132
146
|
export function TransformContext__PushScope_Z721C83C5(this$, scopeName) {
|
|
133
|
-
const childContext = TransformContext_$ctor_Z4CBC0890(this$.reporter, scopeName, this$.typeMemory, this$);
|
|
147
|
+
const childContext = TransformContext_$ctor_Z4CBC0890(this$.reporter, sanitizeName(scopeName), this$.typeMemory, this$);
|
|
134
148
|
void (this$.modules.push(childContext));
|
|
135
149
|
return childContext;
|
|
136
150
|
}
|
|
@@ -142,7 +156,7 @@ export function TransformContext__ToList(_) {
|
|
|
142
156
|
return empty();
|
|
143
157
|
}
|
|
144
158
|
else {
|
|
145
|
-
return singleton(new FSharpType(
|
|
159
|
+
return singleton(new FSharpType(4, [new FSharpModule(_.currentScopeName, false, types)]));
|
|
146
160
|
}
|
|
147
161
|
}
|
|
148
162
|
else {
|
|
@@ -168,16 +182,22 @@ function mapTypeNameToFableCoreAwareName(context, typeReference) {
|
|
|
168
182
|
return "JS.Promise";
|
|
169
183
|
case "Uint8Array":
|
|
170
184
|
return "JS.Uint8Array";
|
|
171
|
-
case "ReadonlyArray":
|
|
172
|
-
|
|
185
|
+
case "ReadonlyArray": {
|
|
186
|
+
TransformContext__ExposeReadonlyArray(context);
|
|
187
|
+
return "ReadonlyArray";
|
|
188
|
+
}
|
|
173
189
|
case "Array":
|
|
174
190
|
return "ResizeArray";
|
|
175
191
|
case "Boolean":
|
|
176
192
|
return "bool";
|
|
193
|
+
case "Function":
|
|
194
|
+
return "Action";
|
|
177
195
|
case "RegExp": {
|
|
178
196
|
TransformContext__ExposeRegExp(context);
|
|
179
197
|
return "RegExp";
|
|
180
198
|
}
|
|
199
|
+
case "Error":
|
|
200
|
+
return "Exception";
|
|
181
201
|
default:
|
|
182
202
|
return matchValue;
|
|
183
203
|
}
|
|
@@ -190,7 +210,7 @@ function mapTypeNameToFableCoreAwareName(context, typeReference) {
|
|
|
190
210
|
function unwrapOptionIfAlreadyOptional(context, typ, isOptional) {
|
|
191
211
|
const typ$0027 = transformType(context, typ);
|
|
192
212
|
if (isOptional) {
|
|
193
|
-
if (typ$0027.tag ===
|
|
213
|
+
if (typ$0027.tag === 3) {
|
|
194
214
|
return typ$0027.fields[0];
|
|
195
215
|
}
|
|
196
216
|
else {
|
|
@@ -353,13 +373,15 @@ function transformPrimitive(gluePrimitive) {
|
|
|
353
373
|
return new FSharpPrimitive(6, []);
|
|
354
374
|
case 10:
|
|
355
375
|
return new FSharpPrimitive(6, []);
|
|
376
|
+
case 11:
|
|
377
|
+
return new FSharpPrimitive(6, []);
|
|
356
378
|
default:
|
|
357
379
|
return new FSharpPrimitive(0, []);
|
|
358
380
|
}
|
|
359
381
|
}
|
|
360
382
|
|
|
361
383
|
function transformTupleType(context, glueTypes) {
|
|
362
|
-
return new FSharpType(
|
|
384
|
+
return new FSharpType(12, [map((glueType) => transformType(context, glueType), glueTypes)]);
|
|
363
385
|
}
|
|
364
386
|
|
|
365
387
|
function transformType(context_mut, glueType_mut) {
|
|
@@ -369,19 +391,23 @@ function transformType(context_mut, glueType_mut) {
|
|
|
369
391
|
const context = context_mut, glueType = glueType_mut;
|
|
370
392
|
switch (glueType.tag) {
|
|
371
393
|
case 3:
|
|
372
|
-
return new FSharpType(
|
|
394
|
+
return new FSharpType(8, [transformPrimitive(glueType.fields[0])]);
|
|
373
395
|
case 25:
|
|
374
|
-
return new FSharpType(
|
|
396
|
+
return new FSharpType(8, [new FSharpPrimitive(0, [])]);
|
|
375
397
|
case 22:
|
|
376
|
-
return new FSharpType(
|
|
377
|
-
case 17:
|
|
378
|
-
|
|
398
|
+
return new FSharpType(3, [transformType(context, glueType.fields[0])]);
|
|
399
|
+
case 17: {
|
|
400
|
+
const thisTypeInfo = glueType.fields[0];
|
|
401
|
+
return new FSharpType(15, [new FSharpThisType(thisTypeInfo.Name, transformTypeParameters(context, thisTypeInfo.TypeParameters))]);
|
|
402
|
+
}
|
|
379
403
|
case 18:
|
|
380
404
|
return transformTupleType(context, glueType.fields[0]);
|
|
405
|
+
case 29:
|
|
406
|
+
return transformReadOnly(context, glueType.fields[0]);
|
|
381
407
|
case 7: {
|
|
382
|
-
const patternInput = partition((
|
|
383
|
-
if (
|
|
384
|
-
const primitiveInfo_1 =
|
|
408
|
+
const patternInput = partition((glueType_3) => {
|
|
409
|
+
if (glueType_3.tag === 3) {
|
|
410
|
+
const primitiveInfo_1 = glueType_3.fields[0];
|
|
385
411
|
switch (primitiveInfo_1.tag) {
|
|
386
412
|
case 7:
|
|
387
413
|
case 8:
|
|
@@ -397,7 +423,7 @@ function transformType(context_mut, glueType_mut) {
|
|
|
397
423
|
const others = patternInput[1];
|
|
398
424
|
const isOptional = !isEmpty(patternInput[0]);
|
|
399
425
|
if (isOptional && (length(others) === 1)) {
|
|
400
|
-
return new FSharpType(
|
|
426
|
+
return new FSharpType(3, [transformType(context, head_1(others))]);
|
|
401
427
|
}
|
|
402
428
|
else if (length(others) === 1) {
|
|
403
429
|
context_mut = context;
|
|
@@ -412,28 +438,49 @@ function transformType(context_mut, glueType_mut) {
|
|
|
412
438
|
}
|
|
413
439
|
else {
|
|
414
440
|
TransformContext__ExposeType_Z1D58A540(context, matchValue);
|
|
415
|
-
return new FSharpType(
|
|
441
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
416
442
|
}
|
|
417
443
|
}
|
|
418
444
|
}
|
|
419
445
|
case 13: {
|
|
420
446
|
const typeReference = glueType.fields[0];
|
|
421
|
-
return new FSharpType(
|
|
447
|
+
return new FSharpType(11, [new FSharpTypeReference(mapTypeNameToFableCoreAwareName(context, typeReference), typeReference.FullName, map((glueType_4) => transformType(context, glueType_4), typeReference.TypeArguments), new FSharpType(8, [new FSharpPrimitive(0, [])]))]);
|
|
422
448
|
}
|
|
423
449
|
case 14:
|
|
424
|
-
return new FSharpType(
|
|
450
|
+
return new FSharpType(14, [transformType(context, glueType.fields[0])]);
|
|
425
451
|
case 12: {
|
|
426
452
|
const classDeclaration = glueType.fields[0];
|
|
427
|
-
return new FSharpType(
|
|
453
|
+
return new FSharpType(11, [new FSharpTypeReference(classDeclaration.Name, classDeclaration.Name, empty(), new FSharpType(10, []))]);
|
|
428
454
|
}
|
|
429
455
|
case 16:
|
|
430
|
-
return new FSharpType(
|
|
456
|
+
return new FSharpType(13, [glueType.fields[0]]);
|
|
431
457
|
case 15: {
|
|
432
458
|
const functionTypeInfo = glueType.fields[0];
|
|
433
|
-
|
|
459
|
+
const paremeters = filter((parameter) => (parameter.Name !== "this"), functionTypeInfo.Parameters);
|
|
460
|
+
let matchResult;
|
|
461
|
+
if (!isEmpty(paremeters)) {
|
|
462
|
+
if (isEmpty(tail(paremeters))) {
|
|
463
|
+
matchResult = 0;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
matchResult = 1;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
matchResult = 0;
|
|
471
|
+
}
|
|
472
|
+
switch (matchResult) {
|
|
473
|
+
case 0:
|
|
474
|
+
return new FSharpType(16, [new FSharpFunctionType(map((parameter_1) => transformParameter(context, parameter_1), paremeters), transformType(context, functionTypeInfo.Type))]);
|
|
475
|
+
default: {
|
|
476
|
+
const typParameters = transformTypeParameters(context, filter((typeParameter) => exists((parameter_2) => (typeParameter.Name === GlueType__get_Name(parameter_2.Type)), paremeters), functionTypeInfo.TypeParameters));
|
|
477
|
+
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))]));
|
|
478
|
+
return new FSharpType(9, [new FSharpTypeAlias(empty(), TransformContext__get_FullName(context), empty(), new FSharpType(10, []), typParameters)]);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
434
481
|
}
|
|
435
482
|
case 1:
|
|
436
|
-
return new FSharpType(
|
|
483
|
+
return new FSharpType(5, [transformInterface(context, glueType.fields[0])]);
|
|
437
484
|
case 21: {
|
|
438
485
|
const typeLiteralInfo = glueType.fields[0];
|
|
439
486
|
if (forAll((_arg) => {
|
|
@@ -450,24 +497,24 @@ function transformType(context_mut, glueType_mut) {
|
|
|
450
497
|
return false;
|
|
451
498
|
}
|
|
452
499
|
}, 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(
|
|
500
|
+
const typeLiteralParameters = sortBy((_arg_1) => _arg_1.IsOptional, map((parameter_4) => {
|
|
501
|
+
const matchValue_1 = parameter_4.Type;
|
|
502
|
+
if (matchValue_1.tag === 3) {
|
|
503
|
+
return new FSharpParameter(parameter_4.Attributes, parameter_4.Name, true, matchValue_1.fields[0]);
|
|
457
504
|
}
|
|
458
505
|
else {
|
|
459
|
-
return
|
|
506
|
+
return parameter_4;
|
|
460
507
|
}
|
|
461
508
|
}, TransformMembers_toFSharpParameters(context, typeLiteralInfo.Members)), {
|
|
462
509
|
Compare: comparePrimitives,
|
|
463
510
|
});
|
|
464
|
-
const explicitFields = map((
|
|
465
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(
|
|
511
|
+
const explicitFields = map((parameter_5) => (new FSharpExplicitField(parameter_5.Name, parameter_5.IsOptional ? (new FSharpType(3, [parameter_5.Type])) : parameter_5.Type)), typeLiteralParameters);
|
|
512
|
+
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
513
|
}
|
|
467
514
|
else {
|
|
468
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(
|
|
515
|
+
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), empty())]));
|
|
469
516
|
}
|
|
470
|
-
return new FSharpType(
|
|
517
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
471
518
|
}
|
|
472
519
|
case 24: {
|
|
473
520
|
context_mut = context;
|
|
@@ -482,11 +529,11 @@ function transformType(context_mut, glueType_mut) {
|
|
|
482
529
|
case 9: {
|
|
483
530
|
const matchValue_2 = TypeAliasDeclaration_tryTransformKeyOf(TransformContext__get_CurrentScopeName(context), glueType.fields[0]);
|
|
484
531
|
if (matchValue_2 == null) {
|
|
485
|
-
return new FSharpType(
|
|
532
|
+
return new FSharpType(18, []);
|
|
486
533
|
}
|
|
487
534
|
else {
|
|
488
535
|
TransformContext__ExposeType_Z1D58A540(context, matchValue_2);
|
|
489
|
-
return new FSharpType(
|
|
536
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
490
537
|
}
|
|
491
538
|
}
|
|
492
539
|
case 19: {
|
|
@@ -495,57 +542,84 @@ function transformType(context_mut, glueType_mut) {
|
|
|
495
542
|
continue transformType;
|
|
496
543
|
}
|
|
497
544
|
case 0:
|
|
498
|
-
return new FSharpType(
|
|
545
|
+
return new FSharpType(18, []);
|
|
499
546
|
case 8: {
|
|
500
547
|
const glueLiteral = glueType.fields[0];
|
|
501
548
|
switch (glueLiteral.tag) {
|
|
502
549
|
case 1:
|
|
503
|
-
return new FSharpType(
|
|
550
|
+
return new FSharpType(8, [new FSharpPrimitive(1, [])]);
|
|
504
551
|
case 2:
|
|
505
|
-
return new FSharpType(
|
|
552
|
+
return new FSharpType(8, [new FSharpPrimitive(2, [])]);
|
|
506
553
|
case 3:
|
|
507
|
-
return new FSharpType(
|
|
554
|
+
return new FSharpType(8, [new FSharpPrimitive(3, [])]);
|
|
508
555
|
case 4:
|
|
509
|
-
return new FSharpType(
|
|
556
|
+
return new FSharpType(8, [new FSharpPrimitive(6, [])]);
|
|
510
557
|
default:
|
|
511
|
-
return new FSharpType(
|
|
558
|
+
return new FSharpType(8, [new FSharpPrimitive(0, [])]);
|
|
512
559
|
}
|
|
513
560
|
}
|
|
514
561
|
case 6: {
|
|
515
562
|
const functionDeclaration = glueType.fields[0];
|
|
516
|
-
return new FSharpType(
|
|
563
|
+
return new FSharpType(16, [new FSharpFunctionType(map((parameter_6) => transformParameter(context, parameter_6), functionDeclaration.Parameters), transformType(context, functionDeclaration.Type))]);
|
|
517
564
|
}
|
|
518
565
|
case 20: {
|
|
519
566
|
const members_1 = glueType.fields[0];
|
|
520
567
|
if (isEmpty(members_1)) {
|
|
521
|
-
return new FSharpType(
|
|
568
|
+
return new FSharpType(18, []);
|
|
522
569
|
}
|
|
523
570
|
else {
|
|
524
|
-
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(
|
|
525
|
-
return new FSharpType(
|
|
571
|
+
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())]));
|
|
572
|
+
return new FSharpType(7, [new FSharpMapped(TransformContext__get_FullName(context), empty())]);
|
|
526
573
|
}
|
|
527
574
|
}
|
|
528
575
|
case 26: {
|
|
529
576
|
const utilityType = glueType.fields[0];
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
577
|
+
let matchResult_1, innerType;
|
|
578
|
+
switch (utilityType.tag) {
|
|
579
|
+
case 1: {
|
|
580
|
+
matchResult_1 = 1;
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
case 2: {
|
|
584
|
+
matchResult_1 = 2;
|
|
585
|
+
innerType = utilityType.fields[0];
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
case 3: {
|
|
589
|
+
matchResult_1 = 2;
|
|
590
|
+
innerType = utilityType.fields[0];
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
default:
|
|
594
|
+
matchResult_1 = 0;
|
|
533
595
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
596
|
+
switch (matchResult_1) {
|
|
597
|
+
case 0: {
|
|
598
|
+
TransformContext__ExposeType_Z1D58A540(context, new FSharpType(5, [(originalInterface = transformInterface(context, utilityType.fields[0]), Interface_makePartial(TransformContext__get_CurrentScopeName(context), originalInterface))]));
|
|
599
|
+
return new FSharpType(11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), new FSharpType(10, []))]);
|
|
600
|
+
}
|
|
601
|
+
case 1: {
|
|
602
|
+
TransformContext__ExposeType_Z1D58A540(context, transformRecord(context, TransformContext__get_CurrentScopeName(context), empty(), utilityType.fields[0]));
|
|
603
|
+
return new FSharpType(7, [new FSharpMapped(TransformContext__get_FullName(context), empty())]);
|
|
604
|
+
}
|
|
605
|
+
default: {
|
|
606
|
+
context_mut = context;
|
|
607
|
+
glueType_mut = innerType;
|
|
608
|
+
continue transformType;
|
|
609
|
+
}
|
|
537
610
|
}
|
|
538
611
|
}
|
|
539
612
|
case 5:
|
|
540
|
-
return new FSharpType(
|
|
613
|
+
return new FSharpType(7, [new FSharpMapped(glueType.fields[0].Name, empty())]);
|
|
614
|
+
case 27:
|
|
541
615
|
case 11:
|
|
542
616
|
case 10:
|
|
543
617
|
case 4: {
|
|
544
618
|
TransformContext__AddError_Z721C83C5(context, toText(interpolate("Could not transform type: %A%P()", [glueType])));
|
|
545
|
-
return new FSharpType(
|
|
619
|
+
return new FSharpType(10, []);
|
|
546
620
|
}
|
|
547
621
|
default:
|
|
548
|
-
return new FSharpType(
|
|
622
|
+
return new FSharpType(18, []);
|
|
549
623
|
}
|
|
550
624
|
break;
|
|
551
625
|
}
|
|
@@ -553,7 +627,7 @@ function transformType(context_mut, glueType_mut) {
|
|
|
553
627
|
|
|
554
628
|
function transformExports(context, isTopLevel, exports) {
|
|
555
629
|
const context_1 = TransformContext__PushScope_Z721C83C5(context, "Exports");
|
|
556
|
-
return new FSharpType(
|
|
630
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(7, []), new FSharpAttribute(6, [])]), "Exports", "Exports", empty(), collect_1((_arg) => {
|
|
557
631
|
let Attributes_1, Parameters_1;
|
|
558
632
|
let matchResult, info, info_1, info_2, moduleDeclaration, glueType, glueType_1;
|
|
559
633
|
switch (_arg.tag) {
|
|
@@ -611,12 +685,12 @@ function transformExports(context, isTopLevel, exports) {
|
|
|
611
685
|
return map((constructorInfo) => {
|
|
612
686
|
let Attributes_2, Parameters_2;
|
|
613
687
|
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(
|
|
688
|
+
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
689
|
}, isEmpty(info_2.Constructors) ? singleton(new GlueConstructor(empty(), empty())) : info_2.Constructors);
|
|
616
690
|
}
|
|
617
691
|
case 3: {
|
|
618
692
|
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(
|
|
693
|
+
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
694
|
}
|
|
621
695
|
case 4: {
|
|
622
696
|
const patternInput_3 = sanitizeNameAndPushScope(GlueType__get_Name(glueType), context_1);
|
|
@@ -631,7 +705,7 @@ function transformExports(context, isTopLevel, exports) {
|
|
|
631
705
|
function transformParameter(context, parameter) {
|
|
632
706
|
let typ;
|
|
633
707
|
const computedType = unwrapOptionIfAlreadyOptional(TransformContext__PushScope_Z721C83C5(context, parameter.Name), parameter.Type, parameter.IsOptional);
|
|
634
|
-
typ = (parameter.IsSpread ? ((computedType.tag ===
|
|
708
|
+
typ = (parameter.IsSpread ? ((computedType.tag === 14) ? computedType.fields[0] : computedType) : computedType);
|
|
635
709
|
return new FSharpParameter(toList(delay(() => (parameter.IsSpread ? singleton_1(new FSharpAttribute(19, [])) : empty_1()))), sanitizeName(parameter.Name), parameter.IsOptional, typ);
|
|
636
710
|
}
|
|
637
711
|
|
|
@@ -682,7 +756,7 @@ function TransformMembers_toFSharpMember(context, members) {
|
|
|
682
756
|
const indexSignature = _arg_3.fields[0];
|
|
683
757
|
const patternInput_5 = sanitizeNameAndPushScope("Item", context);
|
|
684
758
|
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, []))]);
|
|
759
|
+
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
760
|
}
|
|
687
761
|
case 6: {
|
|
688
762
|
const methodSignature = _arg_3.fields[0];
|
|
@@ -864,7 +938,7 @@ export function Interface_makePartial(name, originalInterface) {
|
|
|
864
938
|
return new FSharpInterface(originalInterface.Attributes, name, originalInterface.OriginalName, originalInterface.TypeParameters, map((m) => {
|
|
865
939
|
if (m.tag === 1) {
|
|
866
940
|
const property = m.fields[0];
|
|
867
|
-
if (property.Type.tag ===
|
|
941
|
+
if (property.Type.tag === 3) {
|
|
868
942
|
return m;
|
|
869
943
|
}
|
|
870
944
|
else {
|
|
@@ -976,7 +1050,7 @@ export function TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType) {
|
|
|
976
1050
|
default:
|
|
977
1051
|
return void 0;
|
|
978
1052
|
}
|
|
979
|
-
}, glueType.fields[0].Members) : empty();
|
|
1053
|
+
}, 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
1054
|
if (isEmpty(cases)) {
|
|
981
1055
|
return void 0;
|
|
982
1056
|
}
|
|
@@ -989,7 +1063,7 @@ export function TypeAliasDeclaration_transformKeyOf(context, aliasName, glueType
|
|
|
989
1063
|
const matchValue = TypeAliasDeclaration_tryTransformKeyOf(aliasName, glueType);
|
|
990
1064
|
if (matchValue == null) {
|
|
991
1065
|
TransformContext__AddWarning_Z721C83C5(context, `Could not transform KeyOf: ${aliasName}`);
|
|
992
|
-
return new FSharpType(
|
|
1066
|
+
return new FSharpType(10, []);
|
|
993
1067
|
}
|
|
994
1068
|
else {
|
|
995
1069
|
return matchValue;
|
|
@@ -997,7 +1071,7 @@ export function TypeAliasDeclaration_transformKeyOf(context, aliasName, glueType
|
|
|
997
1071
|
}
|
|
998
1072
|
|
|
999
1073
|
export function TypeAliasDeclaration_transformLiteral(xmlDoc, typeAliasName, literalInfo) {
|
|
1000
|
-
const makeTypeAlias = (primitiveType) => (new FSharpType(
|
|
1074
|
+
const makeTypeAlias = (primitiveType) => (new FSharpType(9, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, new FSharpType(8, [primitiveType]), empty())]));
|
|
1001
1075
|
switch (literalInfo.tag) {
|
|
1002
1076
|
case 1:
|
|
1003
1077
|
return makeTypeAlias(new FSharpPrimitive(1, []));
|
|
@@ -1019,19 +1093,23 @@ function transformRecord(context, name, typeParameters, recordInfo) {
|
|
|
1019
1093
|
let parameters;
|
|
1020
1094
|
const patternInput_1 = sanitizeNameAndPushScope("key", context_1);
|
|
1021
1095
|
parameters = singleton(new FSharpParameter(empty(), patternInput_1[0], false, transformType(patternInput_1[1], recordInfo.KeyType)));
|
|
1022
|
-
return new FSharpType(
|
|
1096
|
+
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
1097
|
}
|
|
1024
1098
|
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1099
|
+
function transformTypeParameter(context, typeParameter) {
|
|
1100
|
+
return FSharpTypeParameter_Create_Z6CFD3565(typeParameter.Name, unwrap(bind((glueType) => {
|
|
1027
1101
|
const matchValue = transformType(context, glueType);
|
|
1028
|
-
if (matchValue.tag ===
|
|
1102
|
+
if (matchValue.tag === 16) {
|
|
1029
1103
|
return void 0;
|
|
1030
1104
|
}
|
|
1031
1105
|
else {
|
|
1032
1106
|
return matchValue;
|
|
1033
1107
|
}
|
|
1034
|
-
}, typeParameter.Constraint)), unwrap(map_1((glueType_1) => transformType(context, glueType_1), typeParameter.Default)))
|
|
1108
|
+
}, typeParameter.Constraint)), unwrap(map_1((glueType_1) => transformType(context, glueType_1), typeParameter.Default)));
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
function transformTypeParameters(context, typeParameters) {
|
|
1112
|
+
return map((typeParameter) => transformTypeParameter(context, typeParameter), typeParameters);
|
|
1035
1113
|
}
|
|
1036
1114
|
|
|
1037
1115
|
function tryOptimizeUnionType(context, typeName, cases) {
|
|
@@ -1165,94 +1243,163 @@ function tryOptimizeUnionType(context, typeName, cases) {
|
|
|
1165
1243
|
return empty();
|
|
1166
1244
|
}
|
|
1167
1245
|
}, cases);
|
|
1168
|
-
return new FSharpType(
|
|
1246
|
+
return new FSharpType(5, [new FSharpInterface(ofArray([new FSharpAttribute(8, []), new FSharpAttribute(20, [])]), typeName, TransformContext__get_CurrentScopeName(context), empty(), members, empty())]);
|
|
1169
1247
|
}
|
|
1170
1248
|
else {
|
|
1171
1249
|
return void 0;
|
|
1172
1250
|
}
|
|
1173
1251
|
}
|
|
1174
1252
|
|
|
1253
|
+
function transformMappedTypeMembers(context, mappedType) {
|
|
1254
|
+
const matchValue = mappedType.TypeParameter.Constraint;
|
|
1255
|
+
let matchResult, idxTyp, invalid_2;
|
|
1256
|
+
if (matchValue != null) {
|
|
1257
|
+
if (matchValue.tag === 10) {
|
|
1258
|
+
matchResult = 0;
|
|
1259
|
+
idxTyp = matchValue.fields[0];
|
|
1260
|
+
}
|
|
1261
|
+
else {
|
|
1262
|
+
matchResult = 1;
|
|
1263
|
+
invalid_2 = matchValue;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
matchResult = 1;
|
|
1268
|
+
invalid_2 = matchValue;
|
|
1269
|
+
}
|
|
1270
|
+
switch (matchResult) {
|
|
1271
|
+
case 0: {
|
|
1272
|
+
const matchValue_1 = idxTyp.ObjectType;
|
|
1273
|
+
let matchResult_1, glueTypes, invalid_1;
|
|
1274
|
+
switch (matchValue_1.tag) {
|
|
1275
|
+
case 29: {
|
|
1276
|
+
if (matchValue_1.fields[0].tag === 18) {
|
|
1277
|
+
matchResult_1 = 0;
|
|
1278
|
+
glueTypes = matchValue_1.fields[0].fields[0];
|
|
1279
|
+
}
|
|
1280
|
+
else {
|
|
1281
|
+
matchResult_1 = 1;
|
|
1282
|
+
invalid_1 = matchValue_1;
|
|
1283
|
+
}
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
case 18: {
|
|
1287
|
+
matchResult_1 = 0;
|
|
1288
|
+
glueTypes = matchValue_1.fields[0];
|
|
1289
|
+
break;
|
|
1290
|
+
}
|
|
1291
|
+
default: {
|
|
1292
|
+
matchResult_1 = 1;
|
|
1293
|
+
invalid_1 = matchValue_1;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
switch (matchResult_1) {
|
|
1297
|
+
case 0:
|
|
1298
|
+
return choose((_arg) => {
|
|
1299
|
+
if (_arg.tag === 8) {
|
|
1300
|
+
return new GlueMember(1, [new GlueProperty(GlueLiteral__ToText(_arg.fields[0]), empty(), defaultArg(mappedType.Type, new GlueType(23, [])), false, false, new GlueAccessor(2, []), false)]);
|
|
1301
|
+
}
|
|
1302
|
+
else {
|
|
1303
|
+
TransformContext__AddError_Z721C83C5(context, toText(interpolate("MappedType: Unexpected type for member %A%P()", [_arg])));
|
|
1304
|
+
return void 0;
|
|
1305
|
+
}
|
|
1306
|
+
}, glueTypes);
|
|
1307
|
+
default: {
|
|
1308
|
+
TransformContext__AddError_Z721C83C5(context, toText(interpolate("MappedType: Unexpected type for members %A%P()", [invalid_1])));
|
|
1309
|
+
return empty();
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
default: {
|
|
1314
|
+
TransformContext__AddError_Z721C83C5(context, toText(interpolate("MappedType: Unexpected type for members %A%P()", [invalid_2])));
|
|
1315
|
+
return empty();
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
function transformReadOnly(context, glueType) {
|
|
1321
|
+
if (glueType.tag === 14) {
|
|
1322
|
+
TransformContext__ExposeReadonlyArray(context);
|
|
1323
|
+
return new FSharpType(19, [new FSharpJSApi(transformType(context, glueType.fields[0]))]);
|
|
1324
|
+
}
|
|
1325
|
+
else {
|
|
1326
|
+
return transformType(context, glueType);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1175
1330
|
function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
1331
|
+
let matchValue_2, glueType_2;
|
|
1176
1332
|
const patternInput = sanitizeNameAndPushScope(glueTypeAliasDeclaration.Name, context);
|
|
1177
1333
|
const typeAliasName = patternInput[0];
|
|
1178
1334
|
const context_1 = patternInput[1];
|
|
1179
1335
|
const xmlDoc = transformComment(glueTypeAliasDeclaration.Documentation);
|
|
1336
|
+
const makeTypeAlias = (typ) => (new FSharpType(9, [new FSharpTypeAlias(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, typ, transformTypeParameters(context_1, glueTypeAliasDeclaration.TypeParameters))]));
|
|
1180
1337
|
const matchValue = glueTypeAliasDeclaration.Type;
|
|
1181
1338
|
switch (matchValue.tag) {
|
|
1182
1339
|
case 9:
|
|
1183
1340
|
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;
|
|
1341
|
+
case 10:
|
|
1342
|
+
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) => {
|
|
1343
|
+
let typ_2;
|
|
1344
|
+
switch (m.tag) {
|
|
1345
|
+
case 1: {
|
|
1346
|
+
typ_2 = m.fields[0].Type;
|
|
1347
|
+
break;
|
|
1222
1348
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1349
|
+
case 2: {
|
|
1350
|
+
typ_2 = m.fields[0].Type;
|
|
1351
|
+
break;
|
|
1225
1352
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1353
|
+
case 3: {
|
|
1354
|
+
typ_2 = m.fields[0].ArgumentType;
|
|
1355
|
+
break;
|
|
1228
1356
|
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1357
|
+
case 4: {
|
|
1358
|
+
typ_2 = m.fields[0].Type;
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
case 7: {
|
|
1362
|
+
typ_2 = m.fields[0].Type;
|
|
1363
|
+
break;
|
|
1364
|
+
}
|
|
1365
|
+
case 6: {
|
|
1366
|
+
typ_2 = m.fields[0].Type;
|
|
1367
|
+
break;
|
|
1368
|
+
}
|
|
1369
|
+
case 5: {
|
|
1370
|
+
typ_2 = m.fields[0].Type;
|
|
1371
|
+
break;
|
|
1372
|
+
}
|
|
1373
|
+
default:
|
|
1374
|
+
typ_2 = m.fields[0].Type;
|
|
1375
|
+
}
|
|
1376
|
+
if (typ_2.tag === 7) {
|
|
1377
|
+
return typ_2.fields[0].fields[0];
|
|
1378
|
+
}
|
|
1379
|
+
else {
|
|
1380
|
+
return singleton(typ_2);
|
|
1381
|
+
}
|
|
1382
|
+
}, glueType_2.fields[0].Members), {
|
|
1383
|
+
Equals: equals,
|
|
1384
|
+
GetHashCode: safeHash,
|
|
1385
|
+
}))])) : (new FSharpType(10, [])))) : (new FSharpType(10, []))));
|
|
1239
1386
|
case 8:
|
|
1240
1387
|
return TypeAliasDeclaration_transformLiteral(xmlDoc, typeAliasName, matchValue.fields[0]);
|
|
1241
1388
|
case 3:
|
|
1242
|
-
return new FSharpType(8, [
|
|
1389
|
+
return makeTypeAlias(new FSharpType(8, [transformPrimitive(matchValue.fields[0])]));
|
|
1243
1390
|
case 25:
|
|
1244
|
-
return new FSharpType(8, [new
|
|
1391
|
+
return makeTypeAlias(new FSharpType(8, [new FSharpPrimitive(0, [])]));
|
|
1245
1392
|
case 13: {
|
|
1246
1393
|
const typeReference = matchValue.fields[0];
|
|
1247
1394
|
const mappedName = mapTypeNameToFableCoreAwareName(context_1, typeReference);
|
|
1248
1395
|
const context_2 = TransformContext__PushScope_Z721C83C5(context_1, mappedName);
|
|
1249
|
-
const handleDefaultCase = () => (
|
|
1250
|
-
const
|
|
1396
|
+
const handleDefaultCase = () => makeTypeAlias(transformType(context_2, new GlueType(13, [typeReference])));
|
|
1397
|
+
const matchValue_3 = typeReference.TypeArguments;
|
|
1251
1398
|
let matchResult_1, head;
|
|
1252
|
-
if (!isEmpty(
|
|
1253
|
-
if (isEmpty(tail(
|
|
1399
|
+
if (!isEmpty(matchValue_3)) {
|
|
1400
|
+
if (isEmpty(tail(matchValue_3))) {
|
|
1254
1401
|
matchResult_1 = 0;
|
|
1255
|
-
head = head_1(
|
|
1402
|
+
head = head_1(matchValue_3);
|
|
1256
1403
|
}
|
|
1257
1404
|
else {
|
|
1258
1405
|
matchResult_1 = 1;
|
|
@@ -1267,8 +1414,8 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1267
1414
|
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
1415
|
const exposedType = makeInterfaceTyp("ReturnType");
|
|
1269
1416
|
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(
|
|
1417
|
+
TransformContext__ExposeType_Z1D58A540(TransformContext__PushScope_Z721C83C5(context_2, typeReference.Name), new FSharpType(5, [exposedType]));
|
|
1418
|
+
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
1419
|
}
|
|
1273
1420
|
else {
|
|
1274
1421
|
return handleDefaultCase();
|
|
@@ -1278,30 +1425,53 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1278
1425
|
}
|
|
1279
1426
|
}
|
|
1280
1427
|
case 14:
|
|
1281
|
-
return
|
|
1428
|
+
return makeTypeAlias(transformType(context_1, new GlueType(14, [matchValue.fields[0]])));
|
|
1282
1429
|
case 26: {
|
|
1283
1430
|
const utilityType = matchValue.fields[0];
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1431
|
+
switch (utilityType.tag) {
|
|
1432
|
+
case 1:
|
|
1433
|
+
return transformRecord(context_1, typeAliasName, glueTypeAliasDeclaration.TypeParameters, utilityType.fields[0]);
|
|
1434
|
+
case 2:
|
|
1435
|
+
return makeTypeAlias(transformType(TransformContext__PushScope_Z721C83C5(context_1, "ReturnType"), utilityType.fields[0]));
|
|
1436
|
+
case 3:
|
|
1437
|
+
return makeTypeAlias(transformType(context_1, utilityType.fields[0]));
|
|
1438
|
+
default:
|
|
1439
|
+
return new FSharpType(5, [Interface_makePartial(typeAliasName, transformInterface(context_1, utilityType.fields[0]))]);
|
|
1289
1440
|
}
|
|
1290
1441
|
}
|
|
1291
1442
|
case 15: {
|
|
1292
1443
|
const functionType = matchValue.fields[0];
|
|
1293
|
-
return new FSharpType(
|
|
1444
|
+
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
1445
|
}
|
|
1295
1446
|
case 18:
|
|
1296
|
-
return
|
|
1447
|
+
return makeTypeAlias(transformTupleType(context_1, matchValue.fields[0]));
|
|
1297
1448
|
case 20:
|
|
1298
|
-
return new FSharpType(
|
|
1449
|
+
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())]);
|
|
1299
1450
|
case 21:
|
|
1300
|
-
return new FSharpType(
|
|
1451
|
+
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].Members), empty())]);
|
|
1301
1452
|
case 23:
|
|
1302
|
-
return
|
|
1453
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1303
1454
|
case 16:
|
|
1304
|
-
return
|
|
1455
|
+
return makeTypeAlias(new FSharpType(13, [matchValue.fields[0]]));
|
|
1456
|
+
case 27:
|
|
1457
|
+
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())]);
|
|
1458
|
+
case 28: {
|
|
1459
|
+
const matchValue_4 = glueTypeAliasDeclaration.TypeParameters;
|
|
1460
|
+
if (!isEmpty(matchValue_4)) {
|
|
1461
|
+
if (isEmpty(tail(matchValue_4))) {
|
|
1462
|
+
return new FSharpType(2, [new FSharpSingleErasedCaseUnion(toList(delay(() => xmlDoc.ObsoleteAttributes)), typeAliasName, xmlDoc.XmlDoc, transformTypeParameter(context_1, head_1(matchValue_4)))]);
|
|
1463
|
+
}
|
|
1464
|
+
else {
|
|
1465
|
+
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`);
|
|
1466
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
else {
|
|
1470
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
case 29:
|
|
1474
|
+
return makeTypeAlias(transformReadOnly(context_1, matchValue.fields[0]));
|
|
1305
1475
|
case 12:
|
|
1306
1476
|
case 4:
|
|
1307
1477
|
case 1:
|
|
@@ -1314,11 +1484,11 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1314
1484
|
case 24:
|
|
1315
1485
|
case 19:
|
|
1316
1486
|
case 22:
|
|
1317
|
-
return new FSharpType(
|
|
1487
|
+
return makeTypeAlias(new FSharpType(18, []));
|
|
1318
1488
|
default: {
|
|
1319
1489
|
const matchValue_1 = tryOptimizeUnionType(context_1, typeAliasName, matchValue.fields[0].fields[0]);
|
|
1320
1490
|
if (matchValue_1 == null) {
|
|
1321
|
-
return
|
|
1491
|
+
return makeTypeAlias(transformType(context_1, matchValue));
|
|
1322
1492
|
}
|
|
1323
1493
|
else {
|
|
1324
1494
|
return matchValue_1;
|
|
@@ -1328,14 +1498,14 @@ function transformTypeAliasDeclaration(context, glueTypeAliasDeclaration) {
|
|
|
1328
1498
|
}
|
|
1329
1499
|
|
|
1330
1500
|
function transformModuleDeclaration(typeMemory, reporter, moduleDeclaration) {
|
|
1331
|
-
return new FSharpType(
|
|
1501
|
+
return new FSharpType(4, [new FSharpModule(sanitizeName(moduleDeclaration.Name), moduleDeclaration.IsRecursive, transform(typeMemory, reporter, false, moduleDeclaration.Types))]);
|
|
1332
1502
|
}
|
|
1333
1503
|
|
|
1334
1504
|
function transformClassDeclaration(context, classDeclaration) {
|
|
1335
1505
|
let Members;
|
|
1336
1506
|
const patternInput = sanitizeNameAndPushScope(classDeclaration.Name, context);
|
|
1337
1507
|
const context_1 = patternInput[1];
|
|
1338
|
-
return new FSharpType(
|
|
1508
|
+
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((glueType) => transformType(context_1, glueType), classDeclaration.HeritageClauses)))]);
|
|
1339
1509
|
}
|
|
1340
1510
|
|
|
1341
1511
|
function transformToFsharp(context, glueTypes) {
|
|
@@ -1355,9 +1525,11 @@ function transformToFsharp(context, glueTypes) {
|
|
|
1355
1525
|
return transformClassDeclaration(context, exportedType.fields[0]);
|
|
1356
1526
|
}
|
|
1357
1527
|
else {
|
|
1358
|
-
return new FSharpType(
|
|
1528
|
+
return new FSharpType(10, []);
|
|
1359
1529
|
}
|
|
1360
1530
|
}
|
|
1531
|
+
case 28:
|
|
1532
|
+
case 27:
|
|
1361
1533
|
case 15:
|
|
1362
1534
|
case 16:
|
|
1363
1535
|
case 14:
|
|
@@ -1378,10 +1550,11 @@ function transformToFsharp(context, glueTypes) {
|
|
|
1378
1550
|
case 19:
|
|
1379
1551
|
case 25:
|
|
1380
1552
|
case 26:
|
|
1553
|
+
case 29:
|
|
1381
1554
|
case 17:
|
|
1382
|
-
return new FSharpType(
|
|
1555
|
+
return new FSharpType(10, []);
|
|
1383
1556
|
default:
|
|
1384
|
-
return new FSharpType(
|
|
1557
|
+
return new FSharpType(5, [transformInterface(context, _arg.fields[0])]);
|
|
1385
1558
|
}
|
|
1386
1559
|
}, glueTypes);
|
|
1387
1560
|
}
|
|
@@ -1436,7 +1609,7 @@ function transform(typeMemory, reporter, isTopLevel, glueAst) {
|
|
|
1436
1609
|
|
|
1437
1610
|
export function apply(typeMemory, glueAst) {
|
|
1438
1611
|
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));
|
|
1612
|
+
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));
|
|
1440
1613
|
}
|
|
1441
1614
|
|
|
1442
1615
|
//# sourceMappingURL=Transform.js.map
|