@glutinum/cli 0.13.0 → 0.14.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.
Files changed (319) hide show
  1. package/README.md +19 -1
  2. package/dist/Glutinum.Converter/Abbreviations.js +246 -0
  3. package/dist/Glutinum.Converter/FsharpAST.js +87 -28
  4. package/dist/Glutinum.Converter/Generate.js +55 -8
  5. package/dist/Glutinum.Converter/GlueAST.js +333 -34
  6. package/dist/Glutinum.Converter/Log.js +7 -8
  7. package/dist/Glutinum.Converter/Merge.js +683 -31
  8. package/dist/Glutinum.Converter/Packages.js +308 -0
  9. package/dist/Glutinum.Converter/Printer.js +323 -186
  10. package/dist/Glutinum.Converter/Read.js +279 -6
  11. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
  12. package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
  13. package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
  14. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
  15. package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
  16. package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
  17. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
  18. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
  19. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
  20. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
  21. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -9
  22. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
  23. package/dist/Glutinum.Converter/Reader/Node.js +24 -10
  24. package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
  25. package/dist/Glutinum.Converter/Reader/Report.js +31 -12
  26. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
  27. package/dist/Glutinum.Converter/Reader/TypeNode.js +1524 -253
  28. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
  29. package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
  30. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
  31. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
  32. package/dist/Glutinum.Converter/Reader/Types.js +180 -0
  33. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
  34. package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
  35. package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
  36. package/dist/Glutinum.Converter/Transform.js +8292 -1119
  37. package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
  38. package/dist/Glutinum.Converter/TypeScript.js +3 -3
  39. package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
  40. package/dist/Glutinum.Converter/Utils/List.js +3 -3
  41. package/dist/Glutinum.Converter/Utils/Naming.js +61 -12
  42. package/dist/Glutinum.Converter/Utils/String.js +7 -3
  43. package/dist/Program.js +230 -72
  44. package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs +89 -0
  45. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/AsyncIterable.fs.js +29 -29
  46. package/dist/fable_modules/Fable.Promise.3.2.1/Fable.Promise.fableproj +25 -0
  47. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs +842 -766
  48. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs.js +26 -12
  49. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs +31 -31
  50. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs.js +5 -5
  51. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs +235 -0
  52. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs.js +384 -0
  53. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AssemblyInfo.fs +4 -4
  54. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs +89 -9
  55. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs.js +13 -12
  56. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOption.fs +50 -4
  57. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs +30 -39
  58. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs.js +10 -10
  59. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResult.fs +52 -8
  60. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs +26 -42
  61. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs.js +3 -3
  62. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOption.fs +17 -5
  63. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs.js +26 -0
  64. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs +31 -33
  65. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs.js +3 -3
  66. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidation.fs +1 -6
  67. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs +10 -18
  68. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs.js +3 -3
  69. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/FsToolkit.ErrorHandling.fableproj +69 -0
  70. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs +68 -10
  71. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs.js +47 -41
  72. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Nullness.fs +81 -0
  73. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Option.fs +133 -2
  74. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs +139 -0
  75. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs.js +48 -0
  76. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/OptionOp.fs +3 -3
  77. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs +88 -0
  78. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs.js +30 -0
  79. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs +200 -0
  80. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs.js +18 -0
  81. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidation.fs +34 -0
  82. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs +244 -0
  83. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs.js +18 -0
  84. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs +87 -0
  85. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs.js +8 -8
  86. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs +8 -23
  87. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs.js +5 -5
  88. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs +1 -1
  89. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs.js +10 -10
  90. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs +7 -18
  91. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs.js +3 -3
  92. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs +503 -0
  93. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs.js +295 -0
  94. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Validation.fs +0 -5
  95. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs +7 -13
  96. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs.js +3 -3
  97. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValueOption.fs +1 -4
  98. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOption.fs +102 -0
  99. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionCE.fs +587 -0
  100. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionOp.fs +10 -0
  101. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +3 -3
  102. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.fs +3 -0
  103. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1 → FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0}/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
  104. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
  105. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
  106. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Array.js +192 -86
  107. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Async.js +58 -53
  108. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/AsyncBuilder.js +29 -8
  109. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BigInt.js +71 -46
  110. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BitConverter.js +2 -2
  111. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Boolean.js +4 -3
  112. package/dist/fable_modules/fable-library-js.5.17.2/CHANGELOG.md +348 -0
  113. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Char.js +64 -31
  114. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Choice.js +2 -2
  115. package/dist/fable_modules/fable-library-js.5.17.2/CollectionUtil.js +182 -0
  116. package/dist/fable_modules/fable-library-js.5.17.2/ConditionalWeakTable.js +21 -0
  117. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Date.js +197 -112
  118. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOffset.js +46 -62
  119. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOnly.js +6 -6
  120. package/dist/fable_modules/fable-library-js.5.17.2/DateOnlyTemporal.js +146 -0
  121. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeFormat.js +523 -0
  122. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeOffsetTemporal.js +283 -0
  123. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeTemporal.js +243 -0
  124. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Decimal.js +39 -13
  125. package/dist/fable_modules/fable-library-js.5.17.2/Directory.js +11 -0
  126. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Double.js +10 -3
  127. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Encoding.js +20 -8
  128. package/dist/fable_modules/fable-library-js.5.17.2/Environment.js +3 -0
  129. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Event.js +10 -1
  130. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Collections.js +45 -0
  131. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Core.js +156 -0
  132. package/dist/fable_modules/fable-library-js.5.17.2/File.js +27 -0
  133. package/dist/fable_modules/fable-library-js.5.17.2/Global.js +29 -0
  134. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Guid.js +33 -12
  135. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Int32.js +17 -17
  136. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/List.js +170 -106
  137. package/dist/fable_modules/fable-library-js.5.17.2/Long.js +38 -0
  138. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MailboxProcessor.js +13 -6
  139. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Map.js +65 -61
  140. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MapUtil.js +22 -4
  141. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableMap.js +28 -16
  142. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableSet.js +7 -7
  143. package/dist/fable_modules/fable-library-js.5.17.2/Native.js +14 -0
  144. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Numeric.js +44 -3
  145. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Observable.js +5 -3
  146. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Option.js +11 -20
  147. package/dist/fable_modules/fable-library-js.5.17.2/Path.js +31 -0
  148. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Random.js +22 -20
  149. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Range.js +12 -12
  150. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Reflection.js +50 -22
  151. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/RegExp.js +68 -30
  152. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Result.js +6 -6
  153. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq.js +229 -104
  154. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq2.js +1 -1
  155. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Set.js +153 -113
  156. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/String.js +238 -50
  157. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Collections.Generic.js +30 -14
  158. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Text.js +69 -31
  159. package/dist/fable_modules/fable-library-js.5.17.2/System.js +289 -0
  160. package/dist/fable_modules/fable-library-js.5.17.2/Task.js +27 -0
  161. package/dist/fable_modules/fable-library-js.5.17.2/TaskBuilder.js +72 -0
  162. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeOnly.js +6 -6
  163. package/dist/fable_modules/fable-library-js.5.17.2/TimeOnlyTemporal.js +142 -0
  164. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeSpan.js +18 -15
  165. package/dist/fable_modules/fable-library-js.5.17.2/TimeSpanTemporal.js +259 -0
  166. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Types.js +14 -24
  167. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Uri.js +44 -21
  168. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Util.js +49 -12
  169. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/lib/big.js +14 -11
  170. package/dist/fable_modules/fable-library-js.5.17.2/package.json +24 -0
  171. package/dist/fable_modules/fable-library-js.5.17.2/quotation.js +682 -0
  172. package/package.json +4 -4
  173. package/src/Glutinum.Converter/js/bootstrap.js +109 -2
  174. package/src/Glutinum.Converter/js/host.js +144 -0
  175. package/src/Glutinum.Converter/js/npm.js +137 -0
  176. package/src/Glutinum.Converter/js/resolve.js +402 -0
  177. package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
  178. package/dist/Glutinum.Converter/Generate.js.map +0 -1
  179. package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
  180. package/dist/Glutinum.Converter/Log.js.map +0 -1
  181. package/dist/Glutinum.Converter/Merge.js.map +0 -1
  182. package/dist/Glutinum.Converter/Printer.js.map +0 -1
  183. package/dist/Glutinum.Converter/Read.js.map +0 -1
  184. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
  185. package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
  186. package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
  187. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
  188. package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
  189. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
  190. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
  191. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
  192. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
  193. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
  194. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
  195. package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
  196. package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
  197. package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
  198. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
  199. package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
  200. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
  201. package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
  202. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
  203. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
  204. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
  205. package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
  206. package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
  207. package/dist/Glutinum.Converter/Transform.js.map +0 -1
  208. package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
  209. package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
  210. package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
  211. package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
  212. package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
  213. package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
  214. package/dist/Program.js.map +0 -1
  215. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
  216. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
  217. package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
  218. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
  219. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
  220. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
  221. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
  222. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
  223. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
  224. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
  225. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
  226. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
  227. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
  228. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
  229. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
  230. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
  231. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
  232. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
  233. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
  234. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
  235. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
  236. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
  237. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
  238. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
  239. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
  240. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
  241. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
  242. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
  243. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
  244. package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
  245. package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
  246. package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
  247. package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
  248. package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
  249. package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
  250. package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
  251. package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
  252. package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
  253. package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
  254. package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
  255. package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
  256. package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
  257. package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
  258. package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
  259. package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
  260. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
  261. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
  262. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
  263. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
  264. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
  265. package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
  266. package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
  267. package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
  268. package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
  269. package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
  270. package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
  271. package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
  272. package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
  273. package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
  274. package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
  275. package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
  276. package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
  277. package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
  278. package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
  279. package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
  280. package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
  281. package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
  282. package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
  283. package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
  284. package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
  285. package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
  286. package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
  287. package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
  288. package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
  289. package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
  290. package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
  291. package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
  292. package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
  293. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
  294. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
  295. package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
  296. package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
  297. package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
  298. package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
  299. package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
  300. package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
  301. package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
  302. package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
  303. package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
  304. package/dist/fable_modules/project_cracked.json +0 -1
  305. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionOp.fs +0 -0
  306. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOp.fs +0 -0
  307. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionOp.fs +0 -0
  308. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationOp.fs +0 -0
  309. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOp.fs +0 -0
  310. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionOp.fs +0 -0
  311. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationOp.fs +0 -0
  312. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -0
  313. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  314. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -0
  315. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/FSharp.Core.CompilerServices.js +0 -0
  316. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/README.md +0 -0
  317. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Timer.js +0 -0
  318. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Unicode.13.0.0.js +0 -0
  319. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/big.d.ts +0 -0
