@glutinum/cli 0.14.1 → 1.0.0-beta.10
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 +16 -0
- package/dist/Glutinum.Converter/Abbreviations.js +9 -32
- package/dist/Glutinum.Converter/DelegateExtensions.js +378 -0
- package/dist/Glutinum.Converter/FreeTypeParameters.js +211 -0
- package/dist/Glutinum.Converter/FsharpAST.js +154 -69
- package/dist/Glutinum.Converter/Generate.js +44 -23
- package/dist/Glutinum.Converter/GlueAST.js +122 -74
- package/dist/Glutinum.Converter/Hosting.js +892 -0
- package/dist/Glutinum.Converter/Merge.js +469 -301
- package/dist/Glutinum.Converter/Packages.js +403 -77
- package/dist/Glutinum.Converter/Printer.js +455 -388
- package/dist/Glutinum.Converter/Read.js +366 -104
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +9 -9
- package/dist/Glutinum.Converter/Reader/ConditionalTypeNode.js +90 -0
- package/dist/Glutinum.Converter/Reader/Declaration.js +24 -30
- package/dist/Glutinum.Converter/Reader/Deferred.js +706 -0
- package/dist/Glutinum.Converter/Reader/Documentation.js +56 -67
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +105 -38
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +52 -55
- package/dist/Glutinum.Converter/Reader/ExpressionWithTypeArguments.js +59 -0
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +28 -16
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +46 -45
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +48 -5
- package/dist/Glutinum.Converter/Reader/IntersectionTypeNode.js +178 -0
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +82 -4
- package/dist/Glutinum.Converter/Reader/MemberTypes.js +126 -0
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +55 -7
- package/dist/Glutinum.Converter/Reader/Node.js +23 -26
- package/dist/Glutinum.Converter/Reader/Parameters.js +39 -30
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +5 -5
- package/dist/Glutinum.Converter/Reader/TypeNode.js +410 -1545
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +78 -51
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +116 -71
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +25 -7
- package/dist/Glutinum.Converter/Reader/Types.js +296 -16
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +21 -34
- package/dist/Glutinum.Converter/Reader/UtilityType.js +811 -0
- package/dist/Glutinum.Converter/Reader/Utils.js +584 -148
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +2 -3
- package/dist/Glutinum.Converter/Transform.js +2971 -6875
- package/dist/Glutinum.Converter/Transformer/AnyFunctionOverloads.js +116 -0
- package/dist/Glutinum.Converter/Transformer/CallableProperties.js +454 -0
- package/dist/Glutinum.Converter/Transformer/Comment.js +136 -0
- package/dist/Glutinum.Converter/Transformer/Conditionals.js +1087 -0
- package/dist/Glutinum.Converter/Transformer/Context.js +678 -0
- package/dist/Glutinum.Converter/Transformer/Enum.js +80 -0
- package/dist/Glutinum.Converter/Transformer/Exports.js +704 -0
- package/dist/Glutinum.Converter/Transformer/Heritage.js +493 -0
- package/dist/Glutinum.Converter/Transformer/KeyOfMaps.js +488 -0
- package/dist/Glutinum.Converter/Transformer/ParamObjectCandidate.js +460 -0
- package/dist/Glutinum.Converter/Transformer/TypeParameter.js +219 -0
- package/dist/Glutinum.Converter/Transformer/TypeParameters.js +448 -0
- package/dist/Glutinum.Converter/Transformer/UnionOverloads.js +356 -0
- package/dist/Glutinum.Converter/Transformer/Utils.js +341 -0
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +193 -211
- package/dist/Glutinum.Converter/Utils/Naming.js +7 -0
- package/dist/Glutinum.Converter/Utils/String.js +15 -4
- package/dist/Program.js +107 -232
- package/package.json +4 -3
- package/dist/Glutinum.Converter/TypeScript.js +0 -12
- package/src/Glutinum.Converter/js/bootstrap.js +0 -123
- package/src/Glutinum.Converter/js/host.js +0 -144
- package/src/Glutinum.Converter/js/npm.js +0 -137
- package/src/Glutinum.Converter/js/resolve.js +0 -402
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
|
|
2
|
+
import { empty, union, FSharpSet__Contains, ofList } from "../fable_modules/fable-library-js.5.17.2/Set.js";
|
|
3
|
+
import { isEmpty, map, choose } from "../fable_modules/fable-library-js.5.17.2/List.js";
|
|
4
|
+
import { comparePrimitives } from "../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
5
|
+
import { FSharpModule, FSharpTypeAlias, FSharpDelegate, FSharpInterface, FSharpStaticMemberInfo, FSharpMember, FSharpMemberInfo, FSharpFunctionType, FSharpParameter, FSharpUnion, FSharpUnionCase, FSharpJSApi, FSharpThisType, FSharpTypeReference, FSharpMapped, FSharpTypeParameter, FSharpType } from "./FsharpAST.js";
|
|
6
|
+
import { substring } from "../fable_modules/fable-library-js.5.17.2/String.js";
|
|
7
|
+
|
|
8
|
+
function declaredNames(typeParameters) {
|
|
9
|
+
return ofList(choose((_arg) => {
|
|
10
|
+
if (_arg.tag === 0) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return _arg.fields[0].Name;
|
|
15
|
+
}
|
|
16
|
+
}, typeParameters), {
|
|
17
|
+
Compare: (x, y) => (comparePrimitives(x, y) | 0),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function eraseType(bound, typ) {
|
|
22
|
+
let info_1;
|
|
23
|
+
const erase = (typ_1) => eraseType(bound, typ_1);
|
|
24
|
+
const eraseTypeParameters = (typeParameters) => map((_arg) => {
|
|
25
|
+
if (_arg.tag === 1) {
|
|
26
|
+
if (FSharpSet__Contains(bound, _arg.fields[0].Name)) {
|
|
27
|
+
return _arg;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return new FSharpTypeParameter(/* FSharpType */ 0, [FSharpType.Object$]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return new FSharpTypeParameter(/* FSharpType */ 0, [erase(_arg.fields[0])]);
|
|
35
|
+
}
|
|
36
|
+
}, typeParameters);
|
|
37
|
+
let matchResult, name_1, info_2, info_3, typeReference, thisType, typ_3, typ_4, typ_5, types, unionInfo, functionType, typ_10;
|
|
38
|
+
switch (typ.tag) {
|
|
39
|
+
case 13: {
|
|
40
|
+
if (!FSharpSet__Contains(bound, typ.fields[0])) {
|
|
41
|
+
matchResult = 0;
|
|
42
|
+
name_1 = typ.fields[0];
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
matchResult = 11;
|
|
46
|
+
typ_10 = typ;
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case 7: {
|
|
51
|
+
if ((info_1 = typ.fields[0], info_1.Name.startsWith("\'") && !FSharpSet__Contains(bound, substring(info_1.Name, 1)))) {
|
|
52
|
+
matchResult = 1;
|
|
53
|
+
info_2 = typ.fields[0];
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
matchResult = 2;
|
|
57
|
+
info_3 = typ.fields[0];
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case 11: {
|
|
62
|
+
matchResult = 3;
|
|
63
|
+
typeReference = typ.fields[0];
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 15: {
|
|
67
|
+
matchResult = 4;
|
|
68
|
+
thisType = typ.fields[0];
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case 3: {
|
|
72
|
+
matchResult = 5;
|
|
73
|
+
typ_3 = typ.fields[0];
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case 14: {
|
|
77
|
+
matchResult = 6;
|
|
78
|
+
typ_4 = typ.fields[0];
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case 19: {
|
|
82
|
+
matchResult = 7;
|
|
83
|
+
typ_5 = typ.fields[0].fields[0];
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case 12: {
|
|
87
|
+
matchResult = 8;
|
|
88
|
+
types = typ.fields[0];
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case 1: {
|
|
92
|
+
matchResult = 9;
|
|
93
|
+
unionInfo = typ.fields[0];
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case 16: {
|
|
97
|
+
matchResult = 10;
|
|
98
|
+
functionType = typ.fields[0];
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
default: {
|
|
102
|
+
matchResult = 11;
|
|
103
|
+
typ_10 = typ;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
switch (matchResult) {
|
|
107
|
+
case 0:
|
|
108
|
+
return FSharpType.Object$;
|
|
109
|
+
case 1:
|
|
110
|
+
return FSharpType.Object$;
|
|
111
|
+
case 2:
|
|
112
|
+
return new FSharpType(/* Mapped */ 7, [new FSharpMapped(info_3.Name, eraseTypeParameters(info_3.TypeParameters))]);
|
|
113
|
+
case 3:
|
|
114
|
+
return new FSharpType(/* TypeReference */ 11, [new FSharpTypeReference(typeReference.Name, typeReference.FullName, typeReference.ModulePath, map(erase, typeReference.TypeArguments), typeReference.Type)]);
|
|
115
|
+
case 4:
|
|
116
|
+
return new FSharpType(/* ThisType */ 15, [new FSharpThisType(thisType.Name, eraseTypeParameters(thisType.TypeParameters))]);
|
|
117
|
+
case 5:
|
|
118
|
+
return new FSharpType(/* Option */ 3, [erase(typ_3)]);
|
|
119
|
+
case 6:
|
|
120
|
+
return new FSharpType(/* ResizeArray */ 14, [erase(typ_4)]);
|
|
121
|
+
case 7:
|
|
122
|
+
return new FSharpType(/* JSApi */ 19, [new FSharpJSApi(erase(typ_5))]);
|
|
123
|
+
case 8:
|
|
124
|
+
return new FSharpType(/* Tuple */ 12, [map(erase, types)]);
|
|
125
|
+
case 9: {
|
|
126
|
+
const bound_1 = union(bound, declaredNames(unionInfo.TypeParameters));
|
|
127
|
+
const erase_1 = (typ_6) => eraseType(bound_1, typ_6);
|
|
128
|
+
return new FSharpType(/* Union */ 1, [new FSharpUnion(unionInfo.Attributes, unionInfo.Name, map((_arg_1) => {
|
|
129
|
+
switch (_arg_1.tag) {
|
|
130
|
+
case 1:
|
|
131
|
+
return new FSharpUnionCase(/* Typed */ 1, [erase_1(_arg_1.fields[0])]);
|
|
132
|
+
case 2:
|
|
133
|
+
return new FSharpUnionCase(/* Field */ 2, [_arg_1.fields[0], erase_1(_arg_1.fields[1])]);
|
|
134
|
+
case 3:
|
|
135
|
+
return new FSharpUnionCase(/* NamedFields */ 3, [_arg_1.fields[0], map((tupledArg) => [tupledArg[0], erase_1(tupledArg[1])], _arg_1.fields[1])]);
|
|
136
|
+
default:
|
|
137
|
+
return _arg_1;
|
|
138
|
+
}
|
|
139
|
+
}, unionInfo.Cases), unionInfo.IsOptional, unionInfo.TypeParameters, unionInfo.Constants)]);
|
|
140
|
+
}
|
|
141
|
+
case 10:
|
|
142
|
+
return new FSharpType(/* Function */ 16, [new FSharpFunctionType(map((parameter) => (new FSharpParameter(parameter.Attributes, parameter.Name, parameter.IsOptional, erase(parameter.Type), parameter.OriginalGlueMember)), functionType.Parameters), erase(functionType.ReturnType))]);
|
|
143
|
+
default:
|
|
144
|
+
return typ_10;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function eraseParameters(bound, parameters) {
|
|
149
|
+
return map((parameter) => (new FSharpParameter(parameter.Attributes, parameter.Name, parameter.IsOptional, eraseType(bound, parameter.Type), parameter.OriginalGlueMember)), parameters);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function eraseMember(bound, fsharpMember) {
|
|
153
|
+
const erase = (isProperty, typeParameters, parameters, typ) => {
|
|
154
|
+
if (isEmpty(typeParameters) && !isProperty) {
|
|
155
|
+
return [parameters, typ];
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
const bound_1 = union(bound, declaredNames(typeParameters));
|
|
159
|
+
return [eraseParameters(bound_1, parameters), eraseType(bound_1, typ)];
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
switch (fsharpMember.tag) {
|
|
163
|
+
case 1: {
|
|
164
|
+
const info_1 = fsharpMember.fields[0];
|
|
165
|
+
const patternInput_1 = erase(true, info_1.TypeParameters, info_1.Parameters, info_1.Type);
|
|
166
|
+
return new FSharpMember(/* Property */ 1, [new FSharpMemberInfo(info_1.Attributes, info_1.Name, info_1.OriginalName, info_1.TypeParameters, patternInput_1[0], patternInput_1[1], info_1.IsOptional, info_1.IsStatic, info_1.Accessor, info_1.Accessibility, info_1.XmlDoc, info_1.Body)]);
|
|
167
|
+
}
|
|
168
|
+
case 2: {
|
|
169
|
+
const info_2 = fsharpMember.fields[0];
|
|
170
|
+
const patternInput_2 = erase(info_2.Accessor != null, info_2.TypeParameters, info_2.Parameters, info_2.Type);
|
|
171
|
+
return new FSharpMember(/* StaticMember */ 2, [new FSharpStaticMemberInfo(info_2.Attributes, info_2.Name, info_2.OriginalName, info_2.TypeParameters, patternInput_2[0], patternInput_2[1], info_2.IsOptional, info_2.Accessor, info_2.Accessibility, info_2.XmlDoc)]);
|
|
172
|
+
}
|
|
173
|
+
default: {
|
|
174
|
+
const info = fsharpMember.fields[0];
|
|
175
|
+
const patternInput = erase(info.Accessor != null, info.TypeParameters, info.Parameters, info.Type);
|
|
176
|
+
return new FSharpMember(/* Method */ 0, [new FSharpMemberInfo(info.Attributes, info.Name, info.OriginalName, info.TypeParameters, patternInput[0], patternInput[1], info.IsOptional, info.IsStatic, info.Accessor, info.Accessibility, info.XmlDoc, info.Body)]);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function apply(types) {
|
|
182
|
+
return map((_arg) => {
|
|
183
|
+
switch (_arg.tag) {
|
|
184
|
+
case 5: {
|
|
185
|
+
const interfaceInfo = _arg.fields[0];
|
|
186
|
+
const bound = declaredNames(interfaceInfo.TypeParameters);
|
|
187
|
+
return new FSharpType(/* Interface */ 5, [new FSharpInterface(interfaceInfo.Attributes, interfaceInfo.Name, interfaceInfo.XmlDoc, interfaceInfo.OriginalName, interfaceInfo.TypeParameters, map((fsharpMember) => eraseMember(bound, fsharpMember), interfaceInfo.Members), interfaceInfo.Inheritance)]);
|
|
188
|
+
}
|
|
189
|
+
case 20: {
|
|
190
|
+
const delegateInfo = _arg.fields[0];
|
|
191
|
+
const bound_1 = declaredNames(delegateInfo.TypeParameters);
|
|
192
|
+
return new FSharpType(/* Delegate */ 20, [new FSharpDelegate(delegateInfo.XmlDoc, delegateInfo.Name, delegateInfo.TypeParameters, eraseParameters(bound_1, delegateInfo.Parameters), eraseType(bound_1, delegateInfo.ReturnType))]);
|
|
193
|
+
}
|
|
194
|
+
case 1:
|
|
195
|
+
return eraseType(empty({
|
|
196
|
+
Compare: (x, y) => (comparePrimitives(x, y) | 0),
|
|
197
|
+
}), _arg);
|
|
198
|
+
case 9: {
|
|
199
|
+
const aliasInfo = _arg.fields[0];
|
|
200
|
+
return new FSharpType(/* TypeAlias */ 9, [new FSharpTypeAlias(aliasInfo.Attributes, aliasInfo.Name, aliasInfo.XmlDoc, eraseType(declaredNames(aliasInfo.TypeParameters), aliasInfo.Type), aliasInfo.TypeParameters)]);
|
|
201
|
+
}
|
|
202
|
+
case 4: {
|
|
203
|
+
const moduleInfo = _arg.fields[0];
|
|
204
|
+
return new FSharpType(/* Module */ 4, [new FSharpModule(moduleInfo.Name, moduleInfo.IsRecursive, moduleInfo.ImportSpecifier, apply(moduleInfo.Types))]);
|
|
205
|
+
}
|
|
206
|
+
default:
|
|
207
|
+
return _arg;
|
|
208
|
+
}
|
|
209
|
+
}, types);
|
|
210
|
+
}
|
|
211
|
+
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Union, Record } from "../fable_modules/fable-library-js.5.17.2/Types.js";
|
|
3
3
|
import { enum_type, option_type, tuple_type, bool_type, float64_type, int32_type, union_type, list_type, record_type, string_type } from "../fable_modules/fable-library-js.5.17.2/Reflection.js";
|
|
4
4
|
import { GlueMember_$reflection } from "./GlueAST.js";
|
|
5
|
-
import {
|
|
6
|
-
import { empty, forAll } from "../fable_modules/fable-library-js.5.17.2/List.js";
|
|
5
|
+
import { empty, cons, choose, singleton, map, forAll } from "../fable_modules/fable-library-js.5.17.2/List.js";
|
|
7
6
|
|
|
8
7
|
export class FSharpCommentParam extends Record {
|
|
9
8
|
constructor(Name, Content) {
|
|
@@ -129,24 +128,6 @@ export function FSharpUnionCase_$reflection() {
|
|
|
129
128
|
return union_type("Glutinum.Converter.FSharpAST.FSharpUnionCase", [], FSharpUnionCase, () => [[["Item", FSharpUnionCaseNamed_$reflection()]], [["Item", FSharpType_$reflection()]], [["name", string_type], ["typ", FSharpType_$reflection()]], [["info", FSharpUnionCaseNamed_$reflection()], ["fields", list_type(tuple_type(string_type, FSharpType_$reflection()))]]]);
|
|
130
129
|
}
|
|
131
130
|
|
|
132
|
-
export class FSharpUnionType extends Union {
|
|
133
|
-
constructor(tag, fields) {
|
|
134
|
-
super();
|
|
135
|
-
this.tag = tag;
|
|
136
|
-
this.fields = fields;
|
|
137
|
-
}
|
|
138
|
-
cases() {
|
|
139
|
-
return ["String", "Numeric", "Unknown"];
|
|
140
|
-
}
|
|
141
|
-
static String$ = new FSharpUnionType(0, []);
|
|
142
|
-
static Numeric = new FSharpUnionType(1, []);
|
|
143
|
-
static Unknown = new FSharpUnionType(2, []);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export function FSharpUnionType_$reflection() {
|
|
147
|
-
return union_type("Glutinum.Converter.FSharpAST.FSharpUnionType", [], FSharpUnionType, () => [[], [], []]);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
131
|
/**
|
|
151
132
|
* `static member inline A: Mixed = Mixed.String "a"`
|
|
152
133
|
*/
|
|
@@ -236,7 +217,7 @@ export class FSharpAttribute extends Union {
|
|
|
236
217
|
this.fields = fields;
|
|
237
218
|
}
|
|
238
219
|
cases() {
|
|
239
|
-
return ["Text", "EmitSelfInvoke", "EmitSelf", "Import", "ImportAll", "ImportDefault", "Erase", "EraseWithCaseRules", "TypeScriptTaggedUnion", "AbstractClass", "AllowNullLiteral", "Obsolete", "StringEnum", "CompiledName", "CompiledValue", "RequireQualifiedAccess", "EmitConstructor", "EmitMacroConstructor", "EmitMacroInvoke", "EmitMacroProperty", "EmitIndexer", "Global", "ParamObject", "ParamArray", "Interface"];
|
|
220
|
+
return ["Text", "EmitSelfInvoke", "EmitSelf", "Import", "ImportAll", "ImportDefault", "Erase", "EraseWithCaseRules", "TypeScriptTaggedUnion", "AbstractClass", "AllowNullLiteral", "Obsolete", "StringEnum", "CompiledName", "CompiledValue", "RequireQualifiedAccess", "EmitConstructor", "EmitMacroConstructor", "EmitMacroInvoke", "EmitMacroProperty", "EmitIndexer", "Global", "ParamObject", "ParamArray", "Interface", "AutoOpen"];
|
|
240
221
|
}
|
|
241
222
|
static EmitSelfInvoke = new FSharpAttribute(1, []);
|
|
242
223
|
static EmitSelf = new FSharpAttribute(2, []);
|
|
@@ -249,10 +230,11 @@ export class FSharpAttribute extends Union {
|
|
|
249
230
|
static ParamObject = new FSharpAttribute(22, []);
|
|
250
231
|
static ParamArray = new FSharpAttribute(23, []);
|
|
251
232
|
static Interface = new FSharpAttribute(24, []);
|
|
233
|
+
static AutoOpen = new FSharpAttribute(25, []);
|
|
252
234
|
}
|
|
253
235
|
|
|
254
236
|
export function FSharpAttribute_$reflection() {
|
|
255
|
-
return union_type("Glutinum.Converter.FSharpAST.FSharpAttribute", [], FSharpAttribute, () => [[["Item", string_type]], [], [], [["selector", string_type], ["from", string_type]], [["moduleName", string_type]], [["moduleName", string_type]], [], [["Item", enum_type("Fable.Core.CaseRules", int32_type, [["None", 0], ["LowerFirst", 1], ["SnakeCase", 2], ["SnakeCaseAllCaps", 3], ["KebabCase", 4], ["LowerAll", 5]])]], [["tagName", string_type], ["caseRules", enum_type("Fable.Core.CaseRules", int32_type, [["None", 0], ["LowerFirst", 1], ["SnakeCase", 2], ["SnakeCaseAllCaps", 3], ["KebabCase", 4], ["LowerAll", 5]])]], [], [], [["Item", option_type(string_type)]], [["Item", enum_type("Fable.Core.CaseRules", int32_type, [["None", 0], ["LowerFirst", 1], ["SnakeCase", 2], ["SnakeCaseAllCaps", 3], ["KebabCase", 4], ["LowerAll", 5]])]], [["Item", string_type]], [["Item", FSharpLiteral_$reflection()]], [], [], [["className", string_type]], [["methodName", string_type]], [["propertyName", string_type]], [], [["name", option_type(string_type)]], [], [], []]);
|
|
237
|
+
return union_type("Glutinum.Converter.FSharpAST.FSharpAttribute", [], FSharpAttribute, () => [[["Item", string_type]], [], [], [["selector", string_type], ["from", string_type]], [["moduleName", string_type]], [["moduleName", string_type]], [], [["Item", enum_type("Fable.Core.CaseRules", int32_type, [["None", 0], ["LowerFirst", 1], ["SnakeCase", 2], ["SnakeCaseAllCaps", 3], ["KebabCase", 4], ["LowerAll", 5]])]], [["tagName", string_type], ["caseRules", enum_type("Fable.Core.CaseRules", int32_type, [["None", 0], ["LowerFirst", 1], ["SnakeCase", 2], ["SnakeCaseAllCaps", 3], ["KebabCase", 4], ["LowerAll", 5]])]], [], [], [["Item", option_type(string_type)]], [["Item", enum_type("Fable.Core.CaseRules", int32_type, [["None", 0], ["LowerFirst", 1], ["SnakeCase", 2], ["SnakeCaseAllCaps", 3], ["KebabCase", 4], ["LowerAll", 5]])]], [["Item", string_type]], [["Item", FSharpLiteral_$reflection()]], [], [], [["className", string_type]], [["methodName", string_type]], [["propertyName", string_type]], [], [["name", option_type(string_type)]], [], [], [], []]);
|
|
256
238
|
}
|
|
257
239
|
|
|
258
240
|
export class FSharpParameter extends Record {
|
|
@@ -566,48 +548,54 @@ export function FSharpDelegate_$reflection() {
|
|
|
566
548
|
return record_type("Glutinum.Converter.FSharpAST.FSharpDelegate", [], FSharpDelegate, () => [["XmlDoc", list_type(FSharpXmlDoc_$reflection())], ["Name", string_type], ["TypeParameters", list_type(FSharpTypeParameter_$reflection())], ["Parameters", list_type(FSharpParameter_$reflection())], ["ReturnType", FSharpType_$reflection()]]);
|
|
567
549
|
}
|
|
568
550
|
|
|
569
|
-
|
|
570
|
-
|
|
551
|
+
/**
|
|
552
|
+
* Calls the delegate typed property of the same name, F# 9 resolves the member and the property
|
|
553
|
+
*/
|
|
554
|
+
export class FSharpDelegateExtension extends Record {
|
|
555
|
+
constructor(Name, Parameters, ReturnType) {
|
|
571
556
|
super();
|
|
572
|
-
this.
|
|
573
|
-
this.
|
|
574
|
-
|
|
575
|
-
cases() {
|
|
576
|
-
return ["Enum", "Union", "SingleErasedCaseUnion", "Option", "Module", "Interface", "Unsupported", "Mapped", "Primitive", "TypeAlias", "Discard", "TypeReference", "Tuple", "TypeParameter", "ResizeArray", "ThisType", "Function", "Class", "Object", "JSApi", "Delegate"];
|
|
557
|
+
this.Name = Name;
|
|
558
|
+
this.Parameters = Parameters;
|
|
559
|
+
this.ReturnType = ReturnType;
|
|
577
560
|
}
|
|
578
|
-
static Discard = new FSharpType(10, []);
|
|
579
|
-
static Object$ = new FSharpType(18, []);
|
|
580
561
|
}
|
|
581
562
|
|
|
582
|
-
export function
|
|
583
|
-
return union_type("Glutinum.Converter.FSharpAST.FSharpType", [], FSharpType, () => [[["Item", FSharpEnum_$reflection()]], [["Item", FSharpUnion_$reflection()]], [["Item", FSharpSingleErasedCaseUnion_$reflection()]], [["Item", FSharpType_$reflection()]], [["Item", FSharpModule_$reflection()]], [["Item", FSharpInterface_$reflection()]], [["Item", enum_type("TypeScript.Ts.SyntaxKind", int32_type, [["Unknown", 0], ["EndOfFileToken", 1], ["SingleLineCommentTrivia", 2], ["MultiLineCommentTrivia", 3], ["NewLineTrivia", 4], ["WhitespaceTrivia", 5], ["ShebangTrivia", 6], ["ConflictMarkerTrivia", 7], ["NonTextFileMarkerTrivia", 8], ["NumericLiteral", 9], ["BigIntLiteral", 10], ["StringLiteral", 11], ["JsxText", 12], ["JsxTextAllWhiteSpaces", 13], ["RegularExpressionLiteral", 14], ["NoSubstitutionTemplateLiteral", 15], ["TemplateHead", 16], ["TemplateMiddle", 17], ["TemplateTail", 18], ["OpenBraceToken", 19], ["CloseBraceToken", 20], ["OpenParenToken", 21], ["CloseParenToken", 22], ["OpenBracketToken", 23], ["CloseBracketToken", 24], ["DotToken", 25], ["DotDotDotToken", 26], ["SemicolonToken", 27], ["CommaToken", 28], ["QuestionDotToken", 29], ["LessThanToken", 30], ["LessThanSlashToken", 31], ["GreaterThanToken", 32], ["LessThanEqualsToken", 33], ["GreaterThanEqualsToken", 34], ["EqualsEqualsToken", 35], ["ExclamationEqualsToken", 36], ["EqualsEqualsEqualsToken", 37], ["ExclamationEqualsEqualsToken", 38], ["EqualsGreaterThanToken", 39], ["PlusToken", 40], ["MinusToken", 41], ["AsteriskToken", 42], ["AsteriskAsteriskToken", 43], ["SlashToken", 44], ["PercentToken", 45], ["PlusPlusToken", 46], ["MinusMinusToken", 47], ["LessThanLessThanToken", 48], ["GreaterThanGreaterThanToken", 49], ["GreaterThanGreaterThanGreaterThanToken", 50], ["AmpersandToken", 51], ["BarToken", 52], ["CaretToken", 53], ["ExclamationToken", 54], ["TildeToken", 55], ["AmpersandAmpersandToken", 56], ["BarBarToken", 57], ["QuestionToken", 58], ["ColonToken", 59], ["AtToken", 60], ["QuestionQuestionToken", 61], ["BacktickToken", 62], ["HashToken", 63], ["EqualsToken", 64], ["PlusEqualsToken", 65], ["MinusEqualsToken", 66], ["AsteriskEqualsToken", 67], ["AsteriskAsteriskEqualsToken", 68], ["SlashEqualsToken", 69], ["PercentEqualsToken", 70], ["LessThanLessThanEqualsToken", 71], ["GreaterThanGreaterThanEqualsToken", 72], ["GreaterThanGreaterThanGreaterThanEqualsToken", 73], ["AmpersandEqualsToken", 74], ["BarEqualsToken", 75], ["BarBarEqualsToken", 76], ["AmpersandAmpersandEqualsToken", 77], ["QuestionQuestionEqualsToken", 78], ["CaretEqualsToken", 79], ["Identifier", 80], ["PrivateIdentifier", 81], ["BreakKeyword", 83], ["CaseKeyword", 84], ["CatchKeyword", 85], ["ClassKeyword", 86], ["ConstKeyword", 87], ["ContinueKeyword", 88], ["DebuggerKeyword", 89], ["DefaultKeyword", 90], ["DeleteKeyword", 91], ["DoKeyword", 92], ["ElseKeyword", 93], ["EnumKeyword", 94], ["ExportKeyword", 95], ["ExtendsKeyword", 96], ["FalseKeyword", 97], ["FinallyKeyword", 98], ["ForKeyword", 99], ["FunctionKeyword", 100], ["IfKeyword", 101], ["ImportKeyword", 102], ["InKeyword", 103], ["InstanceOfKeyword", 104], ["NewKeyword", 105], ["NullKeyword", 106], ["ReturnKeyword", 107], ["SuperKeyword", 108], ["SwitchKeyword", 109], ["ThisKeyword", 110], ["ThrowKeyword", 111], ["TrueKeyword", 112], ["TryKeyword", 113], ["TypeOfKeyword", 114], ["VarKeyword", 115], ["VoidKeyword", 116], ["WhileKeyword", 117], ["WithKeyword", 118], ["ImplementsKeyword", 119], ["InterfaceKeyword", 120], ["LetKeyword", 121], ["PackageKeyword", 122], ["PrivateKeyword", 123], ["ProtectedKeyword", 124], ["PublicKeyword", 125], ["StaticKeyword", 126], ["YieldKeyword", 127], ["AbstractKeyword", 128], ["AccessorKeyword", 129], ["AsKeyword", 130], ["AssertsKeyword", 131], ["AssertKeyword", 132], ["AnyKeyword", 133], ["AsyncKeyword", 134], ["AwaitKeyword", 135], ["BooleanKeyword", 136], ["ConstructorKeyword", 137], ["DeclareKeyword", 138], ["GetKeyword", 139], ["InferKeyword", 140], ["IntrinsicKeyword", 141], ["IsKeyword", 142], ["KeyOfKeyword", 143], ["ModuleKeyword", 144], ["NamespaceKeyword", 145], ["NeverKeyword", 146], ["OutKeyword", 147], ["ReadonlyKeyword", 148], ["RequireKeyword", 149], ["NumberKeyword", 150], ["ObjectKeyword", 151], ["SatisfiesKeyword", 152], ["SetKeyword", 153], ["StringKeyword", 154], ["SymbolKeyword", 155], ["TypeKeyword", 156], ["UndefinedKeyword", 157], ["UniqueKeyword", 158], ["UnknownKeyword", 159], ["UsingKeyword", 160], ["FromKeyword", 161], ["GlobalKeyword", 162], ["BigIntKeyword", 163], ["OverrideKeyword", 164], ["OfKeyword", 165], ["QualifiedName", 166], ["ComputedPropertyName", 167], ["TypeParameter", 168], ["Parameter", 169], ["Decorator", 170], ["PropertySignature", 171], ["PropertyDeclaration", 172], ["MethodSignature", 173], ["MethodDeclaration", 174], ["ClassStaticBlockDeclaration", 175], ["Constructor", 176], ["GetAccessor", 177], ["SetAccessor", 178], ["CallSignature", 179], ["ConstructSignature", 180], ["IndexSignature", 181], ["TypePredicate", 182], ["TypeReference", 183], ["FunctionType", 184], ["ConstructorType", 185], ["TypeQuery", 186], ["TypeLiteral", 187], ["ArrayType", 188], ["TupleType", 189], ["OptionalType", 190], ["RestType", 191], ["UnionType", 192], ["IntersectionType", 193], ["ConditionalType", 194], ["InferType", 195], ["ParenthesizedType", 196], ["ThisType", 197], ["TypeOperator", 198], ["IndexedAccessType", 199], ["MappedType", 200], ["LiteralType", 201], ["NamedTupleMember", 202], ["TemplateLiteralType", 203], ["TemplateLiteralTypeSpan", 204], ["ImportType", 205], ["ObjectBindingPattern", 206], ["ArrayBindingPattern", 207], ["BindingElement", 208], ["ArrayLiteralExpression", 209], ["ObjectLiteralExpression", 210], ["PropertyAccessExpression", 211], ["ElementAccessExpression", 212], ["CallExpression", 213], ["NewExpression", 214], ["TaggedTemplateExpression", 215], ["TypeAssertionExpression", 216], ["ParenthesizedExpression", 217], ["FunctionExpression", 218], ["ArrowFunction", 219], ["DeleteExpression", 220], ["TypeOfExpression", 221], ["VoidExpression", 222], ["AwaitExpression", 223], ["PrefixUnaryExpression", 224], ["PostfixUnaryExpression", 225], ["BinaryExpression", 226], ["ConditionalExpression", 227], ["TemplateExpression", 228], ["YieldExpression", 229], ["SpreadElement", 230], ["ClassExpression", 231], ["OmittedExpression", 232], ["ExpressionWithTypeArguments", 233], ["AsExpression", 234], ["NonNullExpression", 235], ["MetaProperty", 236], ["SyntheticExpression", 237], ["SatisfiesExpression", 238], ["TemplateSpan", 239], ["SemicolonClassElement", 240], ["Block", 241], ["EmptyStatement", 242], ["VariableStatement", 243], ["ExpressionStatement", 244], ["IfStatement", 245], ["DoStatement", 246], ["WhileStatement", 247], ["ForStatement", 248], ["ForInStatement", 249], ["ForOfStatement", 250], ["ContinueStatement", 251], ["BreakStatement", 252], ["ReturnStatement", 253], ["WithStatement", 254], ["SwitchStatement", 255], ["LabeledStatement", 256], ["ThrowStatement", 257], ["TryStatement", 258], ["DebuggerStatement", 259], ["VariableDeclaration", 260], ["VariableDeclarationList", 261], ["FunctionDeclaration", 262], ["ClassDeclaration", 263], ["InterfaceDeclaration", 264], ["TypeAliasDeclaration", 265], ["EnumDeclaration", 266], ["ModuleDeclaration", 267], ["ModuleBlock", 268], ["CaseBlock", 269], ["NamespaceExportDeclaration", 270], ["ImportEqualsDeclaration", 271], ["ImportDeclaration", 272], ["ImportClause", 273], ["NamespaceImport", 274], ["NamedImports", 275], ["ImportSpecifier", 276], ["ExportAssignment", 277], ["ExportDeclaration", 278], ["NamedExports", 279], ["NamespaceExport", 280], ["ExportSpecifier", 281], ["MissingDeclaration", 282], ["ExternalModuleReference", 283], ["JsxElement", 284], ["JsxSelfClosingElement", 285], ["JsxOpeningElement", 286], ["JsxClosingElement", 287], ["JsxFragment", 288], ["JsxOpeningFragment", 289], ["JsxClosingFragment", 290], ["JsxAttribute", 291], ["JsxAttributes", 292], ["JsxSpreadAttribute", 293], ["JsxExpression", 294], ["JsxNamespacedName", 295], ["CaseClause", 296], ["DefaultClause", 297], ["HeritageClause", 298], ["CatchClause", 299], ["AssertClause", 300], ["AssertEntry", 301], ["ImportTypeAssertionContainer", 302], ["PropertyAssignment", 303], ["ShorthandPropertyAssignment", 304], ["SpreadAssignment", 305], ["EnumMember", 306], ["UnparsedPrologue", 307], ["UnparsedPrepend", 308], ["UnparsedText", 309], ["UnparsedInternalText", 310], ["UnparsedSyntheticReference", 311], ["SourceFile", 312], ["Bundle", 313], ["UnparsedSource", 314], ["InputFiles", 315], ["JSDocTypeExpression", 316], ["JSDocNameReference", 317], ["JSDocMemberName", 318], ["JSDocAllType", 319], ["JSDocUnknownType", 320], ["JSDocNullableType", 321], ["JSDocNonNullableType", 322], ["JSDocOptionalType", 323], ["JSDocFunctionType", 324], ["JSDocVariadicType", 325], ["JSDocNamepathType", 326], ["JSDoc", 327], ["JSDocComment", 327], ["JSDocText", 328], ["JSDocTypeLiteral", 329], ["JSDocSignature", 330], ["JSDocLink", 331], ["JSDocLinkCode", 332], ["JSDocLinkPlain", 333], ["JSDocTag", 334], ["JSDocAugmentsTag", 335], ["JSDocImplementsTag", 336], ["JSDocAuthorTag", 337], ["JSDocDeprecatedTag", 338], ["JSDocClassTag", 339], ["JSDocPublicTag", 340], ["JSDocPrivateTag", 341], ["JSDocProtectedTag", 342], ["JSDocReadonlyTag", 343], ["JSDocOverrideTag", 344], ["JSDocCallbackTag", 345], ["JSDocOverloadTag", 346], ["JSDocEnumTag", 347], ["JSDocParameterTag", 348], ["JSDocReturnTag", 349], ["JSDocThisTag", 350], ["JSDocTypeTag", 351], ["JSDocTemplateTag", 352], ["JSDocTypedefTag", 353], ["JSDocSeeTag", 354], ["JSDocPropertyTag", 355], ["JSDocThrowsTag", 356], ["JSDocSatisfiesTag", 357], ["SyntaxList", 358], ["NotEmittedStatement", 359], ["PartiallyEmittedExpression", 360], ["CommaListExpression", 361], ["SyntheticReferenceExpression", 362], ["Count", 363], ["FirstAssignment", 64], ["LastAssignment", 79], ["FirstCompoundAssignment", 65], ["LastCompoundAssignment", 79], ["FirstReservedWord", 83], ["LastReservedWord", 118], ["FirstKeyword", 83], ["LastKeyword", 165], ["FirstFutureReservedWord", 119], ["LastFutureReservedWord", 127], ["FirstTypeNode", 182], ["LastTypeNode", 205], ["FirstPunctuation", 19], ["LastPunctuation", 79], ["FirstToken", 0], ["LastToken", 165], ["FirstTriviaToken", 2], ["LastTriviaToken", 7], ["FirstLiteralToken", 9], ["LastLiteralToken", 15], ["FirstTemplateToken", 15], ["LastTemplateToken", 18], ["FirstBinaryOperator", 30], ["LastBinaryOperator", 79], ["FirstStatement", 243], ["LastStatement", 259], ["FirstNode", 166], ["FirstJSDocNode", 316], ["LastJSDocNode", 357], ["FirstJSDocTagNode", 334], ["LastJSDocTagNode", 357]])]], [["Item", FSharpMapped_$reflection()]], [["Item", FSharpPrimitive_$reflection()]], [["Item", FSharpTypeAlias_$reflection()]], [], [["Item", FSharpTypeReference_$reflection()]], [["Item", list_type(FSharpType_$reflection())]], [["Item", string_type]], [["Item", FSharpType_$reflection()]], [["Item", FSharpThisType_$reflection()]], [["Item", FSharpFunctionType_$reflection()]], [["Item", FSharpClass_$reflection()]], [], [["Item", FSharpJSApi_$reflection()]], [["Item", FSharpDelegate_$reflection()]]]);
|
|
563
|
+
export function FSharpDelegateExtension_$reflection() {
|
|
564
|
+
return record_type("Glutinum.Converter.FSharpAST.FSharpDelegateExtension", [], FSharpDelegateExtension, () => [["Name", string_type], ["Parameters", list_type(FSharpParameter_$reflection())], ["ReturnType", FSharpType_$reflection()]]);
|
|
584
565
|
}
|
|
585
566
|
|
|
586
|
-
|
|
587
|
-
|
|
567
|
+
/**
|
|
568
|
+
* `type Foo with` in an `[<AutoOpen>]` module, visible wherever `Foo` is
|
|
569
|
+
*/
|
|
570
|
+
export class FSharpTypeExtension extends Record {
|
|
571
|
+
constructor(ModuleName, TargetName, TypeParameters, Members) {
|
|
588
572
|
super();
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
573
|
+
this.ModuleName = ModuleName;
|
|
574
|
+
this.TargetName = TargetName;
|
|
575
|
+
this.TypeParameters = TypeParameters;
|
|
576
|
+
this.Members = Members;
|
|
591
577
|
}
|
|
592
578
|
}
|
|
593
579
|
|
|
594
|
-
export function
|
|
595
|
-
return record_type("Glutinum.Converter.FSharpAST.
|
|
580
|
+
export function FSharpTypeExtension_$reflection() {
|
|
581
|
+
return record_type("Glutinum.Converter.FSharpAST.FSharpTypeExtension", [], FSharpTypeExtension, () => [["ModuleName", string_type], ["TargetName", string_type], ["TypeParameters", list_type(FSharpTypeParameter_$reflection())], ["Members", list_type(FSharpDelegateExtension_$reflection())]]);
|
|
596
582
|
}
|
|
597
583
|
|
|
598
|
-
export
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
return this$.fields[0].toString();
|
|
604
|
-
case 3:
|
|
605
|
-
return toString(this$.fields[0]);
|
|
606
|
-
case 4:
|
|
607
|
-
return "null";
|
|
608
|
-
default:
|
|
609
|
-
return this$.fields[0];
|
|
584
|
+
export class FSharpType extends Union {
|
|
585
|
+
constructor(tag, fields) {
|
|
586
|
+
super();
|
|
587
|
+
this.tag = tag;
|
|
588
|
+
this.fields = fields;
|
|
610
589
|
}
|
|
590
|
+
cases() {
|
|
591
|
+
return ["Enum", "Union", "SingleErasedCaseUnion", "Option", "Module", "Interface", "Unsupported", "Mapped", "Primitive", "TypeAlias", "Discard", "TypeReference", "Tuple", "TypeParameter", "ResizeArray", "ThisType", "Function", "Class", "Object", "JSApi", "Delegate", "TypeExtension"];
|
|
592
|
+
}
|
|
593
|
+
static Discard = new FSharpType(10, []);
|
|
594
|
+
static Object$ = new FSharpType(18, []);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export function FSharpType_$reflection() {
|
|
598
|
+
return union_type("Glutinum.Converter.FSharpAST.FSharpType", [], FSharpType, () => [[["Item", FSharpEnum_$reflection()]], [["Item", FSharpUnion_$reflection()]], [["Item", FSharpSingleErasedCaseUnion_$reflection()]], [["Item", FSharpType_$reflection()]], [["Item", FSharpModule_$reflection()]], [["Item", FSharpInterface_$reflection()]], [["Item", enum_type("TypeScript.Ts.SyntaxKind", int32_type, [["Unknown", 0], ["EndOfFileToken", 1], ["SingleLineCommentTrivia", 2], ["MultiLineCommentTrivia", 3], ["NewLineTrivia", 4], ["WhitespaceTrivia", 5], ["ShebangTrivia", 6], ["ConflictMarkerTrivia", 7], ["NonTextFileMarkerTrivia", 8], ["NumericLiteral", 9], ["BigIntLiteral", 10], ["StringLiteral", 11], ["JsxText", 12], ["JsxTextAllWhiteSpaces", 13], ["RegularExpressionLiteral", 14], ["NoSubstitutionTemplateLiteral", 15], ["TemplateHead", 16], ["TemplateMiddle", 17], ["TemplateTail", 18], ["OpenBraceToken", 19], ["CloseBraceToken", 20], ["OpenParenToken", 21], ["CloseParenToken", 22], ["OpenBracketToken", 23], ["CloseBracketToken", 24], ["DotToken", 25], ["DotDotDotToken", 26], ["SemicolonToken", 27], ["CommaToken", 28], ["QuestionDotToken", 29], ["LessThanToken", 30], ["LessThanSlashToken", 31], ["GreaterThanToken", 32], ["LessThanEqualsToken", 33], ["GreaterThanEqualsToken", 34], ["EqualsEqualsToken", 35], ["ExclamationEqualsToken", 36], ["EqualsEqualsEqualsToken", 37], ["ExclamationEqualsEqualsToken", 38], ["EqualsGreaterThanToken", 39], ["PlusToken", 40], ["MinusToken", 41], ["AsteriskToken", 42], ["AsteriskAsteriskToken", 43], ["SlashToken", 44], ["PercentToken", 45], ["PlusPlusToken", 46], ["MinusMinusToken", 47], ["LessThanLessThanToken", 48], ["GreaterThanGreaterThanToken", 49], ["GreaterThanGreaterThanGreaterThanToken", 50], ["AmpersandToken", 51], ["BarToken", 52], ["CaretToken", 53], ["ExclamationToken", 54], ["TildeToken", 55], ["AmpersandAmpersandToken", 56], ["BarBarToken", 57], ["QuestionToken", 58], ["ColonToken", 59], ["AtToken", 60], ["QuestionQuestionToken", 61], ["BacktickToken", 62], ["HashToken", 63], ["EqualsToken", 64], ["PlusEqualsToken", 65], ["MinusEqualsToken", 66], ["AsteriskEqualsToken", 67], ["AsteriskAsteriskEqualsToken", 68], ["SlashEqualsToken", 69], ["PercentEqualsToken", 70], ["LessThanLessThanEqualsToken", 71], ["GreaterThanGreaterThanEqualsToken", 72], ["GreaterThanGreaterThanGreaterThanEqualsToken", 73], ["AmpersandEqualsToken", 74], ["BarEqualsToken", 75], ["BarBarEqualsToken", 76], ["AmpersandAmpersandEqualsToken", 77], ["QuestionQuestionEqualsToken", 78], ["CaretEqualsToken", 79], ["Identifier", 80], ["PrivateIdentifier", 81], ["BreakKeyword", 83], ["CaseKeyword", 84], ["CatchKeyword", 85], ["ClassKeyword", 86], ["ConstKeyword", 87], ["ContinueKeyword", 88], ["DebuggerKeyword", 89], ["DefaultKeyword", 90], ["DeleteKeyword", 91], ["DoKeyword", 92], ["ElseKeyword", 93], ["EnumKeyword", 94], ["ExportKeyword", 95], ["ExtendsKeyword", 96], ["FalseKeyword", 97], ["FinallyKeyword", 98], ["ForKeyword", 99], ["FunctionKeyword", 100], ["IfKeyword", 101], ["ImportKeyword", 102], ["InKeyword", 103], ["InstanceOfKeyword", 104], ["NewKeyword", 105], ["NullKeyword", 106], ["ReturnKeyword", 107], ["SuperKeyword", 108], ["SwitchKeyword", 109], ["ThisKeyword", 110], ["ThrowKeyword", 111], ["TrueKeyword", 112], ["TryKeyword", 113], ["TypeOfKeyword", 114], ["VarKeyword", 115], ["VoidKeyword", 116], ["WhileKeyword", 117], ["WithKeyword", 118], ["ImplementsKeyword", 119], ["InterfaceKeyword", 120], ["LetKeyword", 121], ["PackageKeyword", 122], ["PrivateKeyword", 123], ["ProtectedKeyword", 124], ["PublicKeyword", 125], ["StaticKeyword", 126], ["YieldKeyword", 127], ["AbstractKeyword", 128], ["AccessorKeyword", 129], ["AsKeyword", 130], ["AssertsKeyword", 131], ["AssertKeyword", 132], ["AnyKeyword", 133], ["AsyncKeyword", 134], ["AwaitKeyword", 135], ["BooleanKeyword", 136], ["ConstructorKeyword", 137], ["DeclareKeyword", 138], ["GetKeyword", 139], ["InferKeyword", 140], ["IntrinsicKeyword", 141], ["IsKeyword", 142], ["KeyOfKeyword", 143], ["ModuleKeyword", 144], ["NamespaceKeyword", 145], ["NeverKeyword", 146], ["OutKeyword", 147], ["ReadonlyKeyword", 148], ["RequireKeyword", 149], ["NumberKeyword", 150], ["ObjectKeyword", 151], ["SatisfiesKeyword", 152], ["SetKeyword", 153], ["StringKeyword", 154], ["SymbolKeyword", 155], ["TypeKeyword", 156], ["UndefinedKeyword", 157], ["UniqueKeyword", 158], ["UnknownKeyword", 159], ["UsingKeyword", 160], ["FromKeyword", 161], ["GlobalKeyword", 162], ["BigIntKeyword", 163], ["OverrideKeyword", 164], ["OfKeyword", 165], ["DeferKeyword", 166], ["QualifiedName", 167], ["ComputedPropertyName", 168], ["TypeParameter", 169], ["Parameter", 170], ["Decorator", 171], ["PropertySignature", 172], ["PropertyDeclaration", 173], ["MethodSignature", 174], ["MethodDeclaration", 175], ["ClassStaticBlockDeclaration", 176], ["Constructor", 177], ["GetAccessor", 178], ["SetAccessor", 179], ["CallSignature", 180], ["ConstructSignature", 181], ["IndexSignature", 182], ["TypePredicate", 183], ["TypeReference", 184], ["FunctionType", 185], ["ConstructorType", 186], ["TypeQuery", 187], ["TypeLiteral", 188], ["ArrayType", 189], ["TupleType", 190], ["OptionalType", 191], ["RestType", 192], ["UnionType", 193], ["IntersectionType", 194], ["ConditionalType", 195], ["InferType", 196], ["ParenthesizedType", 197], ["ThisType", 198], ["TypeOperator", 199], ["IndexedAccessType", 200], ["MappedType", 201], ["LiteralType", 202], ["NamedTupleMember", 203], ["TemplateLiteralType", 204], ["TemplateLiteralTypeSpan", 205], ["ImportType", 206], ["ObjectBindingPattern", 207], ["ArrayBindingPattern", 208], ["BindingElement", 209], ["ArrayLiteralExpression", 210], ["ObjectLiteralExpression", 211], ["PropertyAccessExpression", 212], ["ElementAccessExpression", 213], ["CallExpression", 214], ["NewExpression", 215], ["TaggedTemplateExpression", 216], ["TypeAssertionExpression", 217], ["ParenthesizedExpression", 218], ["FunctionExpression", 219], ["ArrowFunction", 220], ["DeleteExpression", 221], ["TypeOfExpression", 222], ["VoidExpression", 223], ["AwaitExpression", 224], ["PrefixUnaryExpression", 225], ["PostfixUnaryExpression", 226], ["BinaryExpression", 227], ["ConditionalExpression", 228], ["TemplateExpression", 229], ["YieldExpression", 230], ["SpreadElement", 231], ["ClassExpression", 232], ["OmittedExpression", 233], ["ExpressionWithTypeArguments", 234], ["AsExpression", 235], ["NonNullExpression", 236], ["MetaProperty", 237], ["SyntheticExpression", 238], ["SatisfiesExpression", 239], ["TemplateSpan", 240], ["SemicolonClassElement", 241], ["Block", 242], ["EmptyStatement", 243], ["VariableStatement", 244], ["ExpressionStatement", 245], ["IfStatement", 246], ["DoStatement", 247], ["WhileStatement", 248], ["ForStatement", 249], ["ForInStatement", 250], ["ForOfStatement", 251], ["ContinueStatement", 252], ["BreakStatement", 253], ["ReturnStatement", 254], ["WithStatement", 255], ["SwitchStatement", 256], ["LabeledStatement", 257], ["ThrowStatement", 258], ["TryStatement", 259], ["DebuggerStatement", 260], ["VariableDeclaration", 261], ["VariableDeclarationList", 262], ["FunctionDeclaration", 263], ["ClassDeclaration", 264], ["InterfaceDeclaration", 265], ["TypeAliasDeclaration", 266], ["EnumDeclaration", 267], ["ModuleDeclaration", 268], ["ModuleBlock", 269], ["CaseBlock", 270], ["NamespaceExportDeclaration", 271], ["ImportEqualsDeclaration", 272], ["ImportDeclaration", 273], ["ImportClause", 274], ["NamespaceImport", 275], ["NamedImports", 276], ["ImportSpecifier", 277], ["ExportAssignment", 278], ["ExportDeclaration", 279], ["NamedExports", 280], ["NamespaceExport", 281], ["ExportSpecifier", 282], ["MissingDeclaration", 283], ["ExternalModuleReference", 284], ["JsxElement", 285], ["JsxSelfClosingElement", 286], ["JsxOpeningElement", 287], ["JsxClosingElement", 288], ["JsxFragment", 289], ["JsxOpeningFragment", 290], ["JsxClosingFragment", 291], ["JsxAttribute", 292], ["JsxAttributes", 293], ["JsxSpreadAttribute", 294], ["JsxExpression", 295], ["JsxNamespacedName", 296], ["CaseClause", 297], ["DefaultClause", 298], ["HeritageClause", 299], ["CatchClause", 300], ["ImportAttributes", 301], ["ImportAttribute", 302], ["AssertClause", 301], ["AssertEntry", 302], ["ImportTypeAssertionContainer", 303], ["PropertyAssignment", 304], ["ShorthandPropertyAssignment", 305], ["SpreadAssignment", 306], ["EnumMember", 307], ["SourceFile", 308], ["Bundle", 309], ["JSDocTypeExpression", 310], ["JSDocNameReference", 311], ["JSDocMemberName", 312], ["JSDocAllType", 313], ["JSDocUnknownType", 314], ["JSDocNullableType", 315], ["JSDocNonNullableType", 316], ["JSDocOptionalType", 317], ["JSDocFunctionType", 318], ["JSDocVariadicType", 319], ["JSDocNamepathType", 320], ["JSDoc", 321], ["JSDocComment", 321], ["JSDocText", 322], ["JSDocTypeLiteral", 323], ["JSDocSignature", 324], ["JSDocLink", 325], ["JSDocLinkCode", 326], ["JSDocLinkPlain", 327], ["JSDocTag", 328], ["JSDocAugmentsTag", 329], ["JSDocImplementsTag", 330], ["JSDocAuthorTag", 331], ["JSDocDeprecatedTag", 332], ["JSDocClassTag", 333], ["JSDocPublicTag", 334], ["JSDocPrivateTag", 335], ["JSDocProtectedTag", 336], ["JSDocReadonlyTag", 337], ["JSDocOverrideTag", 338], ["JSDocCallbackTag", 339], ["JSDocOverloadTag", 340], ["JSDocEnumTag", 341], ["JSDocParameterTag", 342], ["JSDocReturnTag", 343], ["JSDocThisTag", 344], ["JSDocTypeTag", 345], ["JSDocTemplateTag", 346], ["JSDocTypedefTag", 347], ["JSDocSeeTag", 348], ["JSDocPropertyTag", 349], ["JSDocThrowsTag", 350], ["JSDocSatisfiesTag", 351], ["JSDocImportTag", 352], ["SyntaxList", 353], ["NotEmittedStatement", 354], ["NotEmittedTypeElement", 355], ["PartiallyEmittedExpression", 356], ["CommaListExpression", 357], ["SyntheticReferenceExpression", 358], ["Count", 359], ["FirstAssignment", 64], ["LastAssignment", 79], ["FirstCompoundAssignment", 65], ["LastCompoundAssignment", 79], ["FirstReservedWord", 83], ["LastReservedWord", 118], ["FirstKeyword", 83], ["LastKeyword", 166], ["FirstFutureReservedWord", 119], ["LastFutureReservedWord", 127], ["FirstTypeNode", 183], ["LastTypeNode", 206], ["FirstPunctuation", 19], ["LastPunctuation", 79], ["FirstToken", 0], ["LastToken", 166], ["FirstTriviaToken", 2], ["LastTriviaToken", 7], ["FirstLiteralToken", 9], ["LastLiteralToken", 15], ["FirstTemplateToken", 15], ["LastTemplateToken", 18], ["FirstBinaryOperator", 30], ["LastBinaryOperator", 79], ["FirstStatement", 244], ["LastStatement", 260], ["FirstNode", 167], ["FirstJSDocNode", 310], ["LastJSDocNode", 352], ["FirstJSDocTagNode", 328], ["LastJSDocTagNode", 352]])]], [["Item", FSharpMapped_$reflection()]], [["Item", FSharpPrimitive_$reflection()]], [["Item", FSharpTypeAlias_$reflection()]], [], [["Item", FSharpTypeReference_$reflection()]], [["Item", list_type(FSharpType_$reflection())]], [["Item", string_type]], [["Item", FSharpType_$reflection()]], [["Item", FSharpThisType_$reflection()]], [["Item", FSharpFunctionType_$reflection()]], [["Item", FSharpClass_$reflection()]], [], [["Item", FSharpJSApi_$reflection()]], [["Item", FSharpDelegate_$reflection()]], [["Item", FSharpTypeExtension_$reflection()]]]);
|
|
611
599
|
}
|
|
612
600
|
|
|
613
601
|
export function FSharpEnum__get_Type(this$) {
|
|
@@ -644,26 +632,123 @@ export function FSharpEnum__get_Type(this$) {
|
|
|
644
632
|
}
|
|
645
633
|
}
|
|
646
634
|
|
|
647
|
-
export function
|
|
648
|
-
|
|
649
|
-
case 1:
|
|
650
|
-
return "private";
|
|
651
|
-
case 2:
|
|
652
|
-
return "protected";
|
|
653
|
-
default:
|
|
654
|
-
return "public";
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
export function FSharpConstructor_get_EmptyPublic() {
|
|
659
|
-
return new FSharpConstructor(empty(), empty(), FSharpAccessibility.Public);
|
|
635
|
+
export function FSharpTypeParameterInfo_Create_Z6CFD3565(name, constraint_, default_) {
|
|
636
|
+
return new FSharpTypeParameterInfo(name, constraint_, default_);
|
|
660
637
|
}
|
|
661
638
|
|
|
662
|
-
export function
|
|
663
|
-
|
|
639
|
+
export function FSharpTypeModule_mapChildren(f, typ) {
|
|
640
|
+
switch (typ.tag) {
|
|
641
|
+
case 11: {
|
|
642
|
+
const typeReference = typ.fields[0];
|
|
643
|
+
return new FSharpType(/* TypeReference */ 11, [new FSharpTypeReference(typeReference.Name, typeReference.FullName, typeReference.ModulePath, map(f, typeReference.TypeArguments), typeReference.Type)]);
|
|
644
|
+
}
|
|
645
|
+
case 3:
|
|
646
|
+
return new FSharpType(/* Option */ 3, [f(typ.fields[0])]);
|
|
647
|
+
case 14:
|
|
648
|
+
return new FSharpType(/* ResizeArray */ 14, [f(typ.fields[0])]);
|
|
649
|
+
case 19:
|
|
650
|
+
return new FSharpType(/* JSApi */ 19, [new FSharpJSApi(f(typ.fields[0].fields[0]))]);
|
|
651
|
+
case 12:
|
|
652
|
+
return new FSharpType(/* Tuple */ 12, [map(f, typ.fields[0])]);
|
|
653
|
+
case 1: {
|
|
654
|
+
const unionInfo = typ.fields[0];
|
|
655
|
+
return new FSharpType(/* Union */ 1, [new FSharpUnion(unionInfo.Attributes, unionInfo.Name, map((_arg) => {
|
|
656
|
+
switch (_arg.tag) {
|
|
657
|
+
case 1:
|
|
658
|
+
return new FSharpUnionCase(/* Typed */ 1, [f(_arg.fields[0])]);
|
|
659
|
+
case 2:
|
|
660
|
+
return new FSharpUnionCase(/* Field */ 2, [_arg.fields[0], f(_arg.fields[1])]);
|
|
661
|
+
default:
|
|
662
|
+
return _arg;
|
|
663
|
+
}
|
|
664
|
+
}, unionInfo.Cases), unionInfo.IsOptional, unionInfo.TypeParameters, unionInfo.Constants)]);
|
|
665
|
+
}
|
|
666
|
+
case 16: {
|
|
667
|
+
const functionType = typ.fields[0];
|
|
668
|
+
return new FSharpType(/* Function */ 16, [new FSharpFunctionType(map((parameter) => (new FSharpParameter(parameter.Attributes, parameter.Name, parameter.IsOptional, f(parameter.Type), parameter.OriginalGlueMember)), functionType.Parameters), f(functionType.ReturnType))]);
|
|
669
|
+
}
|
|
670
|
+
default:
|
|
671
|
+
return typ;
|
|
672
|
+
}
|
|
664
673
|
}
|
|
665
674
|
|
|
666
|
-
|
|
667
|
-
|
|
675
|
+
/**
|
|
676
|
+
* The return type of a function comes before its parameters
|
|
677
|
+
*/
|
|
678
|
+
export function FSharpTypeModule_children(typ) {
|
|
679
|
+
let matchResult, inner;
|
|
680
|
+
switch (typ.tag) {
|
|
681
|
+
case 11: {
|
|
682
|
+
matchResult = 0;
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
case 3: {
|
|
686
|
+
matchResult = 1;
|
|
687
|
+
inner = typ.fields[0];
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
case 14: {
|
|
691
|
+
matchResult = 1;
|
|
692
|
+
inner = typ.fields[0];
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
case 19: {
|
|
696
|
+
matchResult = 1;
|
|
697
|
+
inner = typ.fields[0].fields[0];
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
case 12: {
|
|
701
|
+
matchResult = 2;
|
|
702
|
+
break;
|
|
703
|
+
}
|
|
704
|
+
case 1: {
|
|
705
|
+
matchResult = 3;
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
case 16: {
|
|
709
|
+
matchResult = 4;
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
712
|
+
default:
|
|
713
|
+
matchResult = 5;
|
|
714
|
+
}
|
|
715
|
+
switch (matchResult) {
|
|
716
|
+
case 0:
|
|
717
|
+
return typ.fields[0].TypeArguments;
|
|
718
|
+
case 1:
|
|
719
|
+
return singleton(inner);
|
|
720
|
+
case 2:
|
|
721
|
+
return typ.fields[0];
|
|
722
|
+
case 3:
|
|
723
|
+
return choose((_arg) => {
|
|
724
|
+
let matchResult_1, inner_1;
|
|
725
|
+
switch (_arg.tag) {
|
|
726
|
+
case 1: {
|
|
727
|
+
matchResult_1 = 0;
|
|
728
|
+
inner_1 = _arg.fields[0];
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
case 2: {
|
|
732
|
+
matchResult_1 = 0;
|
|
733
|
+
inner_1 = _arg.fields[1];
|
|
734
|
+
break;
|
|
735
|
+
}
|
|
736
|
+
default:
|
|
737
|
+
matchResult_1 = 1;
|
|
738
|
+
}
|
|
739
|
+
switch (matchResult_1) {
|
|
740
|
+
case 0:
|
|
741
|
+
return inner_1;
|
|
742
|
+
default:
|
|
743
|
+
return undefined;
|
|
744
|
+
}
|
|
745
|
+
}, typ.fields[0].Cases);
|
|
746
|
+
case 4: {
|
|
747
|
+
const functionType = typ.fields[0];
|
|
748
|
+
return cons(functionType.ReturnType, map((_arg_1) => _arg_1.Type, functionType.Parameters));
|
|
749
|
+
}
|
|
750
|
+
default:
|
|
751
|
+
return empty();
|
|
752
|
+
}
|
|
668
753
|
}
|
|
669
754
|
|