@glutinum/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +3 -0
  2. package/cli.js +2 -0
  3. package/dist/Glutinum.Converter/FsharpAST.js +371 -0
  4. package/dist/Glutinum.Converter/FsharpAST.js.map +1 -0
  5. package/dist/Glutinum.Converter/Generate.js +28 -0
  6. package/dist/Glutinum.Converter/Generate.js.map +1 -0
  7. package/dist/Glutinum.Converter/GlueAST.js +403 -0
  8. package/dist/Glutinum.Converter/GlueAST.js.map +1 -0
  9. package/dist/Glutinum.Converter/Log.js +24 -0
  10. package/dist/Glutinum.Converter/Log.js.map +1 -0
  11. package/dist/Glutinum.Converter/Printer.js +452 -0
  12. package/dist/Glutinum.Converter/Printer.js.map +1 -0
  13. package/dist/Glutinum.Converter/Read.js +10 -0
  14. package/dist/Glutinum.Converter/Read.js.map +1 -0
  15. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +28 -0
  16. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +1 -0
  17. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +72 -0
  18. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +1 -0
  19. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +11 -0
  20. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +1 -0
  21. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +9 -0
  22. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +1 -0
  23. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +10 -0
  24. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +1 -0
  25. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +23 -0
  26. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +1 -0
  27. package/dist/Glutinum.Converter/Reader/NamedDeclaration.js +34 -0
  28. package/dist/Glutinum.Converter/Reader/NamedDeclaration.js.map +1 -0
  29. package/dist/Glutinum.Converter/Reader/Node.js +28 -0
  30. package/dist/Glutinum.Converter/Reader/Node.js.map +1 -0
  31. package/dist/Glutinum.Converter/Reader/Parameters.js +12 -0
  32. package/dist/Glutinum.Converter/Reader/Parameters.js.map +1 -0
  33. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +28 -0
  34. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +1 -0
  35. package/dist/Glutinum.Converter/Reader/TypeNode.js +126 -0
  36. package/dist/Glutinum.Converter/Reader/TypeNode.js.map +1 -0
  37. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +34 -0
  38. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +1 -0
  39. package/dist/Glutinum.Converter/Reader/TypeParameters.js +14 -0
  40. package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +1 -0
  41. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +95 -0
  42. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +1 -0
  43. package/dist/Glutinum.Converter/Reader/Types.js +16 -0
  44. package/dist/Glutinum.Converter/Reader/Types.js.map +1 -0
  45. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +89 -0
  46. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +1 -0
  47. package/dist/Glutinum.Converter/Reader/Utils.js +79 -0
  48. package/dist/Glutinum.Converter/Reader/Utils.js.map +1 -0
  49. package/dist/Glutinum.Converter/Reader/VariableStatement.js +19 -0
  50. package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +1 -0
  51. package/dist/Glutinum.Converter/Transform.js +538 -0
  52. package/dist/Glutinum.Converter/Transform.js.map +1 -0
  53. package/dist/Glutinum.Converter/TypeScript.js +12 -0
  54. package/dist/Glutinum.Converter/TypeScript.js.map +1 -0
  55. package/dist/Glutinum.Converter/Utils/Keywords.js +9 -0
  56. package/dist/Glutinum.Converter/Utils/Keywords.js.map +1 -0
  57. package/dist/Glutinum.Converter/Utils/Naming.js +25 -0
  58. package/dist/Glutinum.Converter/Utils/Naming.js.map +1 -0
  59. package/dist/Glutinum.Converter/Utils/String.js +23 -0
  60. package/dist/Glutinum.Converter/Utils/String.js.map +1 -0
  61. package/dist/Program.js +12 -0
  62. package/dist/Program.js.map +1 -0
  63. package/dist/fable_modules/fable-library.4.5.0/Array.d.ts +120 -0
  64. package/dist/fable_modules/fable-library.4.5.0/Array.js +1204 -0
  65. package/dist/fable_modules/fable-library.4.5.0/Async.d.ts +32 -0
  66. package/dist/fable_modules/fable-library.4.5.0/Async.js +158 -0
  67. package/dist/fable_modules/fable-library.4.5.0/AsyncBuilder.d.ts +59 -0
  68. package/dist/fable_modules/fable-library.4.5.0/AsyncBuilder.js +183 -0
  69. package/dist/fable_modules/fable-library.4.5.0/BigInt.d.ts +115 -0
  70. package/dist/fable_modules/fable-library.4.5.0/BigInt.js +282 -0
  71. package/dist/fable_modules/fable-library.4.5.0/BitConverter.d.ts +27 -0
  72. package/dist/fable_modules/fable-library.4.5.0/BitConverter.js +138 -0
  73. package/dist/fable_modules/fable-library.4.5.0/Boolean.d.ts +3 -0
  74. package/dist/fable_modules/fable-library.4.5.0/Boolean.js +21 -0
  75. package/dist/fable_modules/fable-library.4.5.0/CHANGELOG.md +11 -0
  76. package/dist/fable_modules/fable-library.4.5.0/Char.d.ts +65 -0
  77. package/dist/fable_modules/fable-library.4.5.0/Char.js +169 -0
  78. package/dist/fable_modules/fable-library.4.5.0/Choice.d.ts +138 -0
  79. package/dist/fable_modules/fable-library.4.5.0/Choice.js +227 -0
  80. package/dist/fable_modules/fable-library.4.5.0/Date.d.ts +70 -0
  81. package/dist/fable_modules/fable-library.4.5.0/Date.js +451 -0
  82. package/dist/fable_modules/fable-library.4.5.0/DateOffset.d.ts +63 -0
  83. package/dist/fable_modules/fable-library.4.5.0/DateOffset.js +268 -0
  84. package/dist/fable_modules/fable-library.4.5.0/DateOnly.d.ts +18 -0
  85. package/dist/fable_modules/fable-library.4.5.0/DateOnly.js +124 -0
  86. package/dist/fable_modules/fable-library.4.5.0/Decimal.d.ts +45 -0
  87. package/dist/fable_modules/fable-library.4.5.0/Decimal.js +212 -0
  88. package/dist/fable_modules/fable-library.4.5.0/Double.d.ts +11 -0
  89. package/dist/fable_modules/fable-library.4.5.0/Double.js +46 -0
  90. package/dist/fable_modules/fable-library.4.5.0/Encoding.d.ts +12 -0
  91. package/dist/fable_modules/fable-library.4.5.0/Encoding.js +173 -0
  92. package/dist/fable_modules/fable-library.4.5.0/Event.d.ts +31 -0
  93. package/dist/fable_modules/fable-library.4.5.0/Event.js +93 -0
  94. package/dist/fable_modules/fable-library.4.5.0/FSharp.Collections.d.ts +7 -0
  95. package/dist/fable_modules/fable-library.4.5.0/FSharp.Collections.js +27 -0
  96. package/dist/fable_modules/fable-library.4.5.0/FSharp.Core.d.ts +17 -0
  97. package/dist/fable_modules/fable-library.4.5.0/FSharp.Core.js +69 -0
  98. package/dist/fable_modules/fable-library.4.5.0/Global.d.ts +24 -0
  99. package/dist/fable_modules/fable-library.4.5.0/Global.js +8 -0
  100. package/dist/fable_modules/fable-library.4.5.0/Guid.d.ts +10 -0
  101. package/dist/fable_modules/fable-library.4.5.0/Guid.js +142 -0
  102. package/dist/fable_modules/fable-library.4.5.0/Int32.d.ts +28 -0
  103. package/dist/fable_modules/fable-library.4.5.0/Int32.js +135 -0
  104. package/dist/fable_modules/fable-library.4.5.0/List.d.ts +143 -0
  105. package/dist/fable_modules/fable-library.4.5.0/List.js +1273 -0
  106. package/dist/fable_modules/fable-library.4.5.0/Long.d.ts +3 -0
  107. package/dist/fable_modules/fable-library.4.5.0/Long.js +46 -0
  108. package/dist/fable_modules/fable-library.4.5.0/MailboxProcessor.d.ts +25 -0
  109. package/dist/fable_modules/fable-library.4.5.0/MailboxProcessor.js +93 -0
  110. package/dist/fable_modules/fable-library.4.5.0/Map.d.ts +178 -0
  111. package/dist/fable_modules/fable-library.4.5.0/Map.js +1396 -0
  112. package/dist/fable_modules/fable-library.4.5.0/MapUtil.d.ts +10 -0
  113. package/dist/fable_modules/fable-library.4.5.0/MapUtil.js +112 -0
  114. package/dist/fable_modules/fable-library.4.5.0/MutableMap.d.ts +52 -0
  115. package/dist/fable_modules/fable-library.4.5.0/MutableMap.js +326 -0
  116. package/dist/fable_modules/fable-library.4.5.0/MutableSet.d.ts +39 -0
  117. package/dist/fable_modules/fable-library.4.5.0/MutableSet.js +232 -0
  118. package/dist/fable_modules/fable-library.4.5.0/Native.d.ts +2 -0
  119. package/dist/fable_modules/fable-library.4.5.0/Native.js +8 -0
  120. package/dist/fable_modules/fable-library.4.5.0/Numeric.d.ts +19 -0
  121. package/dist/fable_modules/fable-library.4.5.0/Numeric.js +71 -0
  122. package/dist/fable_modules/fable-library.4.5.0/Observable.d.ts +32 -0
  123. package/dist/fable_modules/fable-library.4.5.0/Observable.js +113 -0
  124. package/dist/fable_modules/fable-library.4.5.0/Option.d.ts +28 -0
  125. package/dist/fable_modules/fable-library.4.5.0/Option.js +96 -0
  126. package/dist/fable_modules/fable-library.4.5.0/README.md +3 -0
  127. package/dist/fable_modules/fable-library.4.5.0/Random.d.ts +37 -0
  128. package/dist/fable_modules/fable-library.4.5.0/Random.js +170 -0
  129. package/dist/fable_modules/fable-library.4.5.0/Range.d.ts +12 -0
  130. package/dist/fable_modules/fable-library.4.5.0/Range.js +45 -0
  131. package/dist/fable_modules/fable-library.4.5.0/Reflection.d.ts +119 -0
  132. package/dist/fable_modules/fable-library.4.5.0/Reflection.js +461 -0
  133. package/dist/fable_modules/fable-library.4.5.0/RegExp.d.ts +10 -0
  134. package/dist/fable_modules/fable-library.4.5.0/RegExp.js +132 -0
  135. package/dist/fable_modules/fable-library.4.5.0/Seq.d.ts +165 -0
  136. package/dist/fable_modules/fable-library.4.5.0/Seq.js +1379 -0
  137. package/dist/fable_modules/fable-library.4.5.0/Seq2.d.ts +18 -0
  138. package/dist/fable_modules/fable-library.4.5.0/Seq2.js +111 -0
  139. package/dist/fable_modules/fable-library.4.5.0/Set.d.ts +190 -0
  140. package/dist/fable_modules/fable-library.4.5.0/Set.js +1789 -0
  141. package/dist/fable_modules/fable-library.4.5.0/String.d.ts +49 -0
  142. package/dist/fable_modules/fable-library.4.5.0/String.js +540 -0
  143. package/dist/fable_modules/fable-library.4.5.0/System.Collections.Generic.d.ts +71 -0
  144. package/dist/fable_modules/fable-library.4.5.0/System.Collections.Generic.js +307 -0
  145. package/dist/fable_modules/fable-library.4.5.0/System.Text.d.ts +30 -0
  146. package/dist/fable_modules/fable-library.4.5.0/System.Text.js +110 -0
  147. package/dist/fable_modules/fable-library.4.5.0/SystemException.d.ts +5 -0
  148. package/dist/fable_modules/fable-library.4.5.0/SystemException.js +5 -0
  149. package/dist/fable_modules/fable-library.4.5.0/TimeOnly.d.ts +15 -0
  150. package/dist/fable_modules/fable-library.4.5.0/TimeOnly.js +122 -0
  151. package/dist/fable_modules/fable-library.4.5.0/TimeSpan.d.ts +34 -0
  152. package/dist/fable_modules/fable-library.4.5.0/TimeSpan.js +177 -0
  153. package/dist/fable_modules/fable-library.4.5.0/Timer.d.ts +19 -0
  154. package/dist/fable_modules/fable-library.4.5.0/Timer.js +67 -0
  155. package/dist/fable_modules/fable-library.4.5.0/Types.d.ts +58 -0
  156. package/dist/fable_modules/fable-library.4.5.0/Types.js +208 -0
  157. package/dist/fable_modules/fable-library.4.5.0/Unicode.13.0.0.d.ts +2 -0
  158. package/dist/fable_modules/fable-library.4.5.0/Unicode.13.0.0.js +4 -0
  159. package/dist/fable_modules/fable-library.4.5.0/Uri.d.ts +29 -0
  160. package/dist/fable_modules/fable-library.4.5.0/Uri.js +142 -0
  161. package/dist/fable_modules/fable-library.4.5.0/Util.d.ts +207 -0
  162. package/dist/fable_modules/fable-library.4.5.0/Util.js +781 -0
  163. package/dist/fable_modules/fable-library.4.5.0/lib/big.d.ts +5 -0
  164. package/dist/fable_modules/fable-library.4.5.0/lib/big.js +826 -0
  165. package/dist/fable_modules/fable-library.4.5.0/package.json +23 -0
  166. package/dist/fable_modules/project_cracked.json +1 -0
  167. package/package.json +37 -0