@@ -1,39 +1,49 @@
1
- import { defaultArg, some } from "../../fable_modules/fable-library-js.4.14.0/Option.js";
2
- import { tryParse } from "../../fable_modules/fable-library-js.4.14.0/Int32.js";
3
- import { FSharpRef } from "../../fable_modules/fable-library-js.4.14.0/Types.js";
4
- import { GlueAccessor, GlueLiteral } from "../GlueAST.js";
5
- import { tryParse as tryParse_1 } from "../../fable_modules/fable-library-js.4.14.0/Double.js";
6
- import { class_type } from "../../fable_modules/fable-library-js.4.14.0/Reflection.js";
7
- import { toList, exists } from "../../fable_modules/fable-library-js.4.14.0/Seq.js";
8
- import { ofArray, contains, collect, empty, map } from "../../fable_modules/fable-library-js.4.14.0/List.js";
9
- import { endsWith } from "../../fable_modules/fable-library-js.4.14.0/String.js";
10
- import { stringHash } from "../../fable_modules/fable-library-js.4.14.0/Util.js";
11
- import { FSharpChoice$3, FSharpChoice$2 } from "../../fable_modules/fable-library-js.4.14.0/Choice.js";
1
+
2
+ import { orElse, defaultArg, some } from "../../fable_modules/fable-library-js.5.17.2/Option.js";
3
+ import { tryParse } from "../../fable_modules/fable-library-js.5.17.2/Int32.js";
4
+ import { FSharpRef } from "../../fable_modules/fable-library-js.5.17.2/Types.js";
5
+ import { GlueTypeParameter, GlueType, GlueAccessor, GlueLiteral } from "../GlueAST.js";
6
+ import { tryParse as tryParse_1 } from "../../fable_modules/fable-library-js.5.17.2/Double.js";
7
+ import { comparePrimitives, stringHash, defaultOf } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
8
+ import { Operators_IsNull } from "../../fable_modules/fable-library-js.5.17.2/FSharp.Core.js";
9
+ import { class_type } from "../../fable_modules/fable-library-js.5.17.2/Reflection.js";
10
+ import { tryPick, last, toList, tryHead, exists } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
11
+ import { PackageContext__ModulePath_Z55EFCE8F, PackageContext__IsEntryFile_Z721C83C5, PackageContext__IsExternal_Z721C83C5, PackageContext__TryFindExternalModulePath_Z721C83C5, PackageContext__TryFindPackage_Z721C83C5 } from "./Types.js";
12
+ import { append, cons, tryHead as tryHead_1, exists as exists_1, tryFind, isEmpty, filter, head, tryItem, mapIndexed, choose, ofArray, contains, collect as collect_1, empty, map as map_1 } from "../../fable_modules/fable-library-js.5.17.2/List.js";
13
+ import { item } from "../../fable_modules/fable-library-js.5.17.2/Array.js";
14
+ import { normalizePath } from "../Utils/String.js";
15
+ import { contains as contains_1, ofSeq } from "../../fable_modules/fable-library-js.5.17.2/Set.js";
16
+ import { ofList, empty as empty_1 } from "../../fable_modules/fable-library-js.5.17.2/Map.js";
17
+ import { replace } from "../../fable_modules/fable-library-js.5.17.2/RegExp.js";
18
+ import { sanitizeTypeName, removeSurroundingQuotes } from "../Utils/Naming.js";
19
+ import { substring } from "../../fable_modules/fable-library-js.5.17.2/String.js";
20
+ import { ts } from "@ts-morph/bootstrap";
21
+ import { FSharpChoice$3, FSharpChoice$2 } from "../../fable_modules/fable-library-js.5.17.2/Choice.js";
12
22
 
13
23
  export function $007CHasTypeFlags$007C_$007C(flag, flags) {
14
24
  if ((flags & flag) !== 0) {
15
- return some(void 0);
25
+ return some(undefined);
16
26
  }
17
27
  else {
18
- return void 0;
28
+ return undefined;
19
29
  }
20
30
  }
21
31
 
22
32
  export function $007CHasSymbolFlags$007C_$007C(flag, flags) {
23
33
  if ((flags & flag) !== 0) {
24
- return some(void 0);
34
+ return some(undefined);
25
35
  }
26
36
  else {
27
- return void 0;
37
+ return undefined;
28
38
  }
29
39
  }
30
40
 
31
41
  export function $007CHasObjectFlags$007C_$007C(flag, flags) {
32
42
  if ((flags & flag) !== 0) {
33
- return some(void 0);
43
+ return some(undefined);
34
44
  }
35
45
  else {
36
- return void 0;
46
+ return undefined;
37
47
  }
38
48
  }
39
49
 
