@glutinum/cli 0.14.1 → 1.0.0-beta.2
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 +38 -4
- package/dist/Glutinum.Converter/Generate.js +19 -11
- package/dist/Glutinum.Converter/GlueAST.js +45 -36
- package/dist/Glutinum.Converter/Hosting.js +917 -0
- package/dist/Glutinum.Converter/Merge.js +218 -82
- package/dist/Glutinum.Converter/Packages.js +44 -8
- package/dist/Glutinum.Converter/Printer.js +116 -50
- package/dist/Glutinum.Converter/Read.js +8 -8
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +7 -7
- package/dist/Glutinum.Converter/Reader/Declaration.js +26 -26
- package/dist/Glutinum.Converter/Reader/Documentation.js +37 -36
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +5 -5
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +31 -19
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +6 -7
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +36 -29
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +3 -3
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +82 -4
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +3 -3
- package/dist/Glutinum.Converter/Reader/Node.js +20 -20
- package/dist/Glutinum.Converter/Reader/Parameters.js +7 -7
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +5 -5
- package/dist/Glutinum.Converter/Reader/TypeNode.js +291 -232
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +8 -8
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +108 -40
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +2 -2
- package/dist/Glutinum.Converter/Reader/Types.js +6 -6
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +7 -6
- package/dist/Glutinum.Converter/Reader/Utils.js +106 -56
- package/dist/Glutinum.Converter/Transform.js +2137 -735
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +194 -202
- package/dist/Glutinum.Converter/Utils/Naming.js +7 -0
- package/dist/Glutinum.Converter/Utils/String.js +2 -2
- package/dist/Program.js +99 -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
|
@@ -3,15 +3,17 @@ import { toString } from "../fable_modules/fable-library-js.5.17.2/Types.js";
|
|
|
3
3
|
import { StringBuilder__AppendLine, StringBuilder__Append_Z721C83C5, StringBuilder_$ctor } from "../fable_modules/fable-library-js.5.17.2/System.Text.js";
|
|
4
4
|
import { class_type } from "../fable_modules/fable-library-js.5.17.2/Reflection.js";
|
|
5
5
|
import { max } from "../fable_modules/fable-library-js.5.17.2/Double.js";
|
|
6
|
-
import { trimStart, interpolate, join, replace, concat, isNullOrWhiteSpace, replicate } from "../fable_modules/fable-library-js.5.17.2/String.js";
|
|
6
|
+
import { trimStart, interpolate, substring, join, replace, concat, isNullOrWhiteSpace, replicate } from "../fable_modules/fable-library-js.5.17.2/String.js";
|
|
7
7
|
import { isDigit2 } from "../fable_modules/fable-library-js.5.17.2/Char.js";
|
|
8
8
|
import { splitLines, replace as replace_1, removeSingleQuote, removeDoubleQuote, capitalizeFirstLetter } from "./Utils/String.js";
|
|
9
9
|
import { tail as tail_1, cons, head, mapIndexed, empty, forAll, ofArray, concat as concat_1, partition, singleton, append, choose, filter, iterateIndexed, isEmpty, iterate, map, length, exists } from "../fable_modules/fable-library-js.5.17.2/List.js";
|
|
10
|
-
import { disposeSafe, getEnumerator, int32ToString, Exception } from "../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
10
|
+
import { stringHash, disposeSafe, getEnumerator, int32ToString, Exception } from "../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
11
|
+
import { sanitizeTypeParameterName } from "./Utils/Naming.js";
|
|
11
12
|
import { escape, create, isMatch, replace as replace_2 } from "../fable_modules/fable-library-js.5.17.2/RegExp.js";
|
|
12
13
|
import { removeConsecutiveEmptyLines, trimEmptyLines } from "./Utils/List.js";
|
|
13
14
|
import { singleton as singleton_1, append as append_1, delay, toList } from "../fable_modules/fable-library-js.5.17.2/Seq.js";
|
|
14
15
|
import { FSharpOutFile, FSharpInterface, FSharpAttribute } from "./FsharpAST.js";
|
|
16
|
+
import { List_distinct } from "../fable_modules/fable-library-js.5.17.2/Seq2.js";
|
|
15
17
|
|
|
16
18
|
export class Printer {
|
|
17
19
|
constructor() {
|
|
@@ -172,13 +174,18 @@ function attributeToText(fsharpAttribute) {
|
|
|
172
174
|
return "[<ParamArray>]";
|
|
173
175
|
case 24:
|
|
174
176
|
return "[<Interface>]";
|
|
177
|
+
case 25:
|
|
178
|
+
return "[<AutoOpen>]";
|
|
175
179
|
case 11:
|
|
176
180
|
if (fsharpAttribute.fields[0] == null) {
|
|
177
181
|
return "[<Obsolete>]";
|
|
178
182
|
}
|
|
179
183
|
else {
|
|
180
184
|
const message_1 = fsharpAttribute.fields[0];
|
|
181
|
-
if ((message_1.indexOf("
|
|
185
|
+
if ((message_1.indexOf("``") >= 0) ? true : (message_1.indexOf("\"\"\"") >= 0)) {
|
|
186
|
+
return concat("[<Obsolete(\"", replace(replace(replace(replace(replace(message_1, "\\", "\\\\"), "\"", "\\\""), "\r", "\\r"), "\n", "\\n"), "\t", "\\t"), "\")>]");
|
|
187
|
+
}
|
|
188
|
+
else if ((message_1.indexOf("\n") >= 0) ? true : (message_1.indexOf("\"") >= 0)) {
|
|
182
189
|
return concat("[<Obsolete(\"\"\"", message_1, "\"\"\")>]");
|
|
183
190
|
}
|
|
184
191
|
else {
|
|
@@ -231,7 +238,7 @@ export function printTypeParametersDeclaration(printer, typeParameters) {
|
|
|
231
238
|
Printer__WriteInline_Z721C83C5(innterPrinter, ", ");
|
|
232
239
|
}
|
|
233
240
|
if (typeParameter.tag === 1) {
|
|
234
|
-
Printer__WriteInline_Z721C83C5(innterPrinter, concat("\'", typeParameter.fields[0].Name));
|
|
241
|
+
Printer__WriteInline_Z721C83C5(innterPrinter, concat("\'", sanitizeTypeParameterName(typeParameter.fields[0].Name)));
|
|
235
242
|
}
|
|
236
243
|
else {
|
|
237
244
|
Printer__WriteInline_Z721C83C5(innterPrinter, `'T${index}`);
|
|
@@ -271,6 +278,7 @@ export function printTypeParametersDeclaration(printer, typeParameters) {
|
|
|
271
278
|
|
|
272
279
|
export function printTypeNameWithTypeParameters(name, typeParameters) {
|
|
273
280
|
const printer = Printer_$ctor();
|
|
281
|
+
const name_1 = name.startsWith("\'") ? ("\'" + sanitizeTypeParameterName(substring(name, 1))) : name;
|
|
274
282
|
if (!isEmpty(typeParameters)) {
|
|
275
283
|
Printer__WriteInline_Z721C83C5(printer, "<");
|
|
276
284
|
iterateIndexed((index, typeParameter) => {
|
|
@@ -278,7 +286,7 @@ export function printTypeNameWithTypeParameters(name, typeParameters) {
|
|
|
278
286
|
Printer__WriteInline_Z721C83C5(printer, ", ");
|
|
279
287
|
}
|
|
280
288
|
if (typeParameter.tag === 1) {
|
|
281
|
-
Printer__WriteInline_Z721C83C5(printer, concat("\'", typeParameter.fields[0].Name));
|
|
289
|
+
Printer__WriteInline_Z721C83C5(printer, concat("\'", sanitizeTypeParameterName(typeParameter.fields[0].Name)));
|
|
282
290
|
}
|
|
283
291
|
else {
|
|
284
292
|
Printer__WriteInline_Z721C83C5(printer, printType(typeParameter.fields[0]));
|
|
@@ -286,7 +294,7 @@ export function printTypeNameWithTypeParameters(name, typeParameters) {
|
|
|
286
294
|
}, typeParameters);
|
|
287
295
|
Printer__WriteInline_Z721C83C5(printer, ">");
|
|
288
296
|
}
|
|
289
|
-
return concat(
|
|
297
|
+
return concat(name_1, Printer__ToStringWithoutTrailNewLine(printer));
|
|
290
298
|
}
|
|
291
299
|
|
|
292
300
|
export function printType(fsharpType) {
|
|
@@ -364,7 +372,7 @@ export function printType(fsharpType) {
|
|
|
364
372
|
}
|
|
365
373
|
}
|
|
366
374
|
case 13:
|
|
367
|
-
return concat("\'", fsharpType.fields[0]);
|
|
375
|
+
return concat("\'", sanitizeTypeParameterName(fsharpType.fields[0]));
|
|
368
376
|
case 3:
|
|
369
377
|
return printType(fsharpType.fields[0]) + " option";
|
|
370
378
|
case 14:
|
|
@@ -386,6 +394,7 @@ export function printType(fsharpType) {
|
|
|
386
394
|
return printTypeNameWithTypeParameters(delegateInfo.Name, delegateInfo.TypeParameters);
|
|
387
395
|
}
|
|
388
396
|
case 4:
|
|
397
|
+
case 21:
|
|
389
398
|
case 6:
|
|
390
399
|
case 10:
|
|
391
400
|
return "obj";
|
|
@@ -524,6 +533,15 @@ function printXmlDoc(printer, elements) {
|
|
|
524
533
|
}, patternInput[1]);
|
|
525
534
|
}
|
|
526
535
|
|
|
536
|
+
function printParameterType(typ) {
|
|
537
|
+
if (typ.tag === 12) {
|
|
538
|
+
return concat("(", printType(typ), ")");
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
return printType(typ);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
527
545
|
export function printParameters(printer, parameters) {
|
|
528
546
|
if (length(parameters) === 0) {
|
|
529
547
|
Printer__WriteInline_Z721C83C5(printer, "unit");
|
|
@@ -537,7 +555,7 @@ export function printParameters(printer, parameters) {
|
|
|
537
555
|
if (p.IsOptional) {
|
|
538
556
|
Printer__WriteInline_Z721C83C5(printer, "?");
|
|
539
557
|
}
|
|
540
|
-
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ",
|
|
558
|
+
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ", printParameterType(p.Type)));
|
|
541
559
|
if (hasParamArrayAttribute(p.Attributes)) {
|
|
542
560
|
Printer__WriteInline_Z721C83C5(printer, " []");
|
|
543
561
|
}
|
|
@@ -565,6 +583,10 @@ function printInterface(printer, interfaceInfo) {
|
|
|
565
583
|
printXmlDoc(printer, propertyInfo.XmlDoc);
|
|
566
584
|
printAttributes(printer, propertyInfo.Attributes);
|
|
567
585
|
if (propertyInfo.IsStatic) {
|
|
586
|
+
if (propertyInfo.Body.tag === 1) {
|
|
587
|
+
Printer__Write_Z721C83C5(printer, concat("[<Emit(\"\"\"", ((((((("import { " + interfaceInfo.OriginalName) + " } from \"") + Printer__get_ImportSpecifier(printer)) + "\";\n") + interfaceInfo.OriginalName) + ".") + propertyInfo.OriginalName) + "{{=$0}}", "\"\"\")>]"));
|
|
588
|
+
Printer__get_NewLine(printer);
|
|
589
|
+
}
|
|
568
590
|
Printer__Write_Z721C83C5(printer, "static member inline ");
|
|
569
591
|
FSharpAccessibility_printInline(printer, propertyInfo.Accessibility);
|
|
570
592
|
Printer__WriteInline_Z721C83C5(printer, propertyInfo.Name);
|
|
@@ -573,14 +595,7 @@ function printInterface(printer, interfaceInfo) {
|
|
|
573
595
|
Printer__Write_Z721C83C5(printer, concat("with get () : ", printType(propertyInfo.Type), " ="));
|
|
574
596
|
Printer__get_NewLine(printer);
|
|
575
597
|
Printer__get_Indent(printer);
|
|
576
|
-
|
|
577
|
-
Printer__Write_Z721C83C5(printer, `emitJsExpr () $$"""
|
|
578
|
-
import { ${interfaceInfo.OriginalName} } from "${Printer__get_ImportSpecifier(printer)}";
|
|
579
|
-
${interfaceInfo.OriginalName}.${propertyInfo.OriginalName}"""`);
|
|
580
|
-
}
|
|
581
|
-
else {
|
|
582
|
-
Printer__Write_Z721C83C5(printer, "nativeOnly");
|
|
583
|
-
}
|
|
598
|
+
Printer__Write_Z721C83C5(printer, "nativeOnly");
|
|
584
599
|
Printer__get_Unindent(printer);
|
|
585
600
|
Printer__get_Unindent(printer);
|
|
586
601
|
};
|
|
@@ -595,20 +610,13 @@ ${interfaceInfo.OriginalName}.${propertyInfo.OriginalName}"""`);
|
|
|
595
610
|
Printer__WriteInline_Z721C83C5(printer, concat("set (value: ", printType(propertyInfo.Type), ") ="));
|
|
596
611
|
Printer__get_NewLine(printer);
|
|
597
612
|
Printer__get_Indent(printer);
|
|
598
|
-
|
|
599
|
-
Printer__Write_Z721C83C5(printer, `emitJsExpr (value) $$"""
|
|
600
|
-
import { ${interfaceInfo.OriginalName} } from "${Printer__get_ImportSpecifier(printer)}";
|
|
601
|
-
${interfaceInfo.OriginalName}.${propertyInfo.OriginalName} = $0"""`);
|
|
602
|
-
}
|
|
603
|
-
else {
|
|
604
|
-
Printer__Write_Z721C83C5(printer, "nativeOnly");
|
|
605
|
-
}
|
|
613
|
+
Printer__Write_Z721C83C5(printer, "nativeOnly");
|
|
606
614
|
Printer__get_Unindent(printer);
|
|
607
615
|
Printer__get_Unindent(printer);
|
|
608
616
|
};
|
|
609
|
-
const
|
|
610
|
-
if (
|
|
611
|
-
const accessor =
|
|
617
|
+
const matchValue_1 = propertyInfo.Accessor;
|
|
618
|
+
if (matchValue_1 != null) {
|
|
619
|
+
const accessor = matchValue_1;
|
|
612
620
|
Printer__get_NewLine(printer);
|
|
613
621
|
switch (accessor.tag) {
|
|
614
622
|
case 1: {
|
|
@@ -640,7 +648,7 @@ ${interfaceInfo.OriginalName}.${propertyInfo.OriginalName} = $0"""`);
|
|
|
640
648
|
Printer__WriteInline_Z721C83C5(printer, " -> ");
|
|
641
649
|
}
|
|
642
650
|
const option = p_1.IsOptional ? " option" : "";
|
|
643
|
-
Printer__WriteInline_Z721C83C5(printer, concat(p_1.Name, ": ",
|
|
651
|
+
Printer__WriteInline_Z721C83C5(printer, concat(p_1.Name, ": ", printParameterType(p_1.Type), option));
|
|
644
652
|
}, propertyInfo.Parameters);
|
|
645
653
|
if (length(propertyInfo.Parameters) > 0) {
|
|
646
654
|
Printer__WriteInline_Z721C83C5(printer, " -> ");
|
|
@@ -666,47 +674,37 @@ ${interfaceInfo.OriginalName}.${propertyInfo.OriginalName} = $0"""`);
|
|
|
666
674
|
const staticMemberInfo = _arg.fields[0];
|
|
667
675
|
printXmlDoc(printer, staticMemberInfo.XmlDoc);
|
|
668
676
|
printCompactAttributesAndNewLine(printer, staticMemberInfo.Attributes);
|
|
677
|
+
const macroArguments = join(", ", mapIndexed((index_2, _arg_2) => (`$${index_2}`), staticMemberInfo.Parameters));
|
|
678
|
+
Printer__Write_Z721C83C5(printer, `[<Emit("""import { ${interfaceInfo.OriginalName} } from "${Printer__get_ImportSpecifier(printer)}";
|
|
679
|
+
${interfaceInfo.OriginalName}.${staticMemberInfo.OriginalName}(${macroArguments})""")>]`);
|
|
680
|
+
Printer__get_NewLine(printer);
|
|
669
681
|
Printer__Write_Z721C83C5(printer, concat("static member inline ", staticMemberInfo.Name, " "));
|
|
670
682
|
printTypeParametersDeclaration(printer, staticMemberInfo.TypeParameters);
|
|
671
683
|
if (isEmpty(staticMemberInfo.Parameters)) {
|
|
672
684
|
Printer__WriteInline_Z721C83C5(printer, "() : ");
|
|
673
685
|
Printer__WriteInline_Z721C83C5(printer, printType(staticMemberInfo.Type));
|
|
674
|
-
Printer__WriteInline_Z721C83C5(printer, " =");
|
|
675
|
-
Printer__get_Indent(printer);
|
|
676
|
-
Printer__get_NewLine(printer);
|
|
677
|
-
Printer__Write_Z721C83C5(printer, `emitJsExpr () $$"""
|
|
678
|
-
import { ${interfaceInfo.OriginalName} } from "${Printer__get_ImportSpecifier(printer)}";
|
|
679
|
-
${interfaceInfo.OriginalName}.${staticMemberInfo.OriginalName}()"""`);
|
|
686
|
+
Printer__WriteInline_Z721C83C5(printer, " = nativeOnly");
|
|
680
687
|
Printer__get_NewLine(printer);
|
|
681
|
-
Printer__get_Unindent(printer);
|
|
682
688
|
}
|
|
683
689
|
else {
|
|
684
690
|
Printer__WriteInline_Z721C83C5(printer, "(");
|
|
685
|
-
iterateIndexed((
|
|
686
|
-
if (
|
|
691
|
+
iterateIndexed((index_3, p_2) => {
|
|
692
|
+
if (index_3 !== 0) {
|
|
687
693
|
Printer__WriteInline_Z721C83C5(printer, ", ");
|
|
688
694
|
}
|
|
689
695
|
printInlineAttributes(printer, p_2.Attributes);
|
|
690
696
|
if (p_2.IsOptional) {
|
|
691
697
|
Printer__WriteInline_Z721C83C5(printer, "?");
|
|
692
698
|
}
|
|
693
|
-
Printer__WriteInline_Z721C83C5(printer, concat(p_2.Name, ": ",
|
|
699
|
+
Printer__WriteInline_Z721C83C5(printer, concat(p_2.Name, ": ", printParameterType(p_2.Type)));
|
|
694
700
|
if (hasParamArrayAttribute(p_2.Attributes)) {
|
|
695
701
|
Printer__WriteInline_Z721C83C5(printer, " []");
|
|
696
702
|
}
|
|
697
703
|
}, staticMemberInfo.Parameters);
|
|
698
704
|
Printer__WriteInline_Z721C83C5(printer, "): ");
|
|
699
705
|
Printer__WriteInline_Z721C83C5(printer, printType(staticMemberInfo.Type));
|
|
700
|
-
Printer__WriteInline_Z721C83C5(printer, " =");
|
|
701
|
-
Printer__get_NewLine(printer);
|
|
702
|
-
Printer__get_Indent(printer);
|
|
703
|
-
const forwardedArgments = join(", ", map((p_3) => p_3.Name, staticMemberInfo.Parameters));
|
|
704
|
-
const macroArguments = join(", ", mapIndexed((index_3, _arg_2) => (`$${index_3}`), staticMemberInfo.Parameters));
|
|
705
|
-
Printer__Write_Z721C83C5(printer, `emitJsExpr (${forwardedArgments}) $$"""
|
|
706
|
-
import { ${interfaceInfo.OriginalName} } from "${Printer__get_ImportSpecifier(printer)}";
|
|
707
|
-
${interfaceInfo.OriginalName}.${staticMemberInfo.OriginalName}(${macroArguments})"""`);
|
|
706
|
+
Printer__WriteInline_Z721C83C5(printer, " = nativeOnly");
|
|
708
707
|
Printer__get_NewLine(printer);
|
|
709
|
-
Printer__get_Unindent(printer);
|
|
710
708
|
}
|
|
711
709
|
break;
|
|
712
710
|
}
|
|
@@ -737,7 +735,7 @@ ${interfaceInfo.OriginalName}.${staticMemberInfo.OriginalName}(${macroArguments}
|
|
|
737
735
|
if (p.IsOptional) {
|
|
738
736
|
Printer__WriteInline_Z721C83C5(printer, "?");
|
|
739
737
|
}
|
|
740
|
-
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ",
|
|
738
|
+
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ", printParameterType(p.Type)));
|
|
741
739
|
if (hasParamArrayAttribute(p.Attributes)) {
|
|
742
740
|
Printer__WriteInline_Z721C83C5(printer, " []");
|
|
743
741
|
}
|
|
@@ -791,7 +789,7 @@ function printPrimaryConstructor(printer, constructor) {
|
|
|
791
789
|
else {
|
|
792
790
|
Printer__Write_Z721C83C5(printer, "");
|
|
793
791
|
}
|
|
794
|
-
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ",
|
|
792
|
+
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ", printParameterType(p.Type)));
|
|
795
793
|
if (hasParamArrayAttribute(p.Attributes)) {
|
|
796
794
|
Printer__WriteInline_Z721C83C5(printer, " []");
|
|
797
795
|
}
|
|
@@ -824,7 +822,7 @@ function printClass(printer, classInfo) {
|
|
|
824
822
|
if (p.IsOptional) {
|
|
825
823
|
Printer__WriteInline_Z721C83C5(printer, "?");
|
|
826
824
|
}
|
|
827
|
-
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ",
|
|
825
|
+
Printer__WriteInline_Z721C83C5(printer, concat(p.Name, ": ", printParameterType(p.Type)));
|
|
828
826
|
if (hasParamArrayAttribute(p.Attributes)) {
|
|
829
827
|
Printer__WriteInline_Z721C83C5(printer, " []");
|
|
830
828
|
}
|
|
@@ -1030,6 +1028,37 @@ function print(printer_mut, fsharpTypes_mut) {
|
|
|
1030
1028
|
printDelegate(printer, fsharpType.fields[0]);
|
|
1031
1029
|
break;
|
|
1032
1030
|
}
|
|
1031
|
+
case 21: {
|
|
1032
|
+
const extensionInfo = fsharpType.fields[0];
|
|
1033
|
+
printAttributes(printer, singleton(FSharpAttribute.AutoOpen));
|
|
1034
|
+
Printer__Write_Z721C83C5(printer, concat("module ", extensionInfo.ModuleName, " ="));
|
|
1035
|
+
Printer__get_NewLine(printer);
|
|
1036
|
+
Printer__get_Indent(printer);
|
|
1037
|
+
Printer__get_NewLine(printer);
|
|
1038
|
+
Printer__Write_Z721C83C5(printer, concat("type ", printTypeNameWithTypeParameters(extensionInfo.TargetName, extensionInfo.TypeParameters), " with"));
|
|
1039
|
+
Printer__get_NewLine(printer);
|
|
1040
|
+
Printer__get_Indent(printer);
|
|
1041
|
+
const enumerator_1 = getEnumerator(extensionInfo.Members);
|
|
1042
|
+
try {
|
|
1043
|
+
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1044
|
+
const extensionMember = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1045
|
+
const parameters = join(", ", map((parameter) => concat(parameter.Name, ": ", printParameterType(parameter.Type)), extensionMember.Parameters));
|
|
1046
|
+
const arguments$ = join(", ", map((_arg_2) => _arg_2.Name, extensionMember.Parameters));
|
|
1047
|
+
Printer__Write_Z721C83C5(printer, `member inline this.${extensionMember.Name}(${parameters}) : ${printType(extensionMember.ReturnType)} =`);
|
|
1048
|
+
Printer__get_NewLine(printer);
|
|
1049
|
+
Printer__get_Indent(printer);
|
|
1050
|
+
Printer__Write_Z721C83C5(printer, `this.${extensionMember.Name}.Invoke(${arguments$})`);
|
|
1051
|
+
Printer__get_NewLine(printer);
|
|
1052
|
+
Printer__get_Unindent(printer);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
finally {
|
|
1056
|
+
disposeSafe(enumerator_1);
|
|
1057
|
+
}
|
|
1058
|
+
Printer__get_Unindent(printer);
|
|
1059
|
+
Printer__get_Unindent(printer);
|
|
1060
|
+
break;
|
|
1061
|
+
}
|
|
1033
1062
|
case 7:
|
|
1034
1063
|
case 8:
|
|
1035
1064
|
case 18:
|
|
@@ -1084,6 +1113,43 @@ function print(printer_mut, fsharpTypes_mut) {
|
|
|
1084
1113
|
Printer__Write_Z721C83C5(printer, `static member inline ${constant.Name}: ${unionInfo.Name} = ${unionInfo.Name}.${constant.Case} ${constant.Value}`);
|
|
1085
1114
|
Printer__get_NewLine(printer);
|
|
1086
1115
|
}, unionInfo.Constants);
|
|
1116
|
+
if (exists((_arg) => {
|
|
1117
|
+
switch (_arg.tag) {
|
|
1118
|
+
case 6:
|
|
1119
|
+
case 7:
|
|
1120
|
+
return true;
|
|
1121
|
+
default:
|
|
1122
|
+
return false;
|
|
1123
|
+
}
|
|
1124
|
+
}, unionInfo.Attributes)) {
|
|
1125
|
+
const returnType = printTypeNameWithTypeParameters(unionInfo.Name, unionInfo.TypeParameters);
|
|
1126
|
+
iterate((caseType) => {
|
|
1127
|
+
const enumerator = getEnumerator(["op_Implicit", "op_ErasedCast"]);
|
|
1128
|
+
try {
|
|
1129
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1130
|
+
const name_2 = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1131
|
+
Printer__get_NewLine(printer);
|
|
1132
|
+
Printer__Write_Z721C83C5(printer, "[<Emit(\"$0\")>]");
|
|
1133
|
+
Printer__get_NewLine(printer);
|
|
1134
|
+
Printer__Write_Z721C83C5(printer, `static member ${name_2}(value: ${caseType}) : ${returnType} = nativeOnly`);
|
|
1135
|
+
Printer__get_NewLine(printer);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
finally {
|
|
1139
|
+
disposeSafe(enumerator);
|
|
1140
|
+
}
|
|
1141
|
+
}, List_distinct(choose((_arg_1) => {
|
|
1142
|
+
if (_arg_1.tag === 2) {
|
|
1143
|
+
return printType(_arg_1.fields[1]);
|
|
1144
|
+
}
|
|
1145
|
+
else {
|
|
1146
|
+
return undefined;
|
|
1147
|
+
}
|
|
1148
|
+
}, unionInfo.Cases), {
|
|
1149
|
+
Equals: (x, y) => (x === y),
|
|
1150
|
+
GetHashCode: (x) => (stringHash(x) | 0),
|
|
1151
|
+
}));
|
|
1152
|
+
}
|
|
1087
1153
|
Printer__get_Unindent(printer);
|
|
1088
1154
|
}
|
|
1089
1155
|
}
|
|
@@ -31,7 +31,7 @@ export function readSourceFile(checker, sourceFile) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function isScript(sourceFile) {
|
|
34
|
-
if (!ts.isExternalModule(sourceFile)) {
|
|
34
|
+
if (!(ts.isExternalModule(sourceFile))) {
|
|
35
35
|
return promotedAmbientModule(sourceFile) == null;
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
@@ -60,7 +60,7 @@ function declarationKey(glueType) {
|
|
|
60
60
|
|
|
61
61
|
function dropShadowedReExports(types) {
|
|
62
62
|
const localKeys = ofSeq_1(choose((glueType) => {
|
|
63
|
-
if (glueType.tag ===
|
|
63
|
+
if (glueType.tag === 32) {
|
|
64
64
|
return undefined;
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
@@ -73,7 +73,7 @@ function dropShadowedReExports(types) {
|
|
|
73
73
|
let modulePath;
|
|
74
74
|
const seen = tupledArg[0];
|
|
75
75
|
const acc = tupledArg[1];
|
|
76
|
-
if (glueType_1.tag ===
|
|
76
|
+
if (glueType_1.tag === 32) {
|
|
77
77
|
const reExport = glueType_1.fields[0];
|
|
78
78
|
const matchValue = declarationKey(reExport.Declaration);
|
|
79
79
|
if (matchValue == null) {
|
|
@@ -133,7 +133,7 @@ function readStatements(reader, sourceFile) {
|
|
|
133
133
|
const matchValue = statement.kind;
|
|
134
134
|
let matchResult;
|
|
135
135
|
switch (matchValue) {
|
|
136
|
-
case
|
|
136
|
+
case 265: {
|
|
137
137
|
if (isMergedInterfaceDeclaration(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), statement)) {
|
|
138
138
|
matchResult = 1;
|
|
139
139
|
}
|
|
@@ -142,7 +142,7 @@ function readStatements(reader, sourceFile) {
|
|
|
142
142
|
}
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
145
|
-
case
|
|
145
|
+
case 268: {
|
|
146
146
|
if ((promoted == null) ? false : (promoted === statement)) {
|
|
147
147
|
matchResult = 2;
|
|
148
148
|
}
|
|
@@ -151,7 +151,7 @@ function readStatements(reader, sourceFile) {
|
|
|
151
151
|
}
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
|
-
case
|
|
154
|
+
case 279: {
|
|
155
155
|
matchResult = 0;
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
@@ -209,7 +209,7 @@ export function readPackages(checker, packageContext, sourceFiles) {
|
|
|
209
209
|
const moduleDeclaration = matchValue_1;
|
|
210
210
|
importSpecifier = removeSurroundingQuotes(moduleDeclaration.name.text);
|
|
211
211
|
}
|
|
212
|
-
const fileModule = (types_2) => (new FSharpChoice$2(/* Choice2Of2 */ 1, [new GlueType(/* FileModule */
|
|
212
|
+
const fileModule = (types_2) => (new FSharpChoice$2(/* Choice2Of2 */ 1, [new GlueType(/* FileModule */ 31, [new GlueFileModule(PackageContext__FileModuleName_Z11793CAF(packageContext, package$_1, fileName), importSpecifier, false, package$_1.HasRuntime, types_2)])]));
|
|
213
213
|
if (fileName === package$_1.EntryFile) {
|
|
214
214
|
return new FSharpChoice$2(/* Choice1Of2 */ 0, [[types_1, isScript(sourceFile_2)]]);
|
|
215
215
|
}
|
|
@@ -277,7 +277,7 @@ export function readPackages(checker, packageContext, sourceFiles) {
|
|
|
277
277
|
}
|
|
278
278
|
}, patternInput_2[1]);
|
|
279
279
|
patternInput_3 = [append(entryTypes_1, append((globals.length === 0) ? empty_1() : singleton(new GlueType(/* ModuleDeclaration */ 11, [new GlueModuleDeclaration(empty_1(), "global", false, false, true, false, ofSeq(globals))])), fileModules_1)), entryIsGlobal];
|
|
280
|
-
return singleton(new GlueType(/* FileModule */
|
|
280
|
+
return singleton(new GlueType(/* FileModule */ 31, [new GlueFileModule(package$_2.ModuleName, package$_2.RuntimeName, patternInput_3[1], package$_2.HasRuntime, patternInput_3[0])]));
|
|
281
281
|
}, packageContext.Packages);
|
|
282
282
|
const Warnings = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
283
283
|
return {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { map, choose, partition } from "../../fable_modules/fable-library-js.5.17.2/List.js";
|
|
3
3
|
import { toList } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
|
|
4
4
|
import { GlueType, GlueClassDeclaration, GlueConstructor } from "../GlueAST.js";
|
|
5
|
-
import { isExportAssignmentTarget, isExportedDeclaration, readHeritageClauses, getFullNameOrEmpty,
|
|
5
|
+
import { isExportAssignmentTarget, isExportedDeclaration, readHeritageClauses, getFullNameOrEmpty, ModifierUtil_HasModifier_742AC9D } from "./Utils.js";
|
|
6
6
|
import { singleton } from "../../fable_modules/fable-library-js.5.17.2/Set.js";
|
|
7
7
|
import { comparePrimitives } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
8
8
|
|
|
9
9
|
export function readClassDeclaration(reader, classDeclaration) {
|
|
10
10
|
const name = classDeclaration.name;
|
|
11
11
|
const patternInput = partition((m) => {
|
|
12
|
-
if (m.kind ===
|
|
12
|
+
if (m.kind === 177) {
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
@@ -17,23 +17,23 @@ export function readClassDeclaration(reader, classDeclaration) {
|
|
|
17
17
|
}
|
|
18
18
|
}, toList(classDeclaration.members));
|
|
19
19
|
const constructors_1 = choose((m_1) => {
|
|
20
|
-
if (m_1.kind ===
|
|
20
|
+
if (m_1.kind === 177) {
|
|
21
21
|
const constructor = m_1;
|
|
22
|
-
return new GlueConstructor(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromSignature61B89E55"](constructor), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.
|
|
22
|
+
return new GlueConstructor(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromSignature61B89E55"](constructor), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParameters716C1F42"](constructor.parameters));
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
27
27
|
}, patternInput[0]);
|
|
28
28
|
const members_2 = map((declaration) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration), toList(patternInput[1]));
|
|
29
|
-
const isDefaultExport =
|
|
30
|
-
const classDeclaration_1 = new GlueType(/* ClassDeclaration */ 12, [new GlueClassDeclaration(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](classDeclaration), getFullNameOrEmpty(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), classDeclaration), name.getText(), constructors_1, members_2, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.
|
|
29
|
+
const isDefaultExport = ModifierUtil_HasModifier_742AC9D(classDeclaration.modifiers, 90);
|
|
30
|
+
const classDeclaration_1 = new GlueType(/* ClassDeclaration */ 12, [new GlueClassDeclaration(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](classDeclaration), getFullNameOrEmpty(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), classDeclaration), name.getText(), constructors_1, members_2, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4BD418D9"](classDeclaration.typeParameters), readHeritageClauses(reader, classDeclaration.heritageClauses), (isDefaultExport ? true : isExportedDeclaration(classDeclaration, singleton(name.getText(), {
|
|
31
31
|
Compare: (x, y) => (comparePrimitives(x, y) | 0),
|
|
32
32
|
}))) ? true : isExportAssignmentTarget(classDeclaration, singleton(name.getText(), {
|
|
33
33
|
Compare: (x_1, y_1) => (comparePrimitives(x_1, y_1) | 0),
|
|
34
34
|
})))]);
|
|
35
35
|
if (isDefaultExport) {
|
|
36
|
-
return new GlueType(/* ExportDefault */
|
|
36
|
+
return new GlueType(/* ExportDefault */ 25, [classDeclaration_1]);
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
39
|
return classDeclaration_1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { Operators_IsNull } from "../../fable_modules/fable-library-js.5.17.2/FSharp.Core.js";
|
|
3
3
|
import { Exception, defaultOf } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
4
|
-
import { resolveAlias, readMemberTypeParameters,
|
|
4
|
+
import { resolveAlias, readMemberTypeParameters, ModifierUtil_GetAccessor_2944DA29, identifierText, ModifierUtil_HasModifier_742AC9D, ModifierUtil_GetAccessor_Z1CCFC6BA } from "./Utils.js";
|
|
5
5
|
import { GlueAccessor, GlueType, GluePrimitive, GlueIndexSignature, GlueConstructSignature, GlueCallSignature, GlueSetAccessor, GlueGetAccessor, GlueMethod, GlueMethodSignature, GlueMember, GlueProperty } from "../GlueAST.js";
|
|
6
6
|
import { defaultArg } from "../../fable_modules/fable-library-js.5.17.2/Option.js";
|
|
7
7
|
import { exists } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
|
|
@@ -19,55 +19,55 @@ export function readDeclaration(reader, declaration) {
|
|
|
19
19
|
let name_1, matchValue_1, Name_1, Documentation_2, Type_1, IsOptional_1, Documentation_1, option_1, matchValue_2, matchValue_5, typeNode, declarations, target_2, matchValue_4;
|
|
20
20
|
const matchValue = declaration.kind;
|
|
21
21
|
switch (matchValue) {
|
|
22
|
-
case
|
|
22
|
+
case 172: {
|
|
23
23
|
const propertySignature = declaration;
|
|
24
24
|
const name = propertySignature.name;
|
|
25
|
-
return new GlueMember(/* Property */ 1, [new GlueProperty((name_1 = propertySignature.name, !Operators_IsNull(name_1.text) ? name_1.text : ((name_1.pos < 0) ? ((matchValue_1 = name_1.escapedText, (matchValue_1 === defaultOf()) ? "computed" : matchValue_1)) : (name_1.getText()))), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](propertySignature.type), false, propertySignature.questionToken != null,
|
|
25
|
+
return new GlueMember(/* Property */ 1, [new GlueProperty((name_1 = propertySignature.name, !Operators_IsNull(name_1.text) ? name_1.text : ((name_1.pos < 0) ? ((matchValue_1 = name_1.escapedText, (matchValue_1 === defaultOf()) ? "computed" : matchValue_1)) : (name_1.getText()))), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](propertySignature.type), false, propertySignature.questionToken != null, ModifierUtil_GetAccessor_Z1CCFC6BA(propertySignature.modifiers), false)]);
|
|
26
26
|
}
|
|
27
|
-
case
|
|
27
|
+
case 173: {
|
|
28
28
|
const propertyDeclaration = declaration;
|
|
29
29
|
const name_4 = propertyDeclaration.name;
|
|
30
|
-
const hasPrivateModifier =
|
|
30
|
+
const hasPrivateModifier = ModifierUtil_HasModifier_742AC9D(propertyDeclaration.modifiers, 123);
|
|
31
31
|
const isPrivateIdentifier = name_4.kind === 81;
|
|
32
|
-
return new GlueMember(/* Property */ 1, [(Name_1 = identifierText(name_4), (Documentation_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_4), (Type_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](propertyDeclaration.type), (IsOptional_1 = (propertyDeclaration.questionToken != null), new GlueProperty(Name_1, Documentation_2, Type_1,
|
|
32
|
+
return new GlueMember(/* Property */ 1, [(Name_1 = identifierText(name_4), (Documentation_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_4), (Type_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](propertyDeclaration.type), (IsOptional_1 = (propertyDeclaration.questionToken != null), new GlueProperty(Name_1, Documentation_2, Type_1, ModifierUtil_HasModifier_742AC9D(propertyDeclaration.modifiers, 126), IsOptional_1, ModifierUtil_GetAccessor_2944DA29(propertyDeclaration.modifiers), hasPrivateModifier ? true : isPrivateIdentifier)))))]);
|
|
33
33
|
}
|
|
34
|
-
case
|
|
34
|
+
case 174: {
|
|
35
35
|
const methodSignature = declaration;
|
|
36
36
|
const name_3 = methodSignature.name;
|
|
37
|
-
return new GlueMember(/* MethodSignature */ 6, [(Documentation_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_3), new GlueMethodSignature(identifierText(name_3), Documentation_1, readMemberTypeParameters(reader, methodSignature.typeParameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.
|
|
37
|
+
return new GlueMember(/* MethodSignature */ 6, [(Documentation_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_3), new GlueMethodSignature(identifierText(name_3), Documentation_1, readMemberTypeParameters(reader, methodSignature.typeParameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParameters716C1F42"](methodSignature.parameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](methodSignature.type)))]);
|
|
38
38
|
}
|
|
39
|
-
case
|
|
39
|
+
case 175: {
|
|
40
40
|
const methodDeclaration = declaration;
|
|
41
41
|
const name_2 = methodDeclaration.name;
|
|
42
|
-
return new GlueMember(/* Method */ 0, [new GlueMethod(identifierText(name_2), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_2), readMemberTypeParameters(reader, methodDeclaration.typeParameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.
|
|
42
|
+
return new GlueMember(/* Method */ 0, [new GlueMethod(identifierText(name_2), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_2), readMemberTypeParameters(reader, methodDeclaration.typeParameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParameters716C1F42"](methodDeclaration.parameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](methodDeclaration.type), methodDeclaration.questionToken != null, defaultArg((option_1 = methodDeclaration.modifiers, (option_1 != null) ? exists((modifier) => (modifier.kind === 126), option_1) : undefined), false))]);
|
|
43
43
|
}
|
|
44
|
-
case
|
|
44
|
+
case 178: {
|
|
45
45
|
const getAccessorDeclaration = declaration;
|
|
46
46
|
const name_5 = getAccessorDeclaration.name;
|
|
47
|
-
const hasPrivateModifier_1 =
|
|
47
|
+
const hasPrivateModifier_1 = ModifierUtil_HasModifier_742AC9D(getAccessorDeclaration.modifiers, 123);
|
|
48
48
|
const isPrivateIdentifier_1 = name_5.kind === 81;
|
|
49
|
-
return new GlueMember(/* GetAccessor */ 2, [new GlueGetAccessor(identifierText(name_5), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_5), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](getAccessorDeclaration.type),
|
|
49
|
+
return new GlueMember(/* GetAccessor */ 2, [new GlueGetAccessor(identifierText(name_5), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_5), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](getAccessorDeclaration.type), ModifierUtil_HasModifier_742AC9D(getAccessorDeclaration.modifiers, 126), hasPrivateModifier_1 ? true : isPrivateIdentifier_1)]);
|
|
50
50
|
}
|
|
51
|
-
case
|
|
51
|
+
case 179: {
|
|
52
52
|
const setAccessorDeclaration = declaration;
|
|
53
53
|
const name_6 = setAccessorDeclaration.name;
|
|
54
|
-
const hasPrivateModifier_2 =
|
|
54
|
+
const hasPrivateModifier_2 = ModifierUtil_HasModifier_742AC9D(setAccessorDeclaration.modifiers, 123);
|
|
55
55
|
const isPrivateIdentifier_2 = name_6.kind === 81;
|
|
56
|
-
return new GlueMember(/* SetAccessor */ 3, [new GlueSetAccessor(identifierText(name_6), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_6), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](
|
|
56
|
+
return new GlueMember(/* SetAccessor */ 3, [new GlueSetAccessor(identifierText(name_6), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_6), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"]((setAccessorDeclaration.parameters[0]).type), ModifierUtil_HasModifier_742AC9D(setAccessorDeclaration.modifiers, 126), hasPrivateModifier_2 ? true : isPrivateIdentifier_2)]);
|
|
57
57
|
}
|
|
58
|
-
case
|
|
58
|
+
case 180: {
|
|
59
59
|
const callSignature = declaration;
|
|
60
|
-
return new GlueMember(/* CallSignature */ 4, [new GlueCallSignature(readMemberTypeParameters(reader, callSignature.typeParameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.
|
|
60
|
+
return new GlueMember(/* CallSignature */ 4, [new GlueCallSignature(readMemberTypeParameters(reader, callSignature.typeParameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParameters716C1F42"](callSignature.parameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](callSignature.type))]);
|
|
61
61
|
}
|
|
62
|
-
case
|
|
62
|
+
case 181: {
|
|
63
63
|
const constructSignature = declaration;
|
|
64
|
-
return new GlueMember(/* ConstructSignature */ 7, [new GlueConstructSignature(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.
|
|
64
|
+
return new GlueMember(/* ConstructSignature */ 7, [new GlueConstructSignature(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParameters716C1F42"](constructSignature.parameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](constructSignature.type))]);
|
|
65
65
|
}
|
|
66
|
-
case
|
|
66
|
+
case 182: {
|
|
67
67
|
const indexSignature = declaration;
|
|
68
|
-
return new GlueMember(/* IndexSignature */ 5, [new GlueIndexSignature(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.
|
|
68
|
+
return new GlueMember(/* IndexSignature */ 5, [new GlueIndexSignature(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParameters716C1F42"](indexSignature.parameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](indexSignature.type), (matchValue_2 = indexSignature.modifiers, (matchValue_2 == null) ? false : exists((modifier_1) => (modifier_1.kind === 148), matchValue_2)))]);
|
|
69
69
|
}
|
|
70
|
-
case
|
|
70
|
+
case 261: {
|
|
71
71
|
const variableDeclaration = declaration;
|
|
72
72
|
const name_7 = variableDeclaration.name;
|
|
73
73
|
let isConst;
|
|
@@ -75,7 +75,7 @@ export function readDeclaration(reader, declaration) {
|
|
|
75
75
|
isConst = (!Operators_IsNull(parent) && ((parent.flags & 2) !== 0));
|
|
76
76
|
return new GlueMember(/* Property */ 1, [new GlueProperty(identifierText(name_7), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](name_7), (matchValue_5 = variableDeclaration.type, (matchValue_5 == null) ? (new GlueType(/* Primitive */ 3, [GluePrimitive.Any])) : ((typeNode = matchValue_5, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode)))), false, false, isConst ? GlueAccessor.ReadOnly : GlueAccessor.ReadWrite, false)]);
|
|
77
77
|
}
|
|
78
|
-
case
|
|
78
|
+
case 263: {
|
|
79
79
|
const functionDeclaration = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadFunctionDeclarationZ72EBD329"](declaration);
|
|
80
80
|
if (functionDeclaration.tag === 6) {
|
|
81
81
|
const info = functionDeclaration.fields[0];
|
|
@@ -85,7 +85,7 @@ export function readDeclaration(reader, declaration) {
|
|
|
85
85
|
throw new Exception("Expected a function declaration");
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
case
|
|
88
|
+
case 282: {
|
|
89
89
|
const exportSpecifier = declaration;
|
|
90
90
|
let target_1;
|
|
91
91
|
let option_6;
|
|
@@ -125,7 +125,7 @@ export function readDeclaration(reader, declaration) {
|
|
|
125
125
|
}
|
|
126
126
|
let matchResult_1, target_3;
|
|
127
127
|
if (target_1 != null) {
|
|
128
|
-
if ((target_2 = target_1, (matchValue_4 = target_2.kind, (matchValue_4 ===
|
|
128
|
+
if ((target_2 = target_1, (matchValue_4 = target_2.kind, (matchValue_4 === 172) ? true : ((matchValue_4 === 173) ? true : ((matchValue_4 === 174) ? true : ((matchValue_4 === 175) ? true : ((matchValue_4 === 261) ? true : (matchValue_4 === 263)))))))) {
|
|
129
129
|
matchResult_1 = 0;
|
|
130
130
|
target_3 = target_1;
|
|
131
131
|
}
|