@@ -0,0 +1,34 @@
1
+ import { GlueIndexSignature, GlueCallSignature, GlueMethod, GlueMember, GlueProperty, GlueAccessor } from "../GlueAST.js";
2
+ import { exists } from "../../fable_modules/fable-library.4.5.0/Seq.js";
3
+ import { map, defaultArg } from "../../fable_modules/fable-library.4.5.0/Option.js";
4
+
5
+ export function readNamedDeclaration(reader, declaration) {
6
+ const matchValue = declaration.kind | 0;
7
+ switch (matchValue) {
8
+ case 171: {
9
+ const propertySignature = declaration;
10
+ const name = propertySignature.name;
11
+ let accessor;
12
+ const matchValue_1 = propertySignature.modifiers;
13
+ accessor = ((matchValue_1 == null) ? (new GlueAccessor(2, [])) : (exists((modifier) => (modifier.kind === 148), matchValue_1) ? (new GlueAccessor(0, [])) : (new GlueAccessor(2, []))));
14
+ return new GlueMember(1, [new GlueProperty(name.getText(), reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](propertySignature.type), false, accessor)]);
15
+ }
16
+ case 174: {
17
+ const methodDeclaration = declaration;
18
+ const name_1 = methodDeclaration.name;
19
+ return new GlueMember(0, [new GlueMethod(name_1.getText(), reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadParametersZ17143B5B"](methodDeclaration.parameters), reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](methodDeclaration.type), methodDeclaration.questionToken != null, defaultArg(map((modifiers_1) => exists((modifier_1) => (modifier_1.kind === 126), modifiers_1), methodDeclaration.modifiers), false))]);
20
+ }
21
+ case 179: {
22
+ const callSignature = declaration;
23
+ return new GlueMember(2, [new GlueCallSignature(reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadParametersZ17143B5B"](callSignature.parameters), reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](callSignature.type))]);
24
+ }
25
+ case 181: {
26
+ const indexSignature = declaration;
27
+ return new GlueMember(3, [new GlueIndexSignature(reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadParametersZ17143B5B"](indexSignature.parameters), reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](indexSignature.type))]);
28
+ }
29
+ default:
30
+ throw new Error(`tryReadNamedDeclaration: Unsupported kind ${declaration.kind}`);
31
+ }
32
+ }
33
+
34
+ //# sourceMappingURL=NamedDeclaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/NamedDeclaration.fs"],"names":["matchValue","declaration","propertySignature","name","accessor","modifier","reader","methodDeclaration","modifiers","callSignature","indexSignature"],"mappings":";;;;;AAYUA,uBAAA,AAAAC;YAAAD;aAAA;AAGEE,sCAAoBD;AACpBE,yBAAsB,AAAAD;AAEtBE;AACMJ,iCAAA,AAAAE;AAAA,AADNE,wBACM,CAAA,AAAAJ,yBASI,4BAHH,AAHA,sBACC,AAAAK,kBAAgB,MAFpBL,iBAKc,4BACC;AASpB,mBAAA,mBANH,iBACW,AAAAG,gBACA,AAAAG,iFAAoB,AAAAJ,yBAChB,OACAE;;aAtBb;AAqCEG,sCAAoBN;AACpBE,2BAA4B,AAAAI;AAiB7B,mBAAA,mBAfH,eACW,AAAAJ,kBACM,AAAAG,mFAAsB,AAAAC,\u002BBAC5B,AAAAD,iFAAoB,AAAAC,yBACd,AAAAA,yCASN,WANA,qBAEI,wBACC,AAAAF,oBAAgB,MAFpBG,cAFJ,AAAAD,8BAOuB;;aArD7B;AA2BEE,kCAAgBR;AAOjB,mBAAA,mBALF,sBACgB,AAAAK,mFAAsB,AAAAG,2BAC5B,AAAAH,iFAAoB,AAAAG;;aA/B7B;AA0DEC,mCAAiBT;AAOlB,mBAAA,mBALF,uBACgB,AAAAK,mFAAsB,AAAAI,4BAC5B,AAAAJ,iFAAyB,AAAAI;;;AAMpC,4BAAS,6CAA6C,AAAAT","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,28 @@
1
+ import { toConsole } from "../../fable_modules/fable-library.4.5.0/String.js";
2
+ import { GlueType } from "../GlueAST.js";
3
+
4
+ export function readNode(reader, node) {
5
+ const matchValue = node.kind | 0;
6
+ switch (matchValue) {
7
+ case 243:
8
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadVariableStatementZ66C4BA0A"](node);
9
+ case 262:
10
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadFunctionDeclarationZ72EBD329"](node);
11
+ case 263:
12
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadClassDeclarationZ4558F325"](node);
13
+ case 264:
14
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadInterfaceDeclaration1CB6FA10"](node);
15
+ case 265:
16
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeAliasDeclarationZ7FA16745"](node);
17
+ case 266:
18
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadEnumDeclaration49F76106"](node);
19
+ case 267:
20
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadModuleDeclarationC29C54F"](node);
21
+ default: {
22
+ toConsole(`readNode: Unsupported kind ${matchValue}`);
23
+ return new GlueType(0, []);
24
+ }
25
+ }
26
+ }
27
+
28
+ //# sourceMappingURL=Node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/Node.fs"],"names":["matchValue","node","reader"],"mappings":";;;;AAOUA,uBAAA,AAAAC;YAAAD;aAAA;AAWF,mBAAA,AAAAE,0FAA6BD;aAX3B;AAcF,mBAAA,AAAAC,4FAA\u002BBD;aAd7B;AAoBF,mBAAA,AAAAC,yFAA4BD;aApB1B;AAQF,mBAAA,AAAAC,4FAAgCD;aAR9B;AAKF,mBAAA,AAAAC,6FAAgCD;aAL9B;AAEF,mBAAA,AAAAC,uFAA2BD;aAFzB;AAiBF,mBAAA,AAAAC,wFAA6BD;;AAM7B,sBAAQ,8BAARD;AACA,mBAAA","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,12 @@
1
+ import { map } from "../../fable_modules/fable-library.4.5.0/List.js";
2
+ import { GlueParameter } from "../GlueAST.js";
3
+ import { toList } from "../../fable_modules/fable-library.4.5.0/Seq.js";
4
+
5
+ export function readParameters(reader, parameters) {
6
+ return map((parameter) => {
7
+ const name = parameter.name;
8
+ return new GlueParameter(name.getText(), parameter.questionToken != null, reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](parameter.type));
9
+ }, toList(parameters));
10
+ }
11
+
12
+ //# sourceMappingURL=Parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/Parameters.fs"],"names":["name","parameter","reader","parameters"],"mappings":";;;;;WAYO;AACKA,qBAA4B,AAAAC;AAEhC,eAAA,kBACW,AAAAD,gBACM,AAAAC,iCACN,AAAAC,iFAAoB,AAAAD;OAPhC,OADHE","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,28 @@
1
+ import { GlueType, GlueTypeAliasDeclaration } from "../GlueAST.js";
2
+
3
+ export function readTypeAliasDeclaration(reader, declaration) {
4
+ let typ;
5
+ const matchValue = declaration.type.kind | 0;
6
+ switch (matchValue) {
7
+ case 192: {
8
+ const unionTypeNode = declaration.type;
9
+ typ = reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadUnionTypeNodeZ5A082EC2"](unionTypeNode);
10
+ break;
11
+ }
12
+ case 198: {
13
+ const typeOperatorNode = declaration.type;
14
+ typ = reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeOperatorNodeZ6830FC33"](typeOperatorNode);
15
+ break;
16
+ }
17
+ case 199: {
18
+ const declaration_1 = declaration.type;
19
+ typ = reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadIndexedAccessTypeZ5577BC0A"](declaration_1);
20
+ break;
21
+ }
22
+ default:
23
+ typ = reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNode24A678AD"](declaration.type);
24
+ }
25
+ return new GlueType(5, [new GlueTypeAliasDeclaration(declaration.name.getText(), typ, reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeParameters4088FB9E"](declaration.typeParameters))]);
26
+ }
27
+
28
+ //# sourceMappingURL=TypeAliasDeclaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeAliasDeclaration.fs"],"names":["typ","matchValue","declaration","unionTypeNode","reader","typeOperatorNode"],"mappings":";;;AAYQA;AACMC,uBAAA,AAAAC;YAAAD;aAAA;AAEEE,kCAAgB,AAAAD;AAEpB,AALJF,kBAKI,AAAAI,sFAAyBD;;;aAJvB;AAOEE,qCAAmB,AAAAH;AACvB,AATJF,kBASI,AAAAI,yFAA4BC;;;aAR1B;AAWEH,kCAAc,AAAAA;AAClB,AAbJF,kBAaI,AAAAI,0FAA6BF;;;;AAG1B,AAhBPF,kBAgBO,AAAAI,gFAAoB,AAAAF;;AAQ5B,WAAA,iBALH,6BACW,AAAAA,4BACAF,KACU,AAAAI,sFAA0B,AAAAF","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,126 @@
1
+ import { GlueClassDeclaration, GlueFunctionType, GlueTypeReference, GlueInterface, GlueTypeUnion, GlueLiteral, GlueType, GluePrimitive } from "../GlueAST.js";
2
+ import { empty, map, choose } from "../../fable_modules/fable-library.4.5.0/List.js";
3
+ import { $007CHasSymbolFlags$007C_$007C, $007CHasTypeFlags$007C_$007C } from "./Utils.js";
4
+ import { head, toList } from "../../fable_modules/fable-library.4.5.0/Seq.js";
5
+ import { value as value_2 } from "../../fable_modules/fable-library.4.5.0/Option.js";
6
+ import typescript from "typescript";
7
+
8
+ export function readTypeNode(reader, typeNode) {
9
+ const checker = reader["Glutinum.Converter.Reader.Types.TypeScriptReader.get_checker"]();
10
+ const matchValue = typeNode.kind | 0;
11
+ switch (matchValue) {
12
+ case 106:
13
+ return new GlueType(3, [new GluePrimitive(7, [])]);
14
+ case 116:
15
+ return new GlueType(3, [new GluePrimitive(4, [])]);
16
+ case 133:
17
+ return new GlueType(3, [new GluePrimitive(6, [])]);
18
+ case 136:
19
+ return new GlueType(3, [new GluePrimitive(3, [])]);
20
+ case 150:
21
+ return new GlueType(3, [new GluePrimitive(5, [])]);
22
+ case 154:
23
+ return new GlueType(3, [new GluePrimitive(0, [])]);
24
+ case 157:
25
+ return new GlueType(3, [new GluePrimitive(8, [])]);
26
+ case 182:
27
+ return new GlueType(3, [new GluePrimitive(3, [])]);
28
+ case 183: {
29
+ const typeReferenceNode = typeNode;
30
+ const symbolOpt = checker.getSymbolAtLocation(typeReferenceNode.typeName);
31
+ let fullName;
32
+ if (symbolOpt != null) {
33
+ const symbol = symbolOpt;
34
+ fullName = checker.getFullyQualifiedName(symbol);
35
+ }
36
+ else {
37
+ throw new Error("readTypeNode: Missing symbol");
38
+ }
39
+ switch (fullName) {
40
+ case "Exclude": {
41
+ const typ = checker.getTypeFromTypeNode(typeReferenceNode);
42
+ return new GlueType(7, [new GlueTypeUnion(choose((typ_1) => {
43
+ const matchValue_1 = typ_1.flags | 0;
44
+ if ($007CHasTypeFlags$007C_$007C(128, matchValue_1) != null) {
45
+ const literalType = typ_1;
46
+ return new GlueType(8, [new GlueLiteral(0, [literalType.value])]);
47
+ }
48
+ else if ($007CHasTypeFlags$007C_$007C(256, matchValue_1) != null) {
49
+ const literalType_1 = typ_1;
50
+ return new GlueType(8, [Number.isSafeInteger(literalType_1.value) ? (new GlueLiteral(1, [literalType_1.value])) : (new GlueLiteral(2, [literalType_1.value]))]);
51
+ }
52
+ else {
53
+ return void 0;
54
+ }
55
+ }, toList(typ.types)))]);
56
+ }
57
+ case "Partial": {
58
+ const typ_2 = checker.getTypeFromTypeNode(typeReferenceNode);
59
+ const matchValue_2 = typ_2.aliasTypeArguments;
60
+ if (matchValue_2 != null) {
61
+ const aliasTypeArguments = matchValue_2;
62
+ if (aliasTypeArguments.length !== 1) {
63
+ return new GlueType(0, []);
64
+ }
65
+ else {
66
+ const symbol_1 = aliasTypeArguments[0].symbol;
67
+ if (symbol_1.members == null) {
68
+ return new GlueType(0, []);
69
+ }
70
+ else {
71
+ const patternInput = head(value_2(symbol_1.members).entries());
72
+ const originalType = value_2(patternInput[1].declarations)[0].parent;
73
+ if (originalType.kind === 264) {
74
+ const interfaceDeclaration = originalType;
75
+ const members = map((declaration) => reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadNamedDeclaration2A58F896"](declaration), toList(interfaceDeclaration.members));
76
+ return new GlueType(14, [new GlueInterface(interfaceDeclaration.name.getText(), members, empty())]);
77
+ }
78
+ else {
79
+ return new GlueType(0, []);
80
+ }
81
+ }
82
+ }
83
+ }
84
+ else {
85
+ return new GlueType(0, []);
86
+ }
87
+ }
88
+ default: {
89
+ const ts = typescript;
90
+ const matchValue_4 = value_2(symbolOpt).flags | 0;
91
+ if ($007CHasSymbolFlags$007C_$007C(262144, matchValue_4) != null) {
92
+ return new GlueType(17, [value_2(symbolOpt).name]);
93
+ }
94
+ else {
95
+ return new GlueType(13, [new GlueTypeReference(typeReferenceNode.getText(), fullName)]);
96
+ }
97
+ }
98
+ }
99
+ }
100
+ case 184: {
101
+ const functionTypeNode = typeNode;
102
+ return new GlueType(16, [new GlueFunctionType(reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNode24A678AD"](functionTypeNode.type), reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadParametersZ17143B5B"](functionTypeNode.parameters))]);
103
+ }
104
+ case 186: {
105
+ const typeNodeQuery = typeNode;
106
+ const typ_3 = checker.getTypeAtLocation(typeNodeQuery);
107
+ const matchValue_5 = typ_3.symbol.flags | 0;
108
+ if ($007CHasSymbolFlags$007C_$007C(32, matchValue_5) != null) {
109
+ return new GlueType(12, [new GlueClassDeclaration(typ_3.symbol.name, empty(), empty(), empty())]);
110
+ }
111
+ else {
112
+ return new GlueType(3, [new GluePrimitive(6, [])]);
113
+ }
114
+ }
115
+ case 188: {
116
+ const arrayTypeNode = typeNode;
117
+ return new GlueType(15, [reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNode24A678AD"](arrayTypeNode.elementType)]);
118
+ }
119
+ case 192:
120
+ return reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadUnionTypeNodeZ5A082EC2"](typeNode);
121
+ default:
122
+ throw new Error(`readTypeNode: Unsupported kind ${typeNode.kind}`);
123
+ }
124
+ }
125
+
126
+ //# sourceMappingURL=TypeNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeNode.fs"],"names":["checker","reader","matchValue","typeNode","typeReferenceNode","symbolOpt","fullName","symbol","typ","literalType","aliasTypeArguments","patternInput","originalType","interfaceDeclaration","members","declaration","ts","functionTypeNode","typeNodeQuery","arrayTypeNode"],"mappings":";;;;;;;;AAUQA,oBAAU,AAAAC;AAERC,uBAAA,AAAAC;YAAAD;aAAA;AAMyB,mBAAA,iBAAmB;aAN5C;AAGyB,mBAAA,iBAAmB;aAH5C;AAKwB,mBAAA,iBAAmB;aAL3C;AAI4B,mBAAA,iBAAmB;aAJ/C;AAC2B,mBAAA,iBAAmB;aAD9C;AAE2B,mBAAA,iBAAmB;aAF9C;AAQF,mBAAA,iBAAmB;aARjB;AA\u002BH2B,mBAAA,iBAAmB;aA/H9C;AAaEE,sCAAoBD;AAEpBE,8BAAY,AAAAL,4BAA8B,AAAAI;AAE1CE;AACM,gBAAA,AAAAD;AAECE,\u002BBAAUF;AAAA,AAHjBC,2BAGiB,AAAAN,8BAA8BO;;;AADrC,gCAAS;;oBAKpBD;qBAAW;AACNE,gCACA,AAAAR,4BAA4BI;AAgCN,2BAAA,iBAAjB,kBA1BF;AACOF,6CAAA,AAAAM;AACJ,4BADI,AACJ,6BAAa,KADTN;AAEEO,gDAAcD;AAIU,mCAAA,iBAA5B,oBAF0B,AAAAC;;6BAG5B,IAPI,AAOJ,6BAAa,KAPTP;AAQEO,kDAAcD;AAaT,mCAAA,iBAVL,AACI,qBACI,AAAAC,wBAEJ,oBAA2B,AAAAA,0BAE3B,oBACiB,AAAAA;;;AAItB,mCAAA;;uBAxBR,OADH,AAAAD;;qBA8BW;AACXA,kCAAM,AAAAR,4BAA4BI;AAOhCF,yCAAA,AAAAM;AAAA,wBAAA,AAAAN;AAECQ,mDACHR;AAAA,4BAAG,AAAAQ,8BAA4B;AAC3B,mCAAA;;;AAEIH,6CAAS,AAAAG,mBAAoB;AAEjC,gCAAG,AAAAH;AACC,uCAAA;;;AAIII,qDACmC,KAAnC,QAAA,AAAAJ;AAEAK,qDACA,QAAA,AAJA,AAAAD,8BAI6B;AAE3B,oCAAA,AAAAC,sBAAA;AAEEC,iEACAD;AAEAE,oDAGG,qBAAS,AAAAb,wFAAAc,cADT,OADH,AAAAF;AAUD,2CAAA,kBANF,kBACU,AAAAA,qCACGC,SACO;;;AAKlB,2CAAA;;;;;;AApCT,\u002BBAAA;;;;AAuCNE;AAEEd,yCAAA,QAAAG;AACJ,wBADI,AACJ,\u002BBAAe,QADXH;AAEsB,\u002BBAAA,kBAAxB,QAAAG;;;AAMG,\u002BBAAA,kBAJF,sBACU,AAAAD,6BACIE;;;;;aApHrB;AAkIEW,qCAAmBd;AAMpB,mBAAA,kBAJH,qBACW,AAAAF,gFAAoB,AAAAgB,wBACd,AAAAhB,mFAAsB,AAAAgB;;aAtIrC;AA2IEC,kCAAgBf;AAEhBK,0BAAM,AAAAR,0BAA0BkB;AAE9BhB,iCAAA,AAAAM;AACJ,gBADI,AACJ,\u002BBAAe,IADXN;AAQC,uBAAA,kBANH,yBACW,AAAAM,mBACQ,SACL,SACO;;;AAGlB,uBAAA,iBAAmB;;;aAxJxB;AAyHEW,kCAAgBhB;AAIpB,mBAAA,kBAFkB,AAAAF,gFAAoB,AAAAkB;;aA3HpC;AAUF,mBAAA,AAAAlB,sFAAyBE;;AAgJtB,4BAAS,kCAAkC,AAAAA","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,34 @@
1
+ import typescript from "typescript";
2
+ import { GlueType } from "../GlueAST.js";
3
+
4
+ export function readTypeOperatorNode(reader, node) {
5
+ if (node.operator === 143) {
6
+ if (typescript.isTypeReferenceNode(node.type)) {
7
+ const typeReferenceNode = node.type;
8
+ const symbolOpt = reader["Glutinum.Converter.Reader.Types.TypeScriptReader.get_checker"]().getSymbolAtLocation(typeReferenceNode.typeName);
9
+ if (symbolOpt != null) {
10
+ const symbol = symbolOpt;
11
+ const matchValue_1 = symbol.declarations;
12
+ if (matchValue_1 == null) {
13
+ throw new Error("readTypeOperator: Missing declaration");
14
+ }
15
+ else {
16
+ const declarations = matchValue_1;
17
+ const interfaceDeclaration = declarations[0];
18
+ return new GlueType(9, [reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadInterfaceDeclaration1CB6FA10"](interfaceDeclaration)]);
19
+ }
20
+ }
21
+ else {
22
+ throw new Error("readTypeOperator: Missing symbol");
23
+ }
24
+ }
25
+ else {
26
+ throw new Error("readTypeOperator: Unsupported type reference");
27
+ }
28
+ }
29
+ else {
30
+ throw new Error(`readTypeOperator: Unsupported operator ${node.operator}`);
31
+ }
32
+ }
33
+
34
+ //# sourceMappingURL=TypeOperatorNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeOperatorNode.fs"],"names":["node","typeReferenceNode","symbolOpt","reader","symbol","matchValue","declarations","interfaceDeclaration"],"mappings":";;;;AAYU,QAAA,AAAAA,kBAAA;AAEF,YAAG,\u002BBAAuB,AAAAA;AAClBC,sCAAoB,AAAAD;AAGpBE,8BACA,AAAAC,6FAAqC,AAAAF;AAEnC,gBAAA,AAAAC;AAGCE,\u002BBACGF;AAAAG,qCAAA,AAAAD;AAAA,oBAAA,AAAAC;AAQI,oCAAS;;;AAPZC,yCACCD;AAAAE,iDACA,AAAAD,aAAa;AAGd,2BAAA,iBADH,AAAAH,4FAAgCI;;;;AAR9B,gCAAS;;;;AAcnB,4BAAS;;;;AAEV,wBAAS,0CAA0C,AAAAP","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,14 @@
1
+ import { empty, map } from "../../fable_modules/fable-library.4.5.0/List.js";
2
+ import { GlueTypeParameter } from "../GlueAST.js";
3
+ import { toList } from "../../fable_modules/fable-library.4.5.0/Seq.js";
4
+
5
+ export function readTypeParameters(reader, typeParameters) {
6
+ if (typeParameters != null) {
7
+ return map((typeParameter) => (new GlueTypeParameter(typeParameter.name.getText(), void 0, void 0)), toList(typeParameters));
8
+ }
9
+ else {
10
+ return empty();
11
+ }
12
+ }
13
+
14
+ //# sourceMappingURL=TypeParameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeParameters.fs"],"names":["typeParameters","typeParameter"],"mappings":";;;;;AAYU,QAAA,AAAAA;AAKC,eAAA,wBACC,sBACW,AAAAC,8BACM,QACH,UALf,OADHD;;;AAFM,eAAA","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,95 @@
1
+ import { readClassDeclaration } from "./ClassDeclaration.js";
2
+ import { GluePrimitive, GlueType } from "../GlueAST.js";
3
+ import { readEnumDeclaration } from "./EnumDeclaration.js";
4
+ import { readFunctionDeclaration } from "./FunctionDeclaration.js";
5
+ import { readInterfaceDeclaration } from "./InterfaceDeclaration.js";
6
+ import { readModuleDeclaration } from "./ModuleDeclaration.js";
7
+ import { readNode } from "./Node.js";
8
+ import { readTypeAliasDeclaration } from "./TypeAliasDeclaration.js";
9
+ import { readTypeNode } from "./TypeNode.js";
10
+ import { readVariableStatement } from "./VariableStatement.js";
11
+ import { readNamedDeclaration } from "./NamedDeclaration.js";
12
+ import { readParameters } from "./Parameters.js";
13
+ import { readUnionTypeNode } from "./UnionTypeNode.js";
14
+ import { readTypeOperatorNode } from "./TypeOperatorNode.js";
15
+ import { readIndexedAccessType } from "./IndexedAccessType.js";
16
+ import { readTypeParameters } from "./TypeParameters.js";
17
+ import { TypeScriptReader } from "./Types.js";
18
+
19
+ export function typeScriptReader(checker) {
20
+ return new (class extends TypeScriptReader {
21
+ constructor() {
22
+ super(checker);
23
+ }
24
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.get_checker"() {
25
+ return checker;
26
+ }
27
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadClassDeclarationZ4558F325"(classDeclaration) {
28
+ const this$ = this;
29
+ return new GlueType(12, [readClassDeclaration(this$, classDeclaration)]);
30
+ }
31
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadEnumDeclaration49F76106"(enumDeclaration) {
32
+ const this$_1 = this;
33
+ return new GlueType(4, [readEnumDeclaration(this$_1, enumDeclaration)]);
34
+ }
35
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadFunctionDeclarationZ72EBD329"(functionDeclaration) {
36
+ const this$_2 = this;
37
+ return new GlueType(6, [readFunctionDeclaration(this$_2, functionDeclaration)]);
38
+ }
39
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadInterfaceDeclaration1CB6FA10"(interfaceDeclaration) {
40
+ const this$_3 = this;
41
+ return new GlueType(1, [readInterfaceDeclaration(this$_3, interfaceDeclaration)]);
42
+ }
43
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadModuleDeclarationC29C54F"(moduleDeclaration) {
44
+ const this$_4 = this;
45
+ return new GlueType(11, [readModuleDeclaration(this$_4, moduleDeclaration)]);
46
+ }
47
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadNode6C0FD055"(node) {
48
+ const this$_5 = this;
49
+ return readNode(this$_5, node);
50
+ }
51
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeAliasDeclarationZ7FA16745"(typeAliasDeclaration) {
52
+ const this$_6 = this;
53
+ return readTypeAliasDeclaration(this$_6, typeAliasDeclaration);
54
+ }
55
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNode24A678AD"(typNode) {
56
+ const this$_7 = this;
57
+ return this$_7["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](typNode);
58
+ }
59
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"(typNode_1) {
60
+ const this$_8 = this;
61
+ return (typNode_1 == null) ? (new GlueType(3, [new GluePrimitive(4, [])])) : readTypeNode(this$_8, typNode_1);
62
+ }
63
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadVariableStatementZ66C4BA0A"(variableStatement) {
64
+ const this$_9 = this;
65
+ return readVariableStatement(this$_9, variableStatement);
66
+ }
67
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadNamedDeclaration2A58F896"(declaration) {
68
+ const this$_10 = this;
69
+ return readNamedDeclaration(this$_10, declaration);
70
+ }
71
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadParametersZ17143B5B"(parameters) {
72
+ const this$_11 = this;
73
+ return readParameters(this$_11, parameters);
74
+ }
75
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadUnionTypeNodeZ5A082EC2"(unionType) {
76
+ const this$_12 = this;
77
+ return readUnionTypeNode(this$_12, unionType);
78
+ }
79
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeOperatorNodeZ6830FC33"(node_1) {
80
+ const this$_13 = this;
81
+ return readTypeOperatorNode(this$_13, node_1);
82
+ }
83
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadIndexedAccessTypeZ5577BC0A"(declaration_1) {
84
+ const this$_14 = this;
85
+ return readIndexedAccessType(this$_14, declaration_1);
86
+ }
87
+ "Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeParameters4088FB9E"(typeParametersOpt) {
88
+ const this$_15 = this;
89
+ return readTypeParameters(this$_15, typeParametersOpt);
90
+ }
91
+ }
92
+ )();
93
+ }
94
+
95
+ //# sourceMappingURL=TypeScriptReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/TypeScriptReader.fs"],"names":["checker","this","classDeclaration","enumDeclaration","functionDeclaration","interfaceDeclaration","moduleDeclaration","node","typeAliasDeclaration","typNode","variableStatement","declaration","parameters","unionType","typeParametersOpt"],"mappings":";;;;;;;;;;;;;;;;;;;;;kBAsB2BA;;;mBACkBA;;;AAE9BC,0BAAAA;AAKA,mBAAA,kBADH,qBAAqBA,OAAKC;;;AAGvBD,4BAAAA;AAIyC,mBAAA,iBAA5C,oBAAoBA,SAAKE;;;AAEtBF,4BAAAA;AAKA,mBAAA,iBADH,wBAAwBA,SAAKG;;;AAG1BH,4BAAAA;AAKA,mBAAA,iBADH,yBAAyBA,SAAKI;;;AAG3BJ,4BAAAA;AAKA,mBAAA,kBADH,sBAAsBA,SAAKK;;;AAGxBL,4BAAAA;AAA0C,mBAAA,SAASA,SAAKM;;;AAExDN,4BAAAA;AAIH,mBAAA,yBAAyBA,SAAKO;;;AAE3BP,4BAAAA;AACH,mBAAA,AAAAA,kFAAuBQ;;;AAEpBR,4BAAAA;AACG,mBAAA,CAAA,AAAAQ,sBAEI,iBAAmB,8BADX,aAAaR,SAAbQ;;;AAGfR,4BAAAA;AAIH,mBAAA,sBAAsBA,SAAKS;;;AAExBT,6BAAAA;AAIH,mBAAA,qBAAqBA,UAAKU;;;AAEvBV,6BAAAA;AAIH,mBAAA,eAAeA,UAAKW;;;AAEjBX,6BAAAA;AACH,mBAAA,kBAAkBA,UAAKY;;;AAEpBZ,6BAAAA;AACH,mBAAA,qBAAqBA,UAAKM;;;AAEvBN,6BAAAA;AAIH,mBAAA,sBAAsBA,UAAKU;;;AAExBV,6BAAAA;AAIH,mBAAA,mBAAmBA,UAAKa","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,16 @@
1
+ import { class_type } from "../../fable_modules/fable-library.4.5.0/Reflection.js";
2
+
3
+ export class TypeScriptReader {
4
+ constructor(checker) {
5
+ }
6
+ }
7
+
8
+ export function TypeScriptReader_$reflection() {
9
+ return class_type("Glutinum.Converter.Reader.Types.TypeScriptReader", void 0, TypeScriptReader);
10
+ }
11
+
12
+ export function TypeScriptReader_$ctor_Z51F60704(checker) {
13
+ return new TypeScriptReader(checker);
14
+ }
15
+
16
+ //# sourceMappingURL=Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,89 @@
1
+ import typescript from "typescript";
2
+ import { map, singleton, choose, concat } from "../../fable_modules/fable-library.4.5.0/List.js";
3
+ import { defaultArgWith } from "../../fable_modules/fable-library.4.5.0/Option.js";
4
+ import { $007CHasTypeFlags$007C_$007C, tryReadLiteral } from "./Utils.js";
5
+ import { GlueTypeUnion, GlueTypeReference, GluePrimitive, GlueType } from "../GlueAST.js";
6
+ import { toList } from "../../fable_modules/fable-library.4.5.0/Seq.js";
7
+
8
+ function readUnionTypeCases(reader, unionTypeNode) {
9
+ const checker = reader["Glutinum.Converter.Reader.Types.TypeScriptReader.get_checker"]();
10
+ const removeParenthesizedType = (node_mut) => {
11
+ removeParenthesizedType:
12
+ while (true) {
13
+ const node = node_mut;
14
+ if (typescript.isParenthesizedTypeNode(node)) {
15
+ const parenthesizedTypeNode = node;
16
+ node_mut = parenthesizedTypeNode.type;
17
+ continue removeParenthesizedType;
18
+ }
19
+ else {
20
+ return node;
21
+ }
22
+ break;
23
+ }
24
+ };
25
+ return new GlueTypeUnion(concat(choose((node_1) => {
26
+ if (typescript.isLiteralTypeNode(node_1)) {
27
+ const literalTypeNode = node_1;
28
+ const literalExpression = literalTypeNode.literal;
29
+ if (typescript.isStringLiteral(literalExpression) ? true : typescript.isNumericLiteral(literalExpression)) {
30
+ return singleton(new GlueType(8, [defaultArgWith(tryReadLiteral(literalExpression), () => {
31
+ throw new Error("Expected a NumericLiteral");
32
+ })]));
33
+ }
34
+ else {
35
+ const matchValue = literalExpression.kind | 0;
36
+ switch (matchValue) {
37
+ case 106:
38
+ case 157:
39
+ return singleton(new GlueType(3, [new GluePrimitive(7, [])]));
40
+ default:
41
+ return void 0;
42
+ }
43
+ }
44
+ }
45
+ else if (typescript.isTypeReferenceNode(node_1)) {
46
+ const typeReferenceNode = node_1;
47
+ const symbol = defaultArgWith(checker.getSymbolAtLocation(typeReferenceNode.typeName), () => {
48
+ throw new Error("readUnionTypeCases: Unsupported type reference, missing symbol");
49
+ });
50
+ const matchValue_1 = symbol.declarations;
51
+ if (matchValue_1 == null) {
52
+ const typ = checker.getTypeOfSymbol(symbol);
53
+ const matchValue_2 = typ.flags | 0;
54
+ if ($007CHasTypeFlags$007C_$007C(1, matchValue_2) != null) {
55
+ return singleton(new GlueType(3, [new GluePrimitive(6, [])]));
56
+ }
57
+ else {
58
+ throw new Error("readUnionTypeCases: Unsupported type reference");
59
+ }
60
+ }
61
+ else {
62
+ const declarations = matchValue_1;
63
+ if (declarations.length === 0) {
64
+ return void 0;
65
+ }
66
+ else if (declarations.length > 1) {
67
+ const fullName = checker.getFullyQualifiedName(symbol);
68
+ return singleton(new GlueType(13, [new GlueTypeReference(typeReferenceNode.getText(), fullName)]));
69
+ }
70
+ else {
71
+ const declaration = declarations[0];
72
+ return singleton(reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadNode6C0FD055"](declaration));
73
+ }
74
+ }
75
+ }
76
+ else if (node_1.kind === 192) {
77
+ return readUnionTypeCases(reader, node_1).fields[0];
78
+ }
79
+ else {
80
+ return singleton(reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNode24A678AD"](node_1));
81
+ }
82
+ }, map(removeParenthesizedType, toList(unionTypeNode.types)))));
83
+ }
84
+
85
+ export function readUnionTypeNode(reader, unionTypeNode) {
86
+ return new GlueType(7, [readUnionTypeCases(reader, unionTypeNode)]);
87
+ }
88
+
89
+ //# sourceMappingURL=UnionTypeNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/UnionTypeNode.fs"],"names":["checker","reader","removeParenthesizedType","node","parenthesizedTypeNode","literalTypeNode","literalExpression","matchValue","typeReferenceNode","symbol","typ","declarations","fullName","declaration","readUnionTypeCases","unionTypeNode"],"mappings":";;;;;;;;AAaQA,oBAAU,AAAAC;AAMNC;;;kBAAyBC;AAC7B,gBAAG,mCAA2BA;AACtBC,8CAAwBD;2BAGJ,AAAAC;AAAxB;;;uBAEAD;;;;;AA0GL,WAAA,kBADA,OAnGA;AACC,YAAG,6BAAqBA;AAChBE,oCAAkBF;AAElBG,sCAC4B,AAAAD;AAEhC,gBACI,2BAAmBC,qBAAnB,OACG,4BAAoBA;AAOR,uBAAA,UADZ,iBAHA,eADH,eAAeA;AAEX,oCAAS;;;;AAMPC,mCAAA,AAAAD;wBAAAC;yBAAA;yBAAA;AAIC,\u002BBAAA,UADH,iBAAmB;;AAGhB,\u002BBAAA;;;;aACV,IAAG,\u002BBAAuBJ;AACvBK,sCAAoBL;AAOpBM,2BACA,eAHA,AAAAT,4BAA8B,AAAAQ;AAKtB,gCACI;;AAMVD,iCAAA,AAAAE;AAAA,gBAAA,AAAAF;AAoBEG,4BAAM,AAAAV,wBAAwBS;AAE5BF,qCAAA,AAAAG;AACJ,oBADI,AACJ,6BAAa,GADTH;AAGC,2BAAA,UADH,iBAAmB;;;AAInB,oCAAS;;;;AA3BVI,qCACHJ;AAAA,oBAAG,AAAAI,wBAAqB;AACpB,2BAAA;;qBACC,IAAG,AAAAA,sBAAqB;AACrBC,qCAAW,AAAAZ,8BAA8BS;AAO1C,2BAAA,UADA,kBAJF,sBACU,AAAAD,6BACII;;;AAMXC,wCAAc,AAAAF,aAAc;AAED,2BAAA,UAA/B,AAAAV,4EAAgBY;;;;aAwBlB,IAAA,AAAAV,gBAAA;AAIE,mBAAA,AACA,AAAAW,mBAAmBb,QAHHE;;;AASjB,mBAAA,UADH,AAAAF,gFAAoBE;;OAhG7B,IAASD,yBAFT,OADH,AAAAa;;;;WA\u002BG2C,iBAA3C,AAAAD,mBAAmBb,QAAOc","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,79 @@
1
+ import { some } from "../../fable_modules/fable-library.4.5.0/Option.js";
2
+ import { tryParse } from "../../fable_modules/fable-library.4.5.0/Int32.js";
3
+ import { FSharpRef } from "../../fable_modules/fable-library.4.5.0/Types.js";
4
+ import { GlueLiteral } from "../GlueAST.js";
5
+ import { tryParse as tryParse_1 } from "../../fable_modules/fable-library.4.5.0/Double.js";
6
+
7
+ export function $007CHasTypeFlags$007C_$007C(flag, flags) {
8
+ if ((flags & flag) !== 0) {
9
+ return some(void 0);
10
+ }
11
+ else {
12
+ return void 0;
13
+ }
14
+ }
15
+
16
+ export function $007CHasSymbolFlags$007C_$007C(flag, flags) {
17
+ if ((flags & flag) !== 0) {
18
+ return some(void 0);
19
+ }
20
+ else {
21
+ return void 0;
22
+ }
23
+ }
24
+
25
+ function isNumericString(text) {
26
+ if ((typeof text) === "string") {
27
+ return !Number.isNaN(text);
28
+ }
29
+ else {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ function tryReadNumericLiteral(text) {
35
+ if (isNumericString(text)) {
36
+ let matchValue;
37
+ let outArg = 0;
38
+ matchValue = [tryParse(text, 511, false, 32, new FSharpRef(() => outArg, (v) => {
39
+ outArg = (v | 0);
40
+ })), outArg];
41
+ if (matchValue[0]) {
42
+ return new GlueLiteral(1, [matchValue[1]]);
43
+ }
44
+ else {
45
+ let matchValue_1;
46
+ let outArg_1 = 0;
47
+ matchValue_1 = [tryParse_1(text, new FSharpRef(() => outArg_1, (v_1) => {
48
+ outArg_1 = v_1;
49
+ })), outArg_1];
50
+ if (matchValue_1[0]) {
51
+ return new GlueLiteral(2, [matchValue_1[1]]);
52
+ }
53
+ else {
54
+ return void 0;
55
+ }
56
+ }
57
+ }
58
+ else {
59
+ return void 0;
60
+ }
61
+ }
62
+
63
+ export function tryReadLiteral(expression) {
64
+ const matchValue = expression.kind | 0;
65
+ switch (matchValue) {
66
+ case 11: {
67
+ const literal = expression;
68
+ return new GlueLiteral(0, [literal.text]);
69
+ }
70
+ case 97:
71
+ return new GlueLiteral(3, [false]);
72
+ case 112:
73
+ return new GlueLiteral(3, [true]);
74
+ default:
75
+ return tryReadNumericLiteral(expression.getText());
76
+ }
77
+ }
78
+
79
+ //# sourceMappingURL=Utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/Utils.fs"],"names":["flags","flag","text","isNumericString","matchValue","outArg","expression","literal","tryReadNumericLiteral"],"mappings":";;;;;;;AAQI,QAAG,CAAA,AAAIA,QAAcC,UAAQ;AACzB,eAAA,KAAI;;;AAEJ,eAAA;;;;;AAGJ,QAAG,CAAA,AAAID,QAAcC,UAAQ;AACzB,eAAA,KAAI;;;AAEJ,eAAA;;;;;AAGJ,QAAA,CAAA,OAASC,UAAO;AAAuD,eAAA,CAA7B,aAARA;;;eAAlC;;;;;AAGA,QAAG,AAAAC,gBAAgBD;AAETE;AAAAC;AAAAD,sBAAA,SAAsBF,sBAAtB,oBAAAG;AAAAA;aAAAA;AAAA,YAAA,AAAAD;AACS,mBAAA,oBAAA,AAAAA;;;AAGLA;AAAAC;AAAAD,4BAAA,WAAuBF,MAAvB,oBAAAG;AAAAA;iBAAAA;AAAA,gBAAA,AAAAD;AACS,uBAAA,oBAAA,AAAAA;;;AACR,uBAAA;;;;;AAEX,eAAA;;;;;AAGEA,uBAAA,AAAAE;YAAAF;aAAA;AAEEG,4BAAWD;AAEf,mBAAA,oBAAmB,AAAAC;;aAJjB;AAM0B,mBAAA,oBAAiB;aAN3C;AAKyB,mBAAA,oBAAiB;;AAM5C,mBAAA,AAAAC,sBAFW,AAAAF","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,19 @@
1
+ import { map, defaultArg } from "../../fable_modules/fable-library.4.5.0/Option.js";
2
+ import { toList, exists } from "../../fable_modules/fable-library.4.5.0/Seq.js";
3
+ import { head } from "../../fable_modules/fable-library.4.5.0/List.js";
4
+ import { GlueType, GlueVariable } from "../GlueAST.js";
5
+
6
+ export function readVariableStatement(reader, statement) {
7
+ let id;
8
+ if (defaultArg(map((modifiers) => exists((modifier) => (modifier.kind === 95), modifiers), statement.modifiers), false)) {
9
+ const declaration = head(toList(statement.declarationList.declarations));
10
+ return new GlueType(2, [new GlueVariable((declaration.name.kind === 80) ? ((id = declaration.name, id.getText())) : (() => {
11
+ throw new Error("readVariableStatement: Unsupported kind");
12
+ })(), reader["Glutinum.Converter.Reader.Types.TypeScriptReader.ReadTypeNodeZ64B23DD2"](declaration.type))]);
13
+ }
14
+ else {
15
+ return new GlueType(0, []);
16
+ }
17
+ }
18
+
19
+ //# sourceMappingURL=VariableStatement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Glutinum.Converter/Reader/VariableStatement.fs"],"names":["id","modifier","modifiers","statement","declaration","reader"],"mappings":";;;;;;QA8BoBA;AAPhB,QAFO,WANA,mBAEI,sBACC,AAAAC,kBAAgB,KAFpBC,YAFJ,AAAAC,sBAOuB;AAGnBC,4BACwD,KAAd,OAA1C,AAAAD;AAcD,eAAA,iBALF,iBANS,CAAA,AAAAC,0BAAA,QAEEJ,KAAsB,AAAAI,kBAC1B,AAAAJ;AACG,4BAAS;cAIT,AAAAK,iFAAoB,AAAAD;;;AAM/B,eAAA","file":null,"sourcesContent":null,"sourceRoot":null}