@@ -50,11 +60,11 @@ function tryReadNumericLiteral(text) {
50
60
  if (isNumericString(text)) {
51
61
  let matchValue;
52
62
  let outArg = 0;
53
- matchValue = [tryParse(text, 511, false, 32, new FSharpRef(() => outArg, (v) => {
63
+ matchValue = [tryParse(text, 511, false, 32, new FSharpRef(() => (outArg | 0), (v) => {
54
64
  outArg = (v | 0);
55
65
  })), outArg];
56
66
  if (matchValue[0]) {
57
- return new GlueLiteral(1, [matchValue[1]]);
67
+ return new GlueLiteral(/* Int */ 1, [matchValue[1]]);
58
68
  }
59
69
  else {
60
70
  let matchValue_1;
@@ -63,45 +73,151 @@ function tryReadNumericLiteral(text) {
63
73
  outArg_1 = v_1;
64
74
  })), outArg_1];
65
75
  if (matchValue_1[0]) {
66
- return new GlueLiteral(2, [matchValue_1[1]]);
76
+ return new GlueLiteral(/* Float */ 2, [matchValue_1[1]]);
67
77
  }
68
78
  else {
69
- return void 0;
79
+ return undefined;
70
80
  }
71
81
  }
72
82
  }
73
83
  else {
74
- return void 0;
84
+ return undefined;
75
85
  }
76
86
  }
77
87
 
78
- export function tryReadLiteral(expression) {
79
- const matchValue = expression.kind | 0;
88
+ function isWrittenAsFloat(text) {
89
+ const lower = text.toLocaleLowerCase();
90
+ if ((lower.startsWith("0x") ? true : lower.startsWith("0b")) ? true : lower.startsWith("0o")) {
91
+ return false;
92
+ }
93
+ else if (text.indexOf(".") >= 0) {
94
+ return true;
95
+ }
96
+ else {
97
+ return lower.indexOf("e") >= 0;
98
+ }
99
+ }
100
+
101
+ export function tryReadLiteral(checker, expression) {
102
+ const matchValue = expression.kind;
103
+ let matchResult;
80
104
  switch (matchValue) {
81
- case 11: {
82
- const literal = expression;
83
- return new GlueLiteral(0, [literal.text]);
84
- }
85
- case 97:
86
- return new GlueLiteral(3, [false]);
87
- case 106:
88
- return new GlueLiteral(4, []);
89
- case 112:
90
- return new GlueLiteral(3, [true]);
105
+ case 11:
106
+ case 15: {
107
+ matchResult = 0;
108
+ break;
109
+ }
110
+ case 97: {
111
+ matchResult = 2;
112
+ break;
113
+ }
114
+ case 106: {
115
+ matchResult = 3;
116
+ break;
117
+ }
118
+ case 112: {
119
+ matchResult = 1;
120
+ break;
121
+ }
91
122
  default:
92
- return tryReadNumericLiteral(expression.getText());
123
+ if (expression.pos < 0) {
124
+ matchResult = 4;
125
+ }
126
+ else {
127
+ matchResult = 5;
128
+ }
129
+ }
130
+ switch (matchResult) {
131
+ case 0: {
132
+ const literal = expression;
133
+ return new GlueLiteral(/* String */ 0, [literal.text]);
134
+ }
135
+ case 1:
136
+ return new GlueLiteral(/* Bool */ 3, [true]);
137
+ case 2:
138
+ return new GlueLiteral(/* Bool */ 3, [false]);
139
+ case 3:
140
+ return GlueLiteral.Null;
141
+ case 4: {
142
+ const matchValue_1 = expression.text;
143
+ if (matchValue_1 === defaultOf()) {
144
+ return undefined;
145
+ }
146
+ else {
147
+ return tryReadNumericLiteral(matchValue_1);
148
+ }
149
+ }
150
+ default: {
151
+ const text_1 = expression.getText();
152
+ const resolvedType = checker.getTypeAtLocation(expression);
153
+ const matchValue_2 = resolvedType.flags;
154
+ if ($007CHasTypeFlags$007C_$007C(256, matchValue_2) != null) {
155
+ const value = resolvedType.value;
156
+ if (Number.isSafeInteger(value) && !isWrittenAsFloat(text_1)) {
157
+ return new GlueLiteral(/* Int */ 1, [value]);
158
+ }
159
+ else {
160
+ return new GlueLiteral(/* Float */ 2, [value]);
161
+ }
162
+ }
163
+ else {
164
+ return tryReadNumericLiteral(text_1);
165
+ }
166
+ }
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Nodes synthesized by <c>typeToTypeNode</c> have no source text
172
+ */
173
+ export function identifierText(node) {
174
+ if (Operators_IsNull(node.text)) {
175
+ return node.getText();
176
+ }
177
+ else {
178
+ return node.text;
179
+ }
180
+ }
181
+
182
+ /**
183
+ * The last name of `ns.Foo`, `Foo` for an identifier
184
+ */
185
+ export function entityNameText(node) {
186
+ if (node.kind === 166) {
187
+ return identifierText(node.right);
188
+ }
189
+ else {
190
+ return identifierText(node);
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Identifiers synthesized by <c>typeToTypeNode</c> carry their symbol, they can't be resolved by position
196
+ */
197
+ export function symbolAtLocation(checker, node) {
198
+ if (!Operators_IsNull(node.symbol)) {
199
+ return node.symbol;
200
+ }
201
+ else if ((node.kind === 166) && !Operators_IsNull(node.right.symbol)) {
202
+ return node.right.symbol;
203
+ }
204
+ else if (((node.kind === 166) && !Operators_IsNull(node.left.symbol)) && ((node.left.symbol.flags & 384) !== 0)) {
205
+ return node.left.symbol;
206
+ }
207
+ else {
208
+ return checker.getSymbolAtLocation(node);
93
209
  }
94
210
  }
95
211
 
96
212
  export function tryGetFullName(checker, node) {
97
- if (node.symbol == null) {
213
+ if (Operators_IsNull(node.symbol)) {
98
214
  const matchValue = checker.getSymbolAtLocation(node);
99
215
  if (matchValue != null) {
100
216
  const symbol = matchValue;
101
217
  return checker.getFullyQualifiedName(symbol);
102
218
  }
103
219
  else {
104
- return void 0;
220
+ return undefined;
105
221
  }
106
222
  }
107
223
  else {
@@ -119,18 +235,18 @@ export class ModifierUtil {
119
235
  }
120
236
 
121
237
  export function ModifierUtil_$reflection() {
122
- return class_type("Glutinum.Converter.Reader.Utils.ModifierUtil", void 0, ModifierUtil);
238
+ return class_type("Glutinum.Converter.Reader.Utils.ModifierUtil", undefined, ModifierUtil);
123
239
  }
124
240
 
125
241
  export function ModifierUtil_GetAccessor_693AB805(modifiers) {
126
242
  if (modifiers == null) {
127
- return new GlueAccessor(2, []);
243
+ return GlueAccessor.ReadWrite;
128
244
  }
129
245
  else if (exists((modifier) => (modifier.kind === 148), modifiers)) {
130
- return new GlueAccessor(0, []);
246
+ return GlueAccessor.ReadOnly;
131
247
  }
132
248
  else {
133
- return new GlueAccessor(2, []);
249
+ return GlueAccessor.ReadWrite;
134
250
  }
135
251
  }
136
252
 
@@ -151,22 +267,190 @@ export function ModifierUtil_HasModifier_Z687DC302(modifiers, modifier) {
151
267
  return ModifierUtil_HasModifier_Z39CCF48F(modifiers, modifier);
152
268
  }
153
269
 
270
+ /**
271
+ * `K extends keyof Map` where `Map` is a reference, the map gives the typed keys of `K`
272
+ */
273
+ export function tryReadKeyOfConstraint(reader, typeParameter) {
274
+ let option_5, option_3, option_1, symbol, matchValue_1, symbol_1, declarations, matchValue_2, matchValue_3, declaration, packageContext, constraintNode;
275
+ const matchValue = typeParameter.constraint;
276
+ let matchResult, constraintNode_1;
277
+ if (matchValue != null) {
278
+ if ((constraintNode = matchValue, constraintNode.kind === 198)) {
279
+ matchResult = 0;
280
+ constraintNode_1 = matchValue;
281
+ }
282
+ else {
283
+ matchResult = 1;
284
+ }
285
+ }
286
+ else {
287
+ matchResult = 1;
288
+ }
289
+ switch (matchResult) {
290
+ case 0: {
291
+ const typeOperator = constraintNode_1;
292
+ if ((typeOperator.operator === 143) && (typeOperator.type.kind === 183)) {
293
+ const typeReferenceNode = typeOperator.type;
294
+ if (defaultArg((option_5 = ((option_3 = ((option_1 = symbolAtLocation(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), typeReferenceNode.typeName), (option_1 != null) ? ((symbol = option_1, (matchValue_1 = symbol.flags, ($007CHasSymbolFlags$007C_$007C(2097152, matchValue_1) != null) ? reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getAliasedSymbol(symbol) : symbol))) : undefined)), (option_3 != null) ? ((symbol_1 = option_3, symbol_1.declarations)) : undefined)), (option_5 != null) ? ((declarations = option_5, ((matchValue_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), (matchValue_3 = tryHead(declarations), (matchValue_2 != null) && ((matchValue_3 != null) && ((declaration = matchValue_3, (packageContext = matchValue_2, PackageContext__TryFindPackage_Z721C83C5(packageContext, declaration.getSourceFile().fileName) == null))))))) && !exists((declaration_1) => {
295
+ const matchValue_5 = declaration_1.kind;
296
+ switch (matchValue_5) {
297
+ case 263:
298
+ case 264:
299
+ return true;
300
+ default:
301
+ return false;
302
+ }
303
+ }, declarations))) : undefined), false)) {
304
+ return undefined;
305
+ }
306
+ else {
307
+ const matchValue_6 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeOperator.type);
308
+ if (matchValue_6.tag === 13) {
309
+ return new GlueType(/* KeyOf */ 9, [matchValue_6]);
310
+ }
311
+ else {
312
+ return undefined;
313
+ }
314
+ }
315
+ }
316
+ else {
317
+ return undefined;
318
+ }
319
+ }
320
+ default:
321
+ return undefined;
322
+ }
323
+ }
324
+
325
+ /**
326
+ * The type parameters of a member: only a `keyof` constraint is kept
327
+ */
328
+ export function readMemberTypeParameters(reader, typeParameters) {
329
+ if (typeParameters != null) {
330
+ return map_1((typeParameter) => {
331
+ let option_1, typNode;
332
+ return new GlueTypeParameter(identifierText(typeParameter.name), tryReadKeyOfConstraint(reader, typeParameter), (option_1 = typeParameter.default, (option_1 != null) ? ((typNode = option_1, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode))) : undefined));
333
+ }, toList(typeParameters));
334
+ }
335
+ else {
336
+ return empty();
337
+ }
338
+ }
339
+
340
+ /**
341
+ * `[string, number]` and the tuple `Parameters<F>` resolves to
342
+ */
343
+ export function isTupleType(typ) {
344
+ const matchValue = typ.flags;
345
+ if ($007CHasTypeFlags$007C_$007C(524288, matchValue) != null) {
346
+ const objectFlags = typ.objectFlags;
347
+ const target = typ.target;
348
+ if ((objectFlags & 8) !== 0) {
349
+ return true;
350
+ }
351
+ else if (!Operators_IsNull(target)) {
352
+ return (target.objectFlags & 8) !== 0;
353
+ }
354
+ else {
355
+ return false;
356
+ }
357
+ }
358
+ else {
359
+ return false;
360
+ }
361
+ }
362
+
154
363
  export function readTypeArguments(reader, node) {
155
364
  const matchValue = node.typeArguments;
156
365
  if (matchValue != null) {
157
- return map((arg) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](arg), toList(matchValue));
366
+ return map_1((arg) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](arg), toList(matchValue));
158
367
  }
159
368
  else {
160
369
  return empty();
161
370
  }
162
371
  }
163
372
 
373
+ /**
374
+ * The type arguments the checker resolved for a type alias or an object type reference
375
+ */
376
+ export function resolvedTypeArguments(checker, typ) {
377
+ const aliasTypeArguments = typ.aliasTypeArguments;
378
+ const matchValue = typ.aliasSymbol;
379
+ let matchResult, aliasTypeArguments_1;
380
+ if (matchValue != null) {
381
+ if (aliasTypeArguments != null) {
382
+ matchResult = 0;
383
+ aliasTypeArguments_1 = aliasTypeArguments;
384
+ }
385
+ else {
386
+ matchResult = 1;
387
+ }
388
+ }
389
+ else {
390
+ matchResult = 1;
391
+ }
392
+ switch (matchResult) {
393
+ case 0:
394
+ return toList(aliasTypeArguments_1);
395
+ default: {
396
+ const matchValue_2 = typ.flags;
397
+ let matchResult_1;
398
+ if ($007CHasTypeFlags$007C_$007C(524288, matchValue_2) != null) {
399
+ if ((typ.objectFlags & 4) !== 0) {
400
+ matchResult_1 = 0;
401
+ }
402
+ else {
403
+ matchResult_1 = 1;
404
+ }
405
+ }
406
+ else {
407
+ matchResult_1 = 1;
408
+ }
409
+ switch (matchResult_1) {
410
+ case 0:
411
+ return toList(checker.getTypeArguments(typ));
412
+ default:
413
+ return empty();
414
+ }
415
+ }
416
+ }
417
+ }
418
+
419
+ /**
420
+ * `class X extends TempNode` where `const TempNode: { new<T = unknown>(): TempNode<T> }`:
421
+ * the type arguments of the base type the checker instantiated
422
+ */
423
+ export function resolvedBaseTypeArguments(checker, expression) {
424
+ let option_1;
425
+ const heritageClause = expression.parent;
426
+ let isValue;
427
+ const matchValue = checker.getSymbolAtLocation(expression.expression);
428
+ if (matchValue == null) {
429
+ isValue = false;
430
+ }
431
+ else {
432
+ const symbol = matchValue;
433
+ let symbol_1;
434
+ const matchValue_1 = symbol.flags;
435
+ symbol_1 = (($007CHasSymbolFlags$007C_$007C(2097152, matchValue_1) != null) ? checker.getAliasedSymbol(symbol) : symbol);
436
+ const matchValue_2 = symbol_1.flags;
437
+ isValue = ($007CHasSymbolFlags$007C_$007C(3, matchValue_2) != null);
438
+ }
439
+ if ((((Operators_IsNull(heritageClause) ? true : (heritageClause.kind !== 298)) ? true : (heritageClause.token !== 96)) ? true : (heritageClause.parent.kind !== 263)) ? true : !isValue) {
440
+ return empty();
441
+ }
442
+ else {
443
+ const classType = checker.getTypeAtLocation(heritageClause.parent);
444
+ return defaultArg((option_1 = tryHead(checker.getBaseTypes(classType)), (option_1 != null) ? resolvedTypeArguments(checker, option_1) : undefined), empty());
445
+ }
446
+ }
447
+
164
448
  export function readHeritageClauses(reader, heritageClauses) {
165
449
  if (heritageClauses == null) {
166
450
  return empty();
167
451
  }
168
452
  else {
169
- return collect((clause) => map((typNode) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode), toList(clause.types)), toList(heritageClauses));
453
+ return collect_1((clause) => map_1((typNode) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode), toList(clause.types)), toList(heritageClauses));
170
454
  }
171
455
  }
172
456
 
@@ -181,9 +465,12 @@ export function isFromEs5Lib(symbolOpt) {
181
465
  const matchValue = symbol.declarations;
182
466
  if (matchValue != null) {
183
467
  const declarations = matchValue;
184
- if (declarations[0].parent.kind === 312) {
185
- const sourceFile = declarations[0].parent;
186
- return endsWith(sourceFile.fileName, "lib/lib.es5.d.ts");
468
+ if ((declarations.length === 0) ? true : Operators_IsNull(item(0, declarations).parent)) {
469
+ return false;
470
+ }
471
+ else if (item(0, declarations).parent.kind === 312) {
472
+ const sourceFile = item(0, declarations).parent;
473
+ return sourceFile.fileName.endsWith("lib/lib.es5.d.ts");
187
474
  }
188
475
  else {
189
476
  return false;
@@ -192,7 +479,7 @@ export function isFromEs5Lib(symbolOpt) {
192
479
  else {
193
480
  return contains(symbol.name, ofArray(["Iterable", "IterableIterator"]), {
194
481
  Equals: (x, y) => (x === y),
195
- GetHashCode: stringHash,
482
+ GetHashCode: (x) => (stringHash(x) | 0),
196
483
  });
197
484
  }
198
485
  }
@@ -201,31 +488,832 @@ export function isFromEs5Lib(symbolOpt) {
201
488
  }
202
489
  }
203
490
 
491
+ /**
492
+ * `PromiseConstructor` of `lib.es2015.promise.d.ts`: a type of the ECMAScript libraries
493
+ */
494
+ export function isFromEsLib(symbolOpt) {
495
+ let declarations;
496
+ if (symbolOpt != null) {
497
+ const symbol = symbolOpt;
498
+ const matchValue = symbol.declarations;
499
+ let matchResult, declarations_1;
500
+ if (matchValue != null) {
501
+ if ((declarations = matchValue, declarations.length > 0)) {
502
+ matchResult = 0;
503
+ declarations_1 = matchValue;
504
+ }
505
+ else {
506
+ matchResult = 1;
507
+ }
508
+ }
509
+ else {
510
+ matchResult = 1;
511
+ }
512
+ switch (matchResult) {
513
+ case 0: {
514
+ const fileName = normalizePath(item(0, declarations_1).getSourceFile().fileName);
515
+ return fileName.indexOf("/lib/lib.es") >= 0;
516
+ }
517
+ default:
518
+ return false;
519
+ }
520
+ }
521
+ else {
522
+ return false;
523
+ }
524
+ }
525
+
526
+ export const knownExternalTypeNames = ofSeq(["Date", "Promise", "Array", "ReadonlyArray", "Boolean", "Function", "Error", "RegExp", "Iterable", "IterableIterator", "IteratorObject", "ArrayIterator", "MapIterator", "SetIterator", "StringIterator", "Uint8Array", "Int8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array"], {
527
+ Compare: (x, y) => (comparePrimitives(x, y) | 0),
528
+ });
529
+
530
+ export function resolveAlias(checker, symbol) {
531
+ const matchValue = symbol.flags;
532
+ if ($007CHasSymbolFlags$007C_$007C(2097152, matchValue) != null) {
533
+ try {
534
+ const aliased = checker.getAliasedSymbol(symbol);
535
+ return Operators_IsNull(aliased) ? undefined : aliased;
536
+ }
537
+ catch (matchValue_1) {
538
+ return undefined;
539
+ }
540
+ }
541
+ else {
542
+ return symbol;
543
+ }
544
+ }
545
+
546
+ /**
547
+ * Name of the declaration behind an `import { X as Y }` alias, `None` for a non-renamed symbol
548
+ * `Omit<LabelOption, "rotate">` where `interface LabelOption<T = Params>`: `T` is `Params`
549
+ */
550
+ export function defaultTypeArguments(reader, typeNode) {
551
+ let option_16, option_7, option_5, option_3, option, binder, checker, option_1, symbol_1, declaration;
552
+ if (typeNode.kind !== 183) {
553
+ return empty_1({
554
+ Compare: (x, y) => (comparePrimitives(x, y) | 0),
555
+ });
556
+ }
557
+ else {
558
+ const typeReferenceNode = typeNode;
559
+ let typeArguments_1;
560
+ const matchValue = typeReferenceNode.typeArguments;
561
+ typeArguments_1 = ((matchValue == null) ? empty() : toList(matchValue));
562
+ return defaultArg((option_16 = ((option_7 = ((option_5 = ((option_3 = ((option = symbolAtLocation(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), typeReferenceNode.typeName), (binder = ((checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), (symbol) => resolveAlias(checker, symbol))), (option_1 = option, (option_1 != null) ? binder(option_1) : undefined)))), (option_3 != null) ? ((symbol_1 = option_3, symbol_1.declarations)) : undefined)), (option_5 != null) ? tryHead(option_5) : undefined)), (option_7 != null) ? ((declaration = option_7, declaration.typeParameters)) : undefined)), (option_16 != null) ? ofList(choose((tupledArg) => {
563
+ const option_14 = tupledArg[1];
564
+ if (option_14 != null) {
565
+ return [tupledArg[0], option_14];
566
+ }
567
+ else {
568
+ return undefined;
569
+ }
570
+ }, mapIndexed((index, typeParameter) => {
571
+ let option_9, arg, option_11, typNode_1;
572
+ const argument = orElse((option_9 = tryItem(index, typeArguments_1), (option_9 != null) ? ((arg = option_9, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](arg))) : undefined), (option_11 = typeParameter.default, (option_11 != null) ? ((typNode_1 = option_11, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode_1))) : undefined));
573
+ return [identifierText(typeParameter.name), argument];
574
+ }, toList(option_16))), {
575
+ Compare: (x_1, y_1) => (comparePrimitives(x_1, y_1) | 0),
576
+ }) : undefined), empty_1({
577
+ Compare: (x_2, y_2) => (comparePrimitives(x_2, y_2) | 0),
578
+ }));
579
+ }
580
+ }
581
+
582
+ /**
583
+ * `export default class DatasetController`: the name of the declaration behind the `default` symbol
584
+ */
585
+ export function declaredName(symbol) {
586
+ let option_3;
587
+ const option_1 = symbol.declarations;
588
+ option_3 = ((option_1 != null) ? tryHead(option_1) : undefined);
589
+ if (option_3 != null) {
590
+ const declaration = option_3;
591
+ if (declaration.kind === 277) {
592
+ const expression = declaration.expression;
593
+ if (expression.kind === 80) {
594
+ return identifierText(expression);
595
+ }
596
+ else {
597
+ return undefined;
598
+ }
599
+ }
600
+ else {
601
+ const name = declaration.name;
602
+ if (Operators_IsNull(name)) {
603
+ return undefined;
604
+ }
605
+ else {
606
+ return identifierText(name);
607
+ }
608
+ }
609
+ }
610
+ else {
611
+ return undefined;
612
+ }
613
+ }
614
+
615
+ export function importedName(checker, symbol) {
616
+ let target, target_1;
617
+ const matchValue = symbol.flags;
618
+ if ($007CHasSymbolFlags$007C_$007C(2097152, matchValue) != null) {
619
+ const matchValue_1 = resolveAlias(checker, symbol);
620
+ let matchResult, target_2, target_3;
621
+ if (matchValue_1 != null) {
622
+ if ((target = matchValue_1, target.name === "default")) {
623
+ matchResult = 0;
624
+ target_2 = matchValue_1;
625
+ }
626
+ else if ((target_1 = matchValue_1, (target_1.name !== symbol.name) && (target_1.name !== "export="))) {
627
+ matchResult = 1;
628
+ target_3 = matchValue_1;
629
+ }
630
+ else {
631
+ matchResult = 2;
632
+ }
633
+ }
634
+ else {
635
+ matchResult = 2;
636
+ }
637
+ switch (matchResult) {
638
+ case 0:
639
+ return declaredName(target_2);
640
+ case 1:
641
+ return target_3.name;
642
+ default:
643
+ return undefined;
644
+ }
645
+ }
646
+ else if (symbol.name === "default") {
647
+ return declaredName(symbol);
648
+ }
649
+ else {
650
+ return undefined;
651
+ }
652
+ }
653
+
654
+ function fileOfDeclaration(declaration) {
655
+ return normalizePath(declaration.getSourceFile().fileName);
656
+ }
657
+
658
+ function isTypeDeclaration(declaration) {
659
+ const matchValue = declaration.kind;
660
+ switch (matchValue) {
661
+ case 263:
662
+ case 264:
663
+ case 265:
664
+ case 266:
665
+ case 267:
666
+ return true;
667
+ default:
668
+ return false;
669
+ }
670
+ }
671
+
672
+ /**
673
+ * The declaration the symbol is read from and referenced by. The first one, unless it belongs
674
+ * to an external binding while another one belongs to a generated package (<c>AbortSignal</c>
675
+ * of the DOM lib redeclared by <c>@types/node</c>), or the entry file of its package declares
676
+ * it too (<c>NodeList</c> of <c>iterable.d.ts</c> and <c>index.d.ts</c>).
677
+ */
678
+ export function mainDeclaration(packageContext, symbol) {
679
+ let declarations;
680
+ const matchValue = symbol.declarations;
681
+ let matchResult, declarations_1;
682
+ if (matchValue != null) {
683
+ if ((declarations = matchValue, declarations.length > 0)) {
684
+ matchResult = 0;
685
+ declarations_1 = matchValue;
686
+ }
687
+ else {
688
+ matchResult = 1;
689
+ }
690
+ }
691
+ else {
692
+ matchResult = 1;
693
+ }
694
+ switch (matchResult) {
695
+ case 0: {
696
+ const declarations_2 = toList(declarations_1);
697
+ const first = head(declarations_2);
698
+ if (packageContext != null) {
699
+ const packageContext_1 = packageContext;
700
+ const generated = filter((declaration) => {
701
+ if (PackageContext__TryFindPackage_Z721C83C5(packageContext_1, fileOfDeclaration(declaration)) != null) {
702
+ return isTypeDeclaration(declaration) === isTypeDeclaration(first);
703
+ }
704
+ else {
705
+ return false;
706
+ }
707
+ }, declarations_2);
708
+ const candidates = ((PackageContext__TryFindExternalModulePath_Z721C83C5(packageContext_1, fileOfDeclaration(first)) != null) && !isEmpty(generated)) ? generated : declarations_2;
709
+ const first_1 = head(candidates);
710
+ const matchValue_1 = PackageContext__TryFindPackage_Z721C83C5(packageContext_1, fileOfDeclaration(first_1));
711
+ if (matchValue_1 == null) {
712
+ return first_1;
713
+ }
714
+ else {
715
+ const package$ = matchValue_1;
716
+ return defaultArg(tryFind((declaration_1) => {
717
+ if (declaration_1.kind === first_1.kind) {
718
+ return fileOfDeclaration(declaration_1) === package$.EntryFile;
719
+ }
720
+ else {
721
+ return false;
722
+ }
723
+ }, candidates), first_1);
724
+ }
725
+ }
726
+ else {
727
+ return first;
728
+ }
729
+ }
730
+ default:
731
+ return undefined;
732
+ }
733
+ }
734
+
735
+ /**
736
+ * In package mode, the interface declarations of the symbol in other files of the same package:
737
+ * they are merged into the main declaration
738
+ */
739
+ export function otherFileInterfaceDeclarations(packageContext, symbol, declaration) {
740
+ const matchValue = symbol.declarations;
741
+ let matchResult, declarations, packageContext_1;
742
+ if (packageContext != null) {
743
+ if (matchValue != null) {
744
+ matchResult = 0;
745
+ declarations = matchValue;
746
+ packageContext_1 = packageContext;
747
+ }
748
+ else {
749
+ matchResult = 1;
750
+ }
751
+ }
752
+ else {
753
+ matchResult = 1;
754
+ }
755
+ switch (matchResult) {
756
+ case 0: {
757
+ const matchValue_2 = PackageContext__TryFindPackage_Z721C83C5(packageContext_1, fileOfDeclaration(declaration));
758
+ if (matchValue_2 == null) {
759
+ return empty();
760
+ }
761
+ else {
762
+ const package$ = matchValue_2;
763
+ return map_1((other_1) => other_1, filter((other) => {
764
+ if ((other.kind === 264) && (fileOfDeclaration(other) !== fileOfDeclaration(declaration))) {
765
+ const matchValue_3 = PackageContext__TryFindPackage_Z721C83C5(packageContext_1, fileOfDeclaration(other));
766
+ if (matchValue_3 == null) {
767
+ return false;
768
+ }
769
+ else {
770
+ return matchValue_3.Dir === package$.Dir;
771
+ }
772
+ }
773
+ else {
774
+ return false;
775
+ }
776
+ }, toList(declarations)));
777
+ }
778
+ }
779
+ default:
780
+ return empty();
781
+ }
782
+ }
783
+
784
+ /**
785
+ * An interface declaration merged into the main declaration of another file
786
+ */
787
+ export function isMergedInterfaceDeclaration(checker, packageContext, statement) {
788
+ const matchValue = statement.kind;
789
+ let matchResult;
790
+ if (packageContext != null) {
791
+ if (matchValue === 264) {
792
+ matchResult = 0;
793
+ }
794
+ else {
795
+ matchResult = 1;
796
+ }
797
+ }
798
+ else {
799
+ matchResult = 1;
800
+ }
801
+ switch (matchResult) {
802
+ case 0: {
803
+ const declaration = statement;
804
+ const matchValue_2 = checker.getSymbolAtLocation(declaration.name);
805
+ if (matchValue_2 == null) {
806
+ return false;
807
+ }
808
+ else {
809
+ const symbol = matchValue_2;
810
+ const matchValue_3 = mainDeclaration(packageContext, symbol);
811
+ if (matchValue_3 == null) {
812
+ return false;
813
+ }
814
+ else {
815
+ const main = matchValue_3;
816
+ if (!(main === statement) && !isEmpty(otherFileInterfaceDeclarations(packageContext, symbol, main))) {
817
+ return fileOfDeclaration(main) !== fileOfDeclaration(statement);
818
+ }
819
+ else {
820
+ return false;
821
+ }
822
+ }
823
+ }
824
+ }
825
+ default:
826
+ return false;
827
+ }
828
+ }
829
+
830
+ function declarationFile(packageContext, symbol) {
831
+ let declaration;
832
+ const option_1 = mainDeclaration(packageContext, symbol);
833
+ if (option_1 != null) {
834
+ return (declaration = option_1, normalizePath(declaration.getSourceFile().fileName));
835
+ }
836
+ else {
837
+ return undefined;
838
+ }
839
+ }
840
+
841
+ /**
842
+ * In package mode, whether the symbol is declared outside every package being generated
843
+ */
844
+ export function isExternalToPackages(checker, packageContext, symbolOpt) {
845
+ let matchResult, packageContext_1, symbol;
846
+ if (packageContext != null) {
847
+ if (symbolOpt != null) {
848
+ matchResult = 0;
849
+ packageContext_1 = packageContext;
850
+ symbol = symbolOpt;
851
+ }
852
+ else {
853
+ matchResult = 1;
854
+ }
855
+ }
856
+ else {
857
+ matchResult = 1;
858
+ }
859
+ switch (matchResult) {
860
+ case 0: {
861
+ const matchValue_1 = resolveAlias(checker, symbol);
862
+ if (matchValue_1 != null) {
863
+ const matchValue_2 = declarationFile(packageContext_1, matchValue_1);
864
+ if (matchValue_2 == null) {
865
+ return true;
866
+ }
867
+ else {
868
+ return PackageContext__IsExternal_Z721C83C5(packageContext_1, matchValue_2);
869
+ }
870
+ }
871
+ else {
872
+ return true;
873
+ }
874
+ }
875
+ default:
876
+ return false;
877
+ }
878
+ }
879
+
880
+ /**
881
+ * The ambient module (<c>declare module "os" { ... }</c>) a file is made of: its members are
882
+ * the members of the file and its types are not nested in a module named after it.
883
+ * A file also declaring other things keeps its ambient modules nested. When several ambient
884
+ * modules are declared, the one named like the file wins, then the first one.
885
+ */
886
+ export function promotedAmbientModule(sourceFile) {
887
+ const isAmbientModule = (statement) => {
888
+ if (statement.kind === 267) {
889
+ return statement.name.kind === 11;
890
+ }
891
+ else {
892
+ return false;
893
+ }
894
+ };
895
+ const statements = toList(sourceFile.statements);
896
+ if (exists_1((statement_1) => {
897
+ const matchValue = statement_1.kind;
898
+ switch (matchValue) {
899
+ case 242:
900
+ case 271:
901
+ case 272:
902
+ case 278:
903
+ return false;
904
+ default:
905
+ return !isAmbientModule(statement_1);
906
+ }
907
+ }, statements)) {
908
+ return undefined;
909
+ }
910
+ else {
911
+ const ambientModules = map_1((statement_2) => statement_2, filter(isAmbientModule, statements));
912
+ const fileName = replace(last(normalizePath(sourceFile.fileName).split("/")), "\\.d\\.[cm]?ts$", "");
913
+ const namedLikeTheFile = filter((moduleDeclaration_2) => {
914
+ let name;
915
+ return ((name = removeSurroundingQuotes(moduleDeclaration_2.name.text), name.startsWith("node:") ? substring(name, "node:".length) : name)) === fileName;
916
+ }, ambientModules);
917
+ return orElse(orElse(tryFind((moduleDeclaration_1) => {
918
+ let body;
919
+ const matchValue_1 = moduleDeclaration_1.body;
920
+ let matchResult, body_1;
921
+ if (matchValue_1 != null) {
922
+ if ((body = matchValue_1, body.kind === 268)) {
923
+ matchResult = 0;
924
+ body_1 = matchValue_1;
925
+ }
926
+ else {
927
+ matchResult = 1;
928
+ }
929
+ }
930
+ else {
931
+ matchResult = 1;
932
+ }
933
+ switch (matchResult) {
934
+ case 0:
935
+ return exists((statement_3) => (statement_3.kind !== 278), body_1.statements);
936
+ default:
937
+ return false;
938
+ }
939
+ }, namedLikeTheFile), tryHead_1(namedLikeTheFile)), tryHead_1(ambientModules));
940
+ }
941
+ }
942
+
943
+ export function isPromotedAmbientModule(declaration) {
944
+ const parent = declaration.parent;
945
+ if (!Operators_IsNull(parent) && (parent.kind === 312)) {
946
+ const matchValue = promotedAmbientModule(parent);
947
+ if (matchValue == null) {
948
+ return false;
949
+ }
950
+ else {
951
+ return matchValue === declaration;
952
+ }
953
+ }
954
+ else {
955
+ return false;
956
+ }
957
+ }
958
+
959
+ /**
960
+ * Whether a top-level declaration of a module file is reachable from the outside: through
961
+ * `export` or an `export { x }` list. Declarations of a script and of an ambient namespace
962
+ * always are, `export default x` and `export = x` are read by their own statement.
963
+ */
964
+ export function isExportedDeclaration(statement, names) {
965
+ let hasExportModifier;
966
+ const modifiers = statement.modifiers;
967
+ hasExportModifier = ((modifiers == null) ? false : exists((modifier) => (modifier.kind === 95), modifiers));
968
+ const isInsideNamespace = statement.parent.kind === 268;
969
+ const isGlobal = (statement.parent.kind === 312) && !ts.isExternalModule(statement.getSourceFile());
970
+ const isInExportList = (statement.parent.kind === 312) && exists((other) => {
971
+ let exportClause;
972
+ if (other.kind === 278) {
973
+ const exportDeclaration = other;
974
+ if (exportDeclaration.moduleSpecifier == null) {
975
+ const matchValue_1 = exportDeclaration.exportClause;
976
+ let matchResult, exportClause_1;
977
+ if (matchValue_1 != null) {
978
+ if ((exportClause = matchValue_1, exportClause.kind === 279)) {
979
+ matchResult = 0;
980
+ exportClause_1 = matchValue_1;
981
+ }
982
+ else {
983
+ matchResult = 1;
984
+ }
985
+ }
986
+ else {
987
+ matchResult = 1;
988
+ }
989
+ switch (matchResult) {
990
+ case 0:
991
+ return exists((specifier) => {
992
+ let matchValue_2;
993
+ return contains_1(identifierText((matchValue_2 = specifier.propertyName, (matchValue_2 == null) ? specifier.name : matchValue_2)), names);
994
+ }, exportClause_1.elements);
995
+ default:
996
+ return false;
997
+ }
998
+ }
999
+ else {
1000
+ return false;
1001
+ }
1002
+ }
1003
+ else {
1004
+ return false;
1005
+ }
1006
+ }, statement.getSourceFile().statements);
1007
+ if ((hasExportModifier ? true : isInsideNamespace) ? true : isGlobal) {
1008
+ return true;
1009
+ }
1010
+ else {
1011
+ return isInExportList;
1012
+ }
1013
+ }
1014
+
1015
+ /**
1016
+ * `declare class Dispatcher {}; export default Dispatcher` or `export = Dispatcher`
1017
+ */
1018
+ export function isExportAssignmentTarget(statement, names) {
1019
+ if (statement.parent.kind === 312) {
1020
+ return exists((other) => {
1021
+ if (other.kind === 277) {
1022
+ const expression = other.expression;
1023
+ if (expression.kind === 80) {
1024
+ return contains_1(identifierText(expression), names);
1025
+ }
1026
+ else {
1027
+ return false;
1028
+ }
1029
+ }
1030
+ else {
1031
+ return false;
1032
+ }
1033
+ }, statement.getSourceFile().statements);
1034
+ }
1035
+ else {
1036
+ return false;
1037
+ }
1038
+ }
1039
+
1040
+ /**
1041
+ * `declare const wm: WebMidi; export { wm as WebMidi }`: the name the declaration is exported under
1042
+ */
1043
+ export function exportedAlias(statement, localName) {
1044
+ if (statement.parent.kind !== 312) {
1045
+ return undefined;
1046
+ }
1047
+ else {
1048
+ return tryPick((other) => {
1049
+ let exportClause;
1050
+ if (other.kind !== 278) {
1051
+ return undefined;
1052
+ }
1053
+ else {
1054
+ const exportDeclaration = other;
1055
+ const matchValue = exportDeclaration.exportClause;
1056
+ let matchResult, exportClause_1;
1057
+ if (matchValue != null) {
1058
+ if ((exportClause = matchValue, (exportDeclaration.moduleSpecifier == null) && (exportClause.kind === 279))) {
1059
+ matchResult = 0;
1060
+ exportClause_1 = matchValue;
1061
+ }
1062
+ else {
1063
+ matchResult = 1;
1064
+ }
1065
+ }
1066
+ else {
1067
+ matchResult = 1;
1068
+ }
1069
+ switch (matchResult) {
1070
+ case 0:
1071
+ return tryPick((specifier) => {
1072
+ const matchValue_1 = specifier.propertyName;
1073
+ let matchResult_1, propertyName_1;
1074
+ if (matchValue_1 != null) {
1075
+ if (identifierText(matchValue_1) === localName) {
1076
+ matchResult_1 = 0;
1077
+ propertyName_1 = matchValue_1;
1078
+ }
1079
+ else {
1080
+ matchResult_1 = 1;
1081
+ }
1082
+ }
1083
+ else {
1084
+ matchResult_1 = 1;
1085
+ }
1086
+ switch (matchResult_1) {
1087
+ case 0:
1088
+ return specifier.name.text;
1089
+ default:
1090
+ return undefined;
1091
+ }
1092
+ }, exportClause_1.elements);
1093
+ default:
1094
+ return undefined;
1095
+ }
1096
+ }
1097
+ }, statement.getSourceFile().statements);
1098
+ }
1099
+ }
1100
+
1101
+ export function isGlobalAugmentation(declaration) {
1102
+ return (declaration.flags & 2048) !== 0;
1103
+ }
1104
+
1105
+ /**
1106
+ * A script file of a package which is not its entry: its declarations are globals of the package
1107
+ */
1108
+ export function isGlobalScriptOfPackage(packageContext, sourceFile) {
1109
+ if (packageContext == null) {
1110
+ return false;
1111
+ }
1112
+ else {
1113
+ const packageContext_1 = packageContext;
1114
+ if (!ts.isExternalModule(sourceFile) && (promotedAmbientModule(sourceFile) == null)) {
1115
+ return !PackageContext__IsEntryFile_Z721C83C5(packageContext_1, sourceFile.fileName);
1116
+ }
1117
+ else {
1118
+ return false;
1119
+ }
1120
+ }
1121
+ }
1122
+
1123
+ function isAmbientModuleDeclaration(node) {
1124
+ if (node.kind === 267) {
1125
+ return node.name.kind === 11;
1126
+ }
1127
+ else {
1128
+ return false;
1129
+ }
1130
+ }
1131
+
1132
+ /**
1133
+ * In package mode, a declaration of a `global { }` block or of a script file is a global of the package,
1134
+ * the `declare module "x"` of a script file are modules
1135
+ */
1136
+ export function isPackageGlobal(packageContext, declaration) {
1137
+ const inGlobalBlock = (node_mut) => {
1138
+ inGlobalBlock:
1139
+ while (true) {
1140
+ const node = node_mut;
1141
+ if (!Operators_IsNull(node)) {
1142
+ if ((node.kind === 267) && isGlobalAugmentation(node)) {
1143
+ return true;
1144
+ }
1145
+ else {
1146
+ node_mut = node.parent;
1147
+ continue inGlobalBlock;
1148
+ }
1149
+ }
1150
+ else {
1151
+ return false;
1152
+ }
1153
+ break;
1154
+ }
1155
+ };
1156
+ const inAmbientModule = (node_1_mut) => {
1157
+ inAmbientModule:
1158
+ while (true) {
1159
+ const node_1 = node_1_mut;
1160
+ if (!Operators_IsNull(node_1)) {
1161
+ if (isAmbientModuleDeclaration(node_1)) {
1162
+ return true;
1163
+ }
1164
+ else {
1165
+ node_1_mut = node_1.parent;
1166
+ continue inAmbientModule;
1167
+ }
1168
+ }
1169
+ else {
1170
+ return false;
1171
+ }
1172
+ break;
1173
+ }
1174
+ };
1175
+ if (packageContext != null) {
1176
+ if (inGlobalBlock(declaration.parent)) {
1177
+ return true;
1178
+ }
1179
+ else if (isGlobalScriptOfPackage(packageContext, declaration.getSourceFile())) {
1180
+ return !inAmbientModule(declaration);
1181
+ }
1182
+ else {
1183
+ return false;
1184
+ }
1185
+ }
1186
+ else {
1187
+ return false;
1188
+ }
1189
+ }
1190
+
1191
+ /**
1192
+ * A module declaration at the top of a file or of the ambient module the file is made of
1193
+ */
1194
+ export function isTopLevelModuleDeclaration(packageContext, node) {
1195
+ if (!Operators_IsNull(node.parent) && ((node.parent.kind === 312) ? true : (((node.parent.kind === 268) && (node.parent.parent.kind === 267)) && isPromotedAmbientModule(node.parent.parent)))) {
1196
+ return !isPackageGlobal(packageContext, node);
1197
+ }
1198
+ else {
1199
+ return false;
1200
+ }
1201
+ }
1202
+
1203
+ function namespaceChain(packageContext, declaration) {
1204
+ const collect = (node_mut, acc_mut) => {
1205
+ collect:
1206
+ while (true) {
1207
+ const node = node_mut, acc = acc_mut;
1208
+ if (Operators_IsNull(node)) {
1209
+ return acc;
1210
+ }
1211
+ else {
1212
+ const matchValue = node.kind;
1213
+ if (matchValue === 267) {
1214
+ if (isPromotedAmbientModule(node)) {
1215
+ node_mut = node.parent;
1216
+ acc_mut = acc;
1217
+ continue collect;
1218
+ }
1219
+ else if ((packageContext != null) && isGlobalAugmentation(node)) {
1220
+ return acc;
1221
+ }
1222
+ else {
1223
+ const moduleDeclaration = node;
1224
+ const rawName = removeSurroundingQuotes(moduleDeclaration.name.getText());
1225
+ const name = isTopLevelModuleDeclaration(packageContext, node) ? sanitizeTypeName(rawName + "_") : sanitizeTypeName(rawName);
1226
+ node_mut = node.parent;
1227
+ acc_mut = cons(name, acc);
1228
+ continue collect;
1229
+ }
1230
+ }
1231
+ else {
1232
+ node_mut = node.parent;
1233
+ acc_mut = acc;
1234
+ continue collect;
1235
+ }
1236
+ }
1237
+ break;
1238
+ }
1239
+ };
1240
+ return collect(declaration.parent, empty());
1241
+ }
1242
+
1243
+ /**
1244
+ * The F# modules qualifying a declaration from another file: its file modules and its namespaces
1245
+ */
1246
+ export function modulePathForDeclaration(packageContext, declaration) {
1247
+ return append(PackageContext__ModulePath_Z55EFCE8F(packageContext, normalizePath(declaration.getSourceFile().fileName), !isPackageGlobal(packageContext, declaration)), namespaceChain(packageContext, declaration));
1248
+ }
1249
+
1250
+ /**
1251
+ * The F# modules qualifying a reference to the symbol: the package and file modules
1252
+ * in package mode, and the namespaces when the reference is written qualified.
1253
+ */
1254
+ export function modulePathForSymbol(checker, packageContext, isQualified, symbolOpt) {
1255
+ let declaration_3;
1256
+ let matchValue;
1257
+ const option_1 = symbolOpt;
1258
+ matchValue = ((option_1 != null) ? resolveAlias(checker, option_1) : undefined);
1259
+ if (matchValue != null) {
1260
+ const symbol_1 = matchValue;
1261
+ const declaration = mainDeclaration(packageContext, symbol_1);
1262
+ let filePath;
1263
+ const matchValue_1 = declarationFile(packageContext, symbol_1);
1264
+ let matchResult, fileName, packageContext_1;
1265
+ if (packageContext != null) {
1266
+ if (matchValue_1 != null) {
1267
+ matchResult = 0;
1268
+ fileName = matchValue_1;
1269
+ packageContext_1 = packageContext;
1270
+ }
1271
+ else {
1272
+ matchResult = 1;
1273
+ }
1274
+ }
1275
+ else {
1276
+ matchResult = 1;
1277
+ }
1278
+ switch (matchResult) {
1279
+ case 0: {
1280
+ filePath = PackageContext__ModulePath_Z55EFCE8F(packageContext_1, fileName, (declaration == null) ? true : !isPackageGlobal(packageContext_1, declaration));
1281
+ break;
1282
+ }
1283
+ default:
1284
+ filePath = empty();
1285
+ }
1286
+ return append(filePath, (declaration != null) ? ((isQualified ? true : !isEmpty(filePath)) ? ((declaration_3 = declaration, namespaceChain(packageContext, declaration_3))) : empty()) : empty());
1287
+ }
1288
+ else {
1289
+ return empty();
1290
+ }
1291
+ }
1292
+
204
1293
  export function Type_StringLiteral_$007CString$007COther$007C(literalType) {
205
- const matchValue = literalType.flags | 0;
1294
+ const matchValue = literalType.flags;
206
1295
  if ($007CHasTypeFlags$007C_$007C(128, matchValue) != null) {
207
1296
  const literalType_1 = literalType;
208
- return new FSharpChoice$2(0, [literalType_1.value]);
1297
+ return new FSharpChoice$2(/* Choice1Of2 */ 0, [literalType_1.value]);
209
1298
  }
210
1299
  else {
211
- return new FSharpChoice$2(1, [void 0]);
1300
+ return new FSharpChoice$2(/* Choice2Of2 */ 1, [undefined]);
212
1301
  }
213
1302
  }
214
1303
 
215
1304
  export function Type_NumberLiteral_$007CInt$007CFloat$007COther$007C(literalType) {
216
- const matchValue = literalType.flags | 0;
1305
+ const matchValue = literalType.flags;
217
1306
  if ($007CHasTypeFlags$007C_$007C(256, matchValue) != null) {
218
1307
  const literalType_1 = literalType;
219
1308
  if (Number.isSafeInteger(literalType_1.value)) {
220
- return new FSharpChoice$3(0, [literalType_1.value]);
1309
+ return new FSharpChoice$3(/* Choice1Of3 */ 0, [literalType_1.value]);
221
1310
  }
222
1311
  else {
223
- return new FSharpChoice$3(1, [literalType_1.value]);
1312
+ return new FSharpChoice$3(/* Choice2Of3 */ 1, [literalType_1.value]);
224
1313
  }
225
1314
  }
226
1315
  else {
227
- return new FSharpChoice$3(2, [void 0]);
1316
+ return new FSharpChoice$3(/* Choice3Of3 */ 2, [undefined]);
228
1317
  }
229
1318
  }
230
1319
 
231
- //# sourceMappingURL=Utils.js.map