@glutinum/cli 0.14.1 → 1.0.0-beta.1
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 +15 -7
- package/dist/Glutinum.Converter/GlueAST.js +45 -36
- package/dist/Glutinum.Converter/Hosting.js +918 -0
- package/dist/Glutinum.Converter/Merge.js +218 -82
- package/dist/Glutinum.Converter/Packages.js +44 -8
- package/dist/Glutinum.Converter/Printer.js +77 -49
- 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 +2057 -700
- 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 +38 -26
- package/package.json +2 -2
- 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
|
@@ -236,7 +236,7 @@ export class FSharpAttribute extends Union {
|
|
|
236
236
|
this.fields = fields;
|
|
237
237
|
}
|
|
238
238
|
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"];
|
|
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", "AutoOpen"];
|
|
240
240
|
}
|
|
241
241
|
static EmitSelfInvoke = new FSharpAttribute(1, []);
|
|
242
242
|
static EmitSelf = new FSharpAttribute(2, []);
|
|
@@ -249,10 +249,11 @@ export class FSharpAttribute extends Union {
|
|
|
249
249
|
static ParamObject = new FSharpAttribute(22, []);
|
|
250
250
|
static ParamArray = new FSharpAttribute(23, []);
|
|
251
251
|
static Interface = new FSharpAttribute(24, []);
|
|
252
|
+
static AutoOpen = new FSharpAttribute(25, []);
|
|
252
253
|
}
|
|
253
254
|
|
|
254
255
|
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)]], [], [], []]);
|
|
256
|
+
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
257
|
}
|
|
257
258
|
|
|
258
259
|
export class FSharpParameter extends Record {
|
|
@@ -566,6 +567,39 @@ export function FSharpDelegate_$reflection() {
|
|
|
566
567
|
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
568
|
}
|
|
568
569
|
|
|
570
|
+
/**
|
|
571
|
+
* Calls the delegate typed property of the same name, F# 9 resolves the member and the property
|
|
572
|
+
*/
|
|
573
|
+
export class FSharpDelegateExtension extends Record {
|
|
574
|
+
constructor(Name, Parameters, ReturnType) {
|
|
575
|
+
super();
|
|
576
|
+
this.Name = Name;
|
|
577
|
+
this.Parameters = Parameters;
|
|
578
|
+
this.ReturnType = ReturnType;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export function FSharpDelegateExtension_$reflection() {
|
|
583
|
+
return record_type("Glutinum.Converter.FSharpAST.FSharpDelegateExtension", [], FSharpDelegateExtension, () => [["Name", string_type], ["Parameters", list_type(FSharpParameter_$reflection())], ["ReturnType", FSharpType_$reflection()]]);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* `type Foo with` in an `[<AutoOpen>]` module, visible wherever `Foo` is
|
|
588
|
+
*/
|
|
589
|
+
export class FSharpTypeExtension extends Record {
|
|
590
|
+
constructor(ModuleName, TargetName, TypeParameters, Members) {
|
|
591
|
+
super();
|
|
592
|
+
this.ModuleName = ModuleName;
|
|
593
|
+
this.TargetName = TargetName;
|
|
594
|
+
this.TypeParameters = TypeParameters;
|
|
595
|
+
this.Members = Members;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
export function FSharpTypeExtension_$reflection() {
|
|
600
|
+
return record_type("Glutinum.Converter.FSharpAST.FSharpTypeExtension", [], FSharpTypeExtension, () => [["ModuleName", string_type], ["TargetName", string_type], ["TypeParameters", list_type(FSharpTypeParameter_$reflection())], ["Members", list_type(FSharpDelegateExtension_$reflection())]]);
|
|
601
|
+
}
|
|
602
|
+
|
|
569
603
|
export class FSharpType extends Union {
|
|
570
604
|
constructor(tag, fields) {
|
|
571
605
|
super();
|
|
@@ -573,14 +607,14 @@ export class FSharpType extends Union {
|
|
|
573
607
|
this.fields = fields;
|
|
574
608
|
}
|
|
575
609
|
cases() {
|
|
576
|
-
return ["Enum", "Union", "SingleErasedCaseUnion", "Option", "Module", "Interface", "Unsupported", "Mapped", "Primitive", "TypeAlias", "Discard", "TypeReference", "Tuple", "TypeParameter", "ResizeArray", "ThisType", "Function", "Class", "Object", "JSApi", "Delegate"];
|
|
610
|
+
return ["Enum", "Union", "SingleErasedCaseUnion", "Option", "Module", "Interface", "Unsupported", "Mapped", "Primitive", "TypeAlias", "Discard", "TypeReference", "Tuple", "TypeParameter", "ResizeArray", "ThisType", "Function", "Class", "Object", "JSApi", "Delegate", "TypeExtension"];
|
|
577
611
|
}
|
|
578
612
|
static Discard = new FSharpType(10, []);
|
|
579
613
|
static Object$ = new FSharpType(18, []);
|
|
580
614
|
}
|
|
581
615
|
|
|
582
616
|
export function FSharpType_$reflection() {
|
|
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()]]]);
|
|
617
|
+
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()]]]);
|
|
584
618
|
}
|
|
585
619
|
|
|
586
620
|
export class FSharpOutFile extends Record {
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
|
|
2
|
-
import
|
|
2
|
+
import { createNodeHost, Bootstrap_createProgramForCLI } from "./Hosting.js";
|
|
3
3
|
import * as fs from "fs";
|
|
4
4
|
import { disposeSafe, getEnumerator, Exception } from "../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
5
5
|
import { concat } from "../fable_modules/fable-library-js.5.17.2/String.js";
|
|
6
6
|
import { toString } from "../fable_modules/fable-library-js.5.17.2/Types.js";
|
|
7
|
-
import {
|
|
7
|
+
import { printFileWith, Printer_$ctor } from "./Printer.js";
|
|
8
8
|
import { readSourceFile } from "./Read.js";
|
|
9
9
|
import { error as error_1, warn } from "./Log.js";
|
|
10
10
|
import { applyWith } from "./Transform.js";
|
|
11
11
|
import { defaultArg } from "../fable_modules/fable-library-js.5.17.2/Option.js";
|
|
12
|
+
import { empty } from "../fable_modules/fable-library-js.5.17.2/List.js";
|
|
12
13
|
import { generateWith, defaultOptions } from "./Packages.js";
|
|
13
|
-
import { createNodeHost } from "../../src/Glutinum.Converter/js/host.js";
|
|
14
|
-
import * as path from "path";
|
|
15
14
|
|
|
16
|
-
export
|
|
15
|
+
export function createProgramForCLI(fileName, source) {
|
|
16
|
+
return Bootstrap_createProgramForCLI(fileName, source);
|
|
17
|
+
}
|
|
17
18
|
|
|
18
19
|
export function generateBindingFile(filePath) {
|
|
20
|
+
return generateBindingFileWith("Glutinum", filePath);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Generate the binding of a single declaration file as the module <c>moduleName</c>
|
|
25
|
+
*/
|
|
26
|
+
export function generateBindingFileWith(moduleName, filePath) {
|
|
19
27
|
if (!fs.existsSync(filePath)) {
|
|
20
28
|
throw new Exception(concat("File does not exist: ", filePath));
|
|
21
29
|
}
|
|
@@ -52,7 +60,7 @@ export function generateBindingFile(filePath) {
|
|
|
52
60
|
finally {
|
|
53
61
|
disposeSafe(enumerator_2);
|
|
54
62
|
}
|
|
55
|
-
|
|
63
|
+
printFileWith(moduleName, false, empty(), printer, transformResult);
|
|
56
64
|
return toString(printer);
|
|
57
65
|
}
|
|
58
66
|
|
|
@@ -95,6 +103,6 @@ export function generatePackages(inputs) {
|
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
export function generatePackagesFromDisk(options, inputs) {
|
|
98
|
-
return generatePackagesWithOptions(options, createNodeHost(
|
|
106
|
+
return generatePackagesWithOptions(options, createNodeHost(process.cwd()), inputs);
|
|
99
107
|
}
|
|
100
108
|
|
|
@@ -240,14 +240,15 @@ export function GlueInterface_$reflection() {
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
export class GlueTypeLiteral extends Record {
|
|
243
|
-
constructor(Members) {
|
|
243
|
+
constructor(Members, Id) {
|
|
244
244
|
super();
|
|
245
245
|
this.Members = Members;
|
|
246
|
+
this.Id = Id;
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
249
|
|
|
249
250
|
export function GlueTypeLiteral_$reflection() {
|
|
250
|
-
return record_type("Glutinum.Converter.GlueAST.GlueTypeLiteral", [], GlueTypeLiteral, () => [["Members", list_type(GlueMember_$reflection())]]);
|
|
251
|
+
return record_type("Glutinum.Converter.GlueAST.GlueTypeLiteral", [], GlueTypeLiteral, () => [["Members", list_type(GlueMember_$reflection())], ["Id", option_type(string_type)]]);
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
export class GlueVariable extends Record {
|
|
@@ -566,29 +567,30 @@ export class GlueType extends Union {
|
|
|
566
567
|
this.fields = fields;
|
|
567
568
|
}
|
|
568
569
|
cases() {
|
|
569
|
-
return ["Discard", "Interface", "Variable", "Primitive", "Enum", "TypeAliasDeclaration", "FunctionDeclaration", "Union", "Literal", "KeyOf", "IndexedAccessType", "ModuleDeclaration", "ClassDeclaration", "TypeReference", "Array", "FunctionType", "TypeParameter", "ThisType", "TupleType", "NamedTupleType", "IntersectionType", "TypeLiteral", "OptionalType", "Unknown", "ExportDefault", "TemplateLiteral", "UtilityType", "MappedType", "ConstructorType", "ReadOnly", "FileModule", "ReExport", "ConditionalType"];
|
|
570
|
+
return ["Discard", "Interface", "Variable", "Primitive", "Enum", "TypeAliasDeclaration", "FunctionDeclaration", "Union", "Literal", "KeyOf", "IndexedAccessType", "ModuleDeclaration", "ClassDeclaration", "TypeReference", "Array", "FunctionType", "TypeParameter", "ThisType", "TupleType", "NamedTupleType", "IntersectionType", "IntersectionOfReferences", "TypeLiteral", "OptionalType", "Unknown", "ExportDefault", "TemplateLiteral", "UtilityType", "MappedType", "ConstructorType", "ReadOnly", "FileModule", "ReExport", "ConditionalType"];
|
|
570
571
|
}
|
|
571
572
|
static Discard = new GlueType(0, []);
|
|
572
|
-
static Unknown = new GlueType(
|
|
573
|
-
static TemplateLiteral = new GlueType(
|
|
573
|
+
static Unknown = new GlueType(24, []);
|
|
574
|
+
static TemplateLiteral = new GlueType(26, []);
|
|
574
575
|
}
|
|
575
576
|
|
|
576
577
|
export function GlueType_$reflection() {
|
|
577
|
-
return union_type("Glutinum.Converter.GlueAST.GlueType", [], GlueType, () => [[], [["Item", GlueInterface_$reflection()]], [["Item", GlueVariable_$reflection()]], [["Item", GluePrimitive_$reflection()]], [["Item", GlueEnum_$reflection()]], [["Item", GlueTypeAliasDeclaration_$reflection()]], [["Item", GlueFunctionDeclaration_$reflection()]], [["Item", GlueTypeUnion_$reflection()]], [["Item", GlueLiteral_$reflection()]], [["Item", GlueType_$reflection()]], [["Item", GlueIndexedAccessType_$reflection()]], [["Item", GlueModuleDeclaration_$reflection()]], [["Item", GlueClassDeclaration_$reflection()]], [["Item", GlueTypeReference_$reflection()]], [["Item", GlueType_$reflection()]], [["Item", GlueFunctionType_$reflection()]], [["Item", string_type]], [["Item", GlueThisType_$reflection()]], [["Item", list_type(GlueType_$reflection())]], [["Item", NamedTupleType_$reflection()]], [["Item", list_type(GlueMember_$reflection())]], [["Item", GlueTypeLiteral_$reflection()]], [["Item", GlueType_$reflection()]], [], [["Item", GlueType_$reflection()]], [], [["Item", GlueUtilityType_$reflection()]], [["Item", GlueMappedType_$reflection()]], [["Item", GlueConstructSignature_$reflection()]], [["Item", GlueType_$reflection()]], [["Item", GlueFileModule_$reflection()]], [["Item", GlueReExport_$reflection()]], [["Item", GlueConditionalType_$reflection()]]]);
|
|
578
|
+
return union_type("Glutinum.Converter.GlueAST.GlueType", [], GlueType, () => [[], [["Item", GlueInterface_$reflection()]], [["Item", GlueVariable_$reflection()]], [["Item", GluePrimitive_$reflection()]], [["Item", GlueEnum_$reflection()]], [["Item", GlueTypeAliasDeclaration_$reflection()]], [["Item", GlueFunctionDeclaration_$reflection()]], [["Item", GlueTypeUnion_$reflection()]], [["Item", GlueLiteral_$reflection()]], [["Item", GlueType_$reflection()]], [["Item", GlueIndexedAccessType_$reflection()]], [["Item", GlueModuleDeclaration_$reflection()]], [["Item", GlueClassDeclaration_$reflection()]], [["Item", GlueTypeReference_$reflection()]], [["Item", GlueType_$reflection()]], [["Item", GlueFunctionType_$reflection()]], [["Item", string_type]], [["Item", GlueThisType_$reflection()]], [["Item", list_type(GlueType_$reflection())]], [["Item", NamedTupleType_$reflection()]], [["Item", list_type(GlueMember_$reflection())]], [["Item", list_type(GlueType_$reflection())]], [["Item", GlueTypeLiteral_$reflection()]], [["Item", GlueType_$reflection()]], [], [["Item", GlueType_$reflection()]], [], [["Item", GlueUtilityType_$reflection()]], [["Item", GlueMappedType_$reflection()]], [["Item", GlueConstructSignature_$reflection()]], [["Item", GlueType_$reflection()]], [["Item", GlueFileModule_$reflection()]], [["Item", GlueReExport_$reflection()]], [["Item", GlueConditionalType_$reflection()]]]);
|
|
578
579
|
}
|
|
579
580
|
|
|
580
581
|
export class GlueFileModule extends Record {
|
|
581
|
-
constructor(Name, ImportSpecifier, IsGlobal, Types) {
|
|
582
|
+
constructor(Name, ImportSpecifier, IsGlobal, HasRuntime, Types) {
|
|
582
583
|
super();
|
|
583
584
|
this.Name = Name;
|
|
584
585
|
this.ImportSpecifier = ImportSpecifier;
|
|
585
586
|
this.IsGlobal = IsGlobal;
|
|
587
|
+
this.HasRuntime = HasRuntime;
|
|
586
588
|
this.Types = Types;
|
|
587
589
|
}
|
|
588
590
|
}
|
|
589
591
|
|
|
590
592
|
export function GlueFileModule_$reflection() {
|
|
591
|
-
return record_type("Glutinum.Converter.GlueAST.GlueFileModule", [], GlueFileModule, () => [["Name", string_type], ["ImportSpecifier", string_type], ["IsGlobal", bool_type], ["Types", list_type(GlueType_$reflection())]]);
|
|
593
|
+
return record_type("Glutinum.Converter.GlueAST.GlueFileModule", [], GlueFileModule, () => [["Name", string_type], ["ImportSpecifier", string_type], ["IsGlobal", bool_type], ["HasRuntime", bool_type], ["Types", list_type(GlueType_$reflection())]]);
|
|
592
594
|
}
|
|
593
595
|
|
|
594
596
|
export class GlueConditionalType extends Record {
|
|
@@ -747,7 +749,7 @@ export function GlueType__get_Name(this$) {
|
|
|
747
749
|
return "string";
|
|
748
750
|
}
|
|
749
751
|
}
|
|
750
|
-
case
|
|
752
|
+
case 26:
|
|
751
753
|
return "string";
|
|
752
754
|
case 4:
|
|
753
755
|
return this$.fields[0].Name;
|
|
@@ -769,7 +771,7 @@ export function GlueType__get_Name(this$) {
|
|
|
769
771
|
return this$.fields[0].Name;
|
|
770
772
|
case 14:
|
|
771
773
|
return concat("ResizeArray<", GlueType__get_Name(this$.fields[0]), ">");
|
|
772
|
-
case
|
|
774
|
+
case 30: {
|
|
773
775
|
const info_11 = this$.fields[0];
|
|
774
776
|
if (info_11.tag === 14) {
|
|
775
777
|
return concat("ReadonlyArray<", GlueType__get_Name(info_11.fields[0]), ">");
|
|
@@ -783,22 +785,23 @@ export function GlueType__get_Name(this$) {
|
|
|
783
785
|
case 7:
|
|
784
786
|
return join(" | ", map(GlueType__get_Name, this$.fields[0].fields[0]));
|
|
785
787
|
case 19:
|
|
786
|
-
case
|
|
788
|
+
case 22:
|
|
787
789
|
case 20:
|
|
790
|
+
case 21:
|
|
788
791
|
case 10:
|
|
789
792
|
case 15:
|
|
790
793
|
case 18:
|
|
791
|
-
case
|
|
794
|
+
case 23:
|
|
792
795
|
case 0:
|
|
796
|
+
case 25:
|
|
797
|
+
case 29:
|
|
798
|
+
case 31:
|
|
799
|
+
case 33:
|
|
793
800
|
case 24:
|
|
794
|
-
case 28:
|
|
795
|
-
case 30:
|
|
796
|
-
case 32:
|
|
797
|
-
case 23:
|
|
798
801
|
return "obj";
|
|
799
|
-
case
|
|
802
|
+
case 32:
|
|
800
803
|
return this$.fields[0].Name;
|
|
801
|
-
case
|
|
804
|
+
case 27: {
|
|
802
805
|
const utilityType = this$.fields[0];
|
|
803
806
|
switch (utilityType.tag) {
|
|
804
807
|
case 2:
|
|
@@ -809,7 +812,7 @@ export function GlueType__get_Name(this$) {
|
|
|
809
812
|
return "obj";
|
|
810
813
|
}
|
|
811
814
|
}
|
|
812
|
-
case
|
|
815
|
+
case 28:
|
|
813
816
|
return "obj";
|
|
814
817
|
default:
|
|
815
818
|
return this$.fields[0].Name;
|
|
@@ -842,19 +845,21 @@ export function GlueType__get_TypeParameters(this$) {
|
|
|
842
845
|
return collect(GlueType__get_TypeParameters, this$.fields[0]);
|
|
843
846
|
case 19:
|
|
844
847
|
return GlueType__get_TypeParameters(this$.fields[0].Type);
|
|
845
|
-
case
|
|
848
|
+
case 23:
|
|
846
849
|
return GlueType__get_TypeParameters(this$.fields[0]);
|
|
847
|
-
case
|
|
850
|
+
case 28:
|
|
848
851
|
return singleton(this$.fields[0].TypeParameter);
|
|
849
|
-
case
|
|
852
|
+
case 30:
|
|
850
853
|
return GlueType__get_TypeParameters(this$.fields[0]);
|
|
851
854
|
case 20:
|
|
852
855
|
return collect(GlueMember__get_TypeParameters, this$.fields[0]);
|
|
853
|
-
case
|
|
856
|
+
case 21:
|
|
857
|
+
return collect(GlueType__get_TypeParameters, this$.fields[0]);
|
|
858
|
+
case 27:
|
|
854
859
|
return GlueUtilityType__get_TypeParameters(this$.fields[0]);
|
|
855
|
-
case 23:
|
|
856
860
|
case 24:
|
|
857
861
|
case 25:
|
|
862
|
+
case 26:
|
|
858
863
|
case 0:
|
|
859
864
|
case 3:
|
|
860
865
|
case 4:
|
|
@@ -862,11 +867,11 @@ export function GlueType__get_TypeParameters(this$) {
|
|
|
862
867
|
case 10:
|
|
863
868
|
case 11:
|
|
864
869
|
case 16:
|
|
865
|
-
case
|
|
866
|
-
case 30:
|
|
870
|
+
case 22:
|
|
867
871
|
case 31:
|
|
868
872
|
case 32:
|
|
869
|
-
case
|
|
873
|
+
case 33:
|
|
874
|
+
case 29:
|
|
870
875
|
return empty();
|
|
871
876
|
default:
|
|
872
877
|
return this$.fields[0].TypeParameters;
|
|
@@ -892,12 +897,12 @@ export function GlueSubstitution_mentionedTypeParameters(glueType_mut) {
|
|
|
892
897
|
glueType_2 = glueType.fields[0];
|
|
893
898
|
break;
|
|
894
899
|
}
|
|
895
|
-
case
|
|
900
|
+
case 30: {
|
|
896
901
|
matchResult = 2;
|
|
897
902
|
glueType_2 = glueType.fields[0];
|
|
898
903
|
break;
|
|
899
904
|
}
|
|
900
|
-
case
|
|
905
|
+
case 23: {
|
|
901
906
|
matchResult = 2;
|
|
902
907
|
glueType_2 = glueType.fields[0];
|
|
903
908
|
break;
|
|
@@ -983,10 +988,10 @@ export function GlueSubstitution_substitute(substitutions, glueType) {
|
|
|
983
988
|
return new GlueType(/* Union */ 7, [new GlueTypeUnion(map(substitute, glueType.fields[0].fields[0]))]);
|
|
984
989
|
case 14:
|
|
985
990
|
return new GlueType(/* Array */ 14, [substitute(glueType.fields[0])]);
|
|
986
|
-
case
|
|
987
|
-
return new GlueType(/* ReadOnly */
|
|
988
|
-
case
|
|
989
|
-
return new GlueType(/* OptionalType */
|
|
991
|
+
case 30:
|
|
992
|
+
return new GlueType(/* ReadOnly */ 30, [substitute(glueType.fields[0])]);
|
|
993
|
+
case 23:
|
|
994
|
+
return new GlueType(/* OptionalType */ 23, [substitute(glueType.fields[0])]);
|
|
990
995
|
case 18:
|
|
991
996
|
return new GlueType(/* TupleType */ 18, [map(substitute, glueType.fields[0])]);
|
|
992
997
|
case 19: {
|
|
@@ -1008,9 +1013,9 @@ export function GlueSubstitution_substitute(substitutions, glueType) {
|
|
|
1008
1013
|
GetHashCode: (x) => (stringHash(x) | 0),
|
|
1009
1014
|
}), functionType.OwnTypeParameterNames, Parameters))]);
|
|
1010
1015
|
}
|
|
1011
|
-
case
|
|
1016
|
+
case 33: {
|
|
1012
1017
|
const conditionalType = glueType.fields[0];
|
|
1013
|
-
return new GlueType(/* ConditionalType */
|
|
1018
|
+
return new GlueType(/* ConditionalType */ 33, [new GlueConditionalType(substitute(conditionalType.CheckType), substitute(conditionalType.ExtendsType), substitute(conditionalType.TrueType), substitute(conditionalType.FalseType))]);
|
|
1014
1019
|
}
|
|
1015
1020
|
case 9:
|
|
1016
1021
|
return new GlueType(/* KeyOf */ 9, [substitute(glueType.fields[0])]);
|
|
@@ -1021,7 +1026,11 @@ export function GlueSubstitution_substitute(substitutions, glueType) {
|
|
|
1021
1026
|
case 20:
|
|
1022
1027
|
return new GlueType(/* IntersectionType */ 20, [map((glueMember) => GlueSubstitution_substituteMember(substitutions, glueMember), glueType.fields[0])]);
|
|
1023
1028
|
case 21:
|
|
1024
|
-
return new GlueType(/*
|
|
1029
|
+
return new GlueType(/* IntersectionOfReferences */ 21, [map(substitute, glueType.fields[0])]);
|
|
1030
|
+
case 22: {
|
|
1031
|
+
const typeLiteral = glueType.fields[0];
|
|
1032
|
+
return new GlueType(/* TypeLiteral */ 22, [new GlueTypeLiteral(map((glueMember_1) => GlueSubstitution_substituteMember(substitutions, glueMember_1), typeLiteral.Members), typeLiteral.Id)]);
|
|
1033
|
+
}
|
|
1025
1034
|
default:
|
|
1026
1035
|
return glueType;
|
|
1027
1036
|
}
|