@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
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Glutinum.Converter
2
+
3
+ This is a compiler from `.d.ts` to F# bindings for [Fable](https://fable.io/).
package/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import './dist/Program.js'
@@ -0,0 +1,371 @@
1
+ import { toString, Record, Union } from "../fable_modules/fable-library.4.5.0/Types.js";
2
+ import { option_type, enum_type, list_type, record_type, union_type, bool_type, float64_type, int32_type, string_type } from "../fable_modules/fable-library.4.5.0/Reflection.js";
3
+ import { int32ToString } from "../fable_modules/fable-library.4.5.0/Util.js";
4
+ import { forAll } from "../fable_modules/fable-library.4.5.0/List.js";
5
+
6
+ export class FSharpLiteral extends Union {
7
+ constructor(tag, fields) {
8
+ super();
9
+ this.tag = tag;
10
+ this.fields = fields;
11
+ }
12
+ cases() {
13
+ return ["String", "Int", "Float", "Bool"];
14
+ }
15
+ }
16
+
17
+ export function FSharpLiteral_$reflection() {
18
+ return union_type("Glutinum.Converter.FSharpAST.FSharpLiteral", [], FSharpLiteral, () => [[["Item", string_type]], [["Item", int32_type]], [["Item", float64_type]], [["Item", bool_type]]]);
19
+ }
20
+
21
+ export class FSharpEnumCase extends Record {
22
+ constructor(Name, Value) {
23
+ super();
24
+ this.Name = Name;
25
+ this.Value = Value;
26
+ }
27
+ }
28
+
29
+ export function FSharpEnumCase_$reflection() {
30
+ return record_type("Glutinum.Converter.FSharpAST.FSharpEnumCase", [], FSharpEnumCase, () => [["Name", string_type], ["Value", FSharpLiteral_$reflection()]]);
31
+ }
32
+
33
+ export class FSharpEnumType extends Union {
34
+ constructor(tag, fields) {
35
+ super();
36
+ this.tag = tag;
37
+ this.fields = fields;
38
+ }
39
+ cases() {
40
+ return ["String", "Numeric", "Unknown"];
41
+ }
42
+ }
43
+
44
+ export function FSharpEnumType_$reflection() {
45
+ return union_type("Glutinum.Converter.FSharpAST.FSharpEnumType", [], FSharpEnumType, () => [[], [], []]);
46
+ }
47
+
48
+ export class FSharpEnum extends Record {
49
+ constructor(Name, Cases) {
50
+ super();
51
+ this.Name = Name;
52
+ this.Cases = Cases;
53
+ }
54
+ }
55
+
56
+ export function FSharpEnum_$reflection() {
57
+ return record_type("Glutinum.Converter.FSharpAST.FSharpEnum", [], FSharpEnum, () => [["Name", string_type], ["Cases", list_type(FSharpEnumCase_$reflection())]]);
58
+ }
59
+
60
+ export class FSharpUnionCaseType extends Union {
61
+ constructor(tag, fields) {
62
+ super();
63
+ this.tag = tag;
64
+ this.fields = fields;
65
+ }
66
+ cases() {
67
+ return ["Named", "Literal"];
68
+ }
69
+ }
70
+
71
+ export function FSharpUnionCaseType_$reflection() {
72
+ return union_type("Glutinum.Converter.FSharpAST.FSharpUnionCaseType", [], FSharpUnionCaseType, () => [[["Item", string_type]], [["Item", string_type]]]);
73
+ }
74
+
75
+ export class FSharpUnionCase extends Record {
76
+ constructor(Attributes, Name) {
77
+ super();
78
+ this.Attributes = Attributes;
79
+ this.Name = Name;
80
+ }
81
+ }
82
+
83
+ export function FSharpUnionCase_$reflection() {
84
+ return record_type("Glutinum.Converter.FSharpAST.FSharpUnionCase", [], FSharpUnionCase, () => [["Attributes", list_type(FSharpAttribute_$reflection())], ["Name", string_type]]);
85
+ }
86
+
87
+ export class FSharpUnionType extends Union {
88
+ constructor(tag, fields) {
89
+ super();
90
+ this.tag = tag;
91
+ this.fields = fields;
92
+ }
93
+ cases() {
94
+ return ["String", "Numeric", "Unknown"];
95
+ }
96
+ }
97
+
98
+ export function FSharpUnionType_$reflection() {
99
+ return union_type("Glutinum.Converter.FSharpAST.FSharpUnionType", [], FSharpUnionType, () => [[], [], []]);
100
+ }
101
+
102
+ export class FSharpUnion extends Record {
103
+ constructor(Attributes, Name, Cases, IsOptional) {
104
+ super();
105
+ this.Attributes = Attributes;
106
+ this.Name = Name;
107
+ this.Cases = Cases;
108
+ this.IsOptional = IsOptional;
109
+ }
110
+ }
111
+
112
+ export function FSharpUnion_$reflection() {
113
+ return record_type("Glutinum.Converter.FSharpAST.FSharpUnion", [], FSharpUnion, () => [["Attributes", list_type(FSharpAttribute_$reflection())], ["Name", string_type], ["Cases", list_type(FSharpUnionCase_$reflection())], ["IsOptional", bool_type]]);
114
+ }
115
+
116
+ export class FSharpModule extends Record {
117
+ constructor(Name, IsRecursive, Types) {
118
+ super();
119
+ this.Name = Name;
120
+ this.IsRecursive = IsRecursive;
121
+ this.Types = Types;
122
+ }
123
+ }
124
+
125
+ export function FSharpModule_$reflection() {
126
+ return record_type("Glutinum.Converter.FSharpAST.FSharpModule", [], FSharpModule, () => [["Name", string_type], ["IsRecursive", bool_type], ["Types", list_type(FSharpType_$reflection())]]);
127
+ }
128
+
129
+ export class FSharpAccessor extends Union {
130
+ constructor(tag, fields) {
131
+ super();
132
+ this.tag = tag;
133
+ this.fields = fields;
134
+ }
135
+ cases() {
136
+ return ["ReadOnly", "WriteOnly", "ReadWrite"];
137
+ }
138
+ }
139
+
140
+ export function FSharpAccessor_$reflection() {
141
+ return union_type("Glutinum.Converter.FSharpAST.FSharpAccessor", [], FSharpAccessor, () => [[], [], []]);
142
+ }
143
+
144
+ export class FSharpAccessiblity extends Union {
145
+ constructor(tag, fields) {
146
+ super();
147
+ this.tag = tag;
148
+ this.fields = fields;
149
+ }
150
+ cases() {
151
+ return ["Public", "Private", "Protected"];
152
+ }
153
+ }
154
+
155
+ export function FSharpAccessiblity_$reflection() {
156
+ return union_type("Glutinum.Converter.FSharpAST.FSharpAccessiblity", [], FSharpAccessiblity, () => [[], [], []]);
157
+ }
158
+
159
+ export class FSharpAttribute extends Union {
160
+ constructor(tag, fields) {
161
+ super();
162
+ this.tag = tag;
163
+ this.fields = fields;
164
+ }
165
+ cases() {
166
+ return ["Text", "EmitSelfInvoke", "Import", "ImportAll", "Erase", "AllowNullLiteral", "StringEnum", "CompiledName", "RequireQualifiedAccess", "EmitConstructor", "EmitMacroConstructor", "EmitIndexer"];
167
+ }
168
+ }
169
+
170
+ export function FSharpAttribute_$reflection() {
171
+ return union_type("Glutinum.Converter.FSharpAST.FSharpAttribute", [], FSharpAttribute, () => [[["Item", string_type]], [], [["Item1", string_type], ["Item2", string_type]], [["Item", string_type]], [], [], [["Item", enum_type("Fable.Core.CaseRules", int32_type, [["None", 0], ["LowerFirst", 1], ["SnakeCase", 2], ["SnakeCaseAllCaps", 3], ["KebabCase", 4]])]], [["Item", string_type]], [], [], [["className", string_type]], []]);
172
+ }
173
+
174
+ export class FSharpParameter extends Record {
175
+ constructor(Name, IsOptional, Type) {
176
+ super();
177
+ this.Name = Name;
178
+ this.IsOptional = IsOptional;
179
+ this.Type = Type;
180
+ }
181
+ }
182
+
183
+ export function FSharpParameter_$reflection() {
184
+ return record_type("Glutinum.Converter.FSharpAST.FSharpParameter", [], FSharpParameter, () => [["Name", string_type], ["IsOptional", bool_type], ["Type", FSharpType_$reflection()]]);
185
+ }
186
+
187
+ export class FSharpMemberInfo extends Record {
188
+ constructor(Attributes, Name, Parameters, Type, IsOptional, IsStatic, Accessor, Accessibility) {
189
+ super();
190
+ this.Attributes = Attributes;
191
+ this.Name = Name;
192
+ this.Parameters = Parameters;
193
+ this.Type = Type;
194
+ this.IsOptional = IsOptional;
195
+ this.IsStatic = IsStatic;
196
+ this.Accessor = Accessor;
197
+ this.Accessibility = Accessibility;
198
+ }
199
+ }
200
+
201
+ export function FSharpMemberInfo_$reflection() {
202
+ return record_type("Glutinum.Converter.FSharpAST.FSharpMemberInfo", [], FSharpMemberInfo, () => [["Attributes", list_type(FSharpAttribute_$reflection())], ["Name", string_type], ["Parameters", list_type(FSharpParameter_$reflection())], ["Type", FSharpType_$reflection()], ["IsOptional", bool_type], ["IsStatic", bool_type], ["Accessor", option_type(FSharpAccessor_$reflection())], ["Accessibility", FSharpAccessiblity_$reflection()]]);
203
+ }
204
+
205
+ export class FSharpMember extends Union {
206
+ constructor(tag, fields) {
207
+ super();
208
+ this.tag = tag;
209
+ this.fields = fields;
210
+ }
211
+ cases() {
212
+ return ["Method", "Property"];
213
+ }
214
+ }
215
+
216
+ export function FSharpMember_$reflection() {
217
+ return union_type("Glutinum.Converter.FSharpAST.FSharpMember", [], FSharpMember, () => [[["Item", FSharpMemberInfo_$reflection()]], [["Item", FSharpMemberInfo_$reflection()]]]);
218
+ }
219
+
220
+ export class FSharpInterface extends Record {
221
+ constructor(Attributes, Name, TypeParameters, Members) {
222
+ super();
223
+ this.Attributes = Attributes;
224
+ this.Name = Name;
225
+ this.TypeParameters = TypeParameters;
226
+ this.Members = Members;
227
+ }
228
+ }
229
+
230
+ export function FSharpInterface_$reflection() {
231
+ return record_type("Glutinum.Converter.FSharpAST.FSharpInterface", [], FSharpInterface, () => [["Attributes", list_type(FSharpAttribute_$reflection())], ["Name", string_type], ["TypeParameters", list_type(FSharpTypeParameter_$reflection())], ["Members", list_type(FSharpMember_$reflection())]]);
232
+ }
233
+
234
+ export class FSharpMapped extends Record {
235
+ constructor(Name, Declarations) {
236
+ super();
237
+ this.Name = Name;
238
+ this.Declarations = Declarations;
239
+ }
240
+ }
241
+
242
+ export function FSharpMapped_$reflection() {
243
+ return record_type("Glutinum.Converter.FSharpAST.FSharpMapped", [], FSharpMapped, () => [["Name", string_type], ["Declarations", list_type(FSharpType_$reflection())]]);
244
+ }
245
+
246
+ export class FSharpPrimitive extends Union {
247
+ constructor(tag, fields) {
248
+ super();
249
+ this.tag = tag;
250
+ this.fields = fields;
251
+ }
252
+ cases() {
253
+ return ["String", "Int", "Float", "Bool", "Unit", "Number", "Null"];
254
+ }
255
+ }
256
+
257
+ export function FSharpPrimitive_$reflection() {
258
+ return union_type("Glutinum.Converter.FSharpAST.FSharpPrimitive", [], FSharpPrimitive, () => [[], [], [], [], [], [], []]);
259
+ }
260
+
261
+ export class FSharpTypeParameter extends Record {
262
+ constructor(Name, Constraint, Default) {
263
+ super();
264
+ this.Name = Name;
265
+ this.Constraint = Constraint;
266
+ this.Default = Default;
267
+ }
268
+ }
269
+
270
+ export function FSharpTypeParameter_$reflection() {
271
+ return record_type("Glutinum.Converter.FSharpAST.FSharpTypeParameter", [], FSharpTypeParameter, () => [["Name", string_type], ["Constraint", option_type(FSharpType_$reflection())], ["Default", option_type(FSharpType_$reflection())]]);
272
+ }
273
+
274
+ export class FSharpTypeAlias extends Record {
275
+ constructor(Name, Type, TypeParameters) {
276
+ super();
277
+ this.Name = Name;
278
+ this.Type = Type;
279
+ this.TypeParameters = TypeParameters;
280
+ }
281
+ }
282
+
283
+ export function FSharpTypeAlias_$reflection() {
284
+ return record_type("Glutinum.Converter.FSharpAST.FSharpTypeAlias", [], FSharpTypeAlias, () => [["Name", string_type], ["Type", FSharpType_$reflection()], ["TypeParameters", list_type(FSharpTypeParameter_$reflection())]]);
285
+ }
286
+
287
+ export class FSharpTypeReference extends Record {
288
+ constructor(Name, FullName) {
289
+ super();
290
+ this.Name = Name;
291
+ this.FullName = FullName;
292
+ }
293
+ }
294
+
295
+ export function FSharpTypeReference_$reflection() {
296
+ return record_type("Glutinum.Converter.FSharpAST.FSharpTypeReference", [], FSharpTypeReference, () => [["Name", string_type], ["FullName", string_type]]);
297
+ }
298
+
299
+ export class FSharpType extends Union {
300
+ constructor(tag, fields) {
301
+ super();
302
+ this.tag = tag;
303
+ this.fields = fields;
304
+ }
305
+ cases() {
306
+ return ["Enum", "Union", "Option", "Module", "Interface", "Unsupported", "Mapped", "Primitive", "TypeAlias", "Discard", "TypeReference", "TypeParameter", "ResizeArray"];
307
+ }
308
+ }
309
+
310
+ export function FSharpType_$reflection() {
311
+ return union_type("Glutinum.Converter.FSharpAST.FSharpType", [], FSharpType, () => [[["Item", FSharpEnum_$reflection()]], [["Item", FSharpUnion_$reflection()]], [["Item", FSharpType_$reflection()]], [["Item", FSharpModule_$reflection()]], [["Item", FSharpInterface_$reflection()]], [["Item", enum_type("TypeScript.Ts.SyntaxKind", int32_type, [["Unknown", 0], ["EndOfFileToken", 1], ["SingleLineCommentTrivia", 2], ["MultiLineCommentTrivia", 3], ["NewLineTrivia", 4], ["WhitespaceTrivia", 5], ["ShebangTrivia", 6], ["ConflictMarkerTrivia", 7], ["NonTextFileMarkerTrivia", 8], ["NumericLiteral", 9], ["BigIntLiteral", 10], ["StringLiteral", 11], ["JsxText", 12], ["JsxTextAllWhiteSpaces", 13], ["RegularExpressionLiteral", 14], ["NoSubstitutionTemplateLiteral", 15], ["TemplateHead", 16], ["TemplateMiddle", 17], ["TemplateTail", 18], ["OpenBraceToken", 19], ["CloseBraceToken", 20], ["OpenParenToken", 21], ["CloseParenToken", 22], ["OpenBracketToken", 23], ["CloseBracketToken", 24], ["DotToken", 25], ["DotDotDotToken", 26], ["SemicolonToken", 27], ["CommaToken", 28], ["QuestionDotToken", 29], ["LessThanToken", 30], ["LessThanSlashToken", 31], ["GreaterThanToken", 32], ["LessThanEqualsToken", 33], ["GreaterThanEqualsToken", 34], ["EqualsEqualsToken", 35], ["ExclamationEqualsToken", 36], ["EqualsEqualsEqualsToken", 37], ["ExclamationEqualsEqualsToken", 38], ["EqualsGreaterThanToken", 39], ["PlusToken", 40], ["MinusToken", 41], ["AsteriskToken", 42], ["AsteriskAsteriskToken", 43], ["SlashToken", 44], ["PercentToken", 45], ["PlusPlusToken", 46], ["MinusMinusToken", 47], ["LessThanLessThanToken", 48], ["GreaterThanGreaterThanToken", 49], ["GreaterThanGreaterThanGreaterThanToken", 50], ["AmpersandToken", 51], ["BarToken", 52], ["CaretToken", 53], ["ExclamationToken", 54], ["TildeToken", 55], ["AmpersandAmpersandToken", 56], ["BarBarToken", 57], ["QuestionToken", 58], ["ColonToken", 59], ["AtToken", 60], ["QuestionQuestionToken", 61], ["BacktickToken", 62], ["HashToken", 63], ["EqualsToken", 64], ["PlusEqualsToken", 65], ["MinusEqualsToken", 66], ["AsteriskEqualsToken", 67], ["AsteriskAsteriskEqualsToken", 68], ["SlashEqualsToken", 69], ["PercentEqualsToken", 70], ["LessThanLessThanEqualsToken", 71], ["GreaterThanGreaterThanEqualsToken", 72], ["GreaterThanGreaterThanGreaterThanEqualsToken", 73], ["AmpersandEqualsToken", 74], ["BarEqualsToken", 75], ["BarBarEqualsToken", 76], ["AmpersandAmpersandEqualsToken", 77], ["QuestionQuestionEqualsToken", 78], ["CaretEqualsToken", 79], ["Identifier", 80], ["PrivateIdentifier", 81], ["BreakKeyword", 83], ["CaseKeyword", 84], ["CatchKeyword", 85], ["ClassKeyword", 86], ["ConstKeyword", 87], ["ContinueKeyword", 88], ["DebuggerKeyword", 89], ["DefaultKeyword", 90], ["DeleteKeyword", 91], ["DoKeyword", 92], ["ElseKeyword", 93], ["EnumKeyword", 94], ["ExportKeyword", 95], ["ExtendsKeyword", 96], ["FalseKeyword", 97], ["FinallyKeyword", 98], ["ForKeyword", 99], ["FunctionKeyword", 100], ["IfKeyword", 101], ["ImportKeyword", 102], ["InKeyword", 103], ["InstanceOfKeyword", 104], ["NewKeyword", 105], ["NullKeyword", 106], ["ReturnKeyword", 107], ["SuperKeyword", 108], ["SwitchKeyword", 109], ["ThisKeyword", 110], ["ThrowKeyword", 111], ["TrueKeyword", 112], ["TryKeyword", 113], ["TypeOfKeyword", 114], ["VarKeyword", 115], ["VoidKeyword", 116], ["WhileKeyword", 117], ["WithKeyword", 118], ["ImplementsKeyword", 119], ["InterfaceKeyword", 120], ["LetKeyword", 121], ["PackageKeyword", 122], ["PrivateKeyword", 123], ["ProtectedKeyword", 124], ["PublicKeyword", 125], ["StaticKeyword", 126], ["YieldKeyword", 127], ["AbstractKeyword", 128], ["AccessorKeyword", 129], ["AsKeyword", 130], ["AssertsKeyword", 131], ["AssertKeyword", 132], ["AnyKeyword", 133], ["AsyncKeyword", 134], ["AwaitKeyword", 135], ["BooleanKeyword", 136], ["ConstructorKeyword", 137], ["DeclareKeyword", 138], ["GetKeyword", 139], ["InferKeyword", 140], ["IntrinsicKeyword", 141], ["IsKeyword", 142], ["KeyOfKeyword", 143], ["ModuleKeyword", 144], ["NamespaceKeyword", 145], ["NeverKeyword", 146], ["OutKeyword", 147], ["ReadonlyKeyword", 148], ["RequireKeyword", 149], ["NumberKeyword", 150], ["ObjectKeyword", 151], ["SatisfiesKeyword", 152], ["SetKeyword", 153], ["StringKeyword", 154], ["SymbolKeyword", 155], ["TypeKeyword", 156], ["UndefinedKeyword", 157], ["UniqueKeyword", 158], ["UnknownKeyword", 159], ["UsingKeyword", 160], ["FromKeyword", 161], ["GlobalKeyword", 162], ["BigIntKeyword", 163], ["OverrideKeyword", 164], ["OfKeyword", 165], ["QualifiedName", 166], ["ComputedPropertyName", 167], ["TypeParameter", 168], ["Parameter", 169], ["Decorator", 170], ["PropertySignature", 171], ["PropertyDeclaration", 172], ["MethodSignature", 173], ["MethodDeclaration", 174], ["ClassStaticBlockDeclaration", 175], ["Constructor", 176], ["GetAccessor", 177], ["SetAccessor", 178], ["CallSignature", 179], ["ConstructSignature", 180], ["IndexSignature", 181], ["TypePredicate", 182], ["TypeReference", 183], ["FunctionType", 184], ["ConstructorType", 185], ["TypeQuery", 186], ["TypeLiteral", 187], ["ArrayType", 188], ["TupleType", 189], ["OptionalType", 190], ["RestType", 191], ["UnionType", 192], ["IntersectionType", 193], ["ConditionalType", 194], ["InferType", 195], ["ParenthesizedType", 196], ["ThisType", 197], ["TypeOperator", 198], ["IndexedAccessType", 199], ["MappedType", 200], ["LiteralType", 201], ["NamedTupleMember", 202], ["TemplateLiteralType", 203], ["TemplateLiteralTypeSpan", 204], ["ImportType", 205], ["ObjectBindingPattern", 206], ["ArrayBindingPattern", 207], ["BindingElement", 208], ["ArrayLiteralExpression", 209], ["ObjectLiteralExpression", 210], ["PropertyAccessExpression", 211], ["ElementAccessExpression", 212], ["CallExpression", 213], ["NewExpression", 214], ["TaggedTemplateExpression", 215], ["TypeAssertionExpression", 216], ["ParenthesizedExpression", 217], ["FunctionExpression", 218], ["ArrowFunction", 219], ["DeleteExpression", 220], ["TypeOfExpression", 221], ["VoidExpression", 222], ["AwaitExpression", 223], ["PrefixUnaryExpression", 224], ["PostfixUnaryExpression", 225], ["BinaryExpression", 226], ["ConditionalExpression", 227], ["TemplateExpression", 228], ["YieldExpression", 229], ["SpreadElement", 230], ["ClassExpression", 231], ["OmittedExpression", 232], ["ExpressionWithTypeArguments", 233], ["AsExpression", 234], ["NonNullExpression", 235], ["MetaProperty", 236], ["SyntheticExpression", 237], ["SatisfiesExpression", 238], ["TemplateSpan", 239], ["SemicolonClassElement", 240], ["Block", 241], ["EmptyStatement", 242], ["VariableStatement", 243], ["ExpressionStatement", 244], ["IfStatement", 245], ["DoStatement", 246], ["WhileStatement", 247], ["ForStatement", 248], ["ForInStatement", 249], ["ForOfStatement", 250], ["ContinueStatement", 251], ["BreakStatement", 252], ["ReturnStatement", 253], ["WithStatement", 254], ["SwitchStatement", 255], ["LabeledStatement", 256], ["ThrowStatement", 257], ["TryStatement", 258], ["DebuggerStatement", 259], ["VariableDeclaration", 260], ["VariableDeclarationList", 261], ["FunctionDeclaration", 262], ["ClassDeclaration", 263], ["InterfaceDeclaration", 264], ["TypeAliasDeclaration", 265], ["EnumDeclaration", 266], ["ModuleDeclaration", 267], ["ModuleBlock", 268], ["CaseBlock", 269], ["NamespaceExportDeclaration", 270], ["ImportEqualsDeclaration", 271], ["ImportDeclaration", 272], ["ImportClause", 273], ["NamespaceImport", 274], ["NamedImports", 275], ["ImportSpecifier", 276], ["ExportAssignment", 277], ["ExportDeclaration", 278], ["NamedExports", 279], ["NamespaceExport", 280], ["ExportSpecifier", 281], ["MissingDeclaration", 282], ["ExternalModuleReference", 283], ["JsxElement", 284], ["JsxSelfClosingElement", 285], ["JsxOpeningElement", 286], ["JsxClosingElement", 287], ["JsxFragment", 288], ["JsxOpeningFragment", 289], ["JsxClosingFragment", 290], ["JsxAttribute", 291], ["JsxAttributes", 292], ["JsxSpreadAttribute", 293], ["JsxExpression", 294], ["JsxNamespacedName", 295], ["CaseClause", 296], ["DefaultClause", 297], ["HeritageClause", 298], ["CatchClause", 299], ["AssertClause", 300], ["AssertEntry", 301], ["ImportTypeAssertionContainer", 302], ["PropertyAssignment", 303], ["ShorthandPropertyAssignment", 304], ["SpreadAssignment", 305], ["EnumMember", 306], ["UnparsedPrologue", 307], ["UnparsedPrepend", 308], ["UnparsedText", 309], ["UnparsedInternalText", 310], ["UnparsedSyntheticReference", 311], ["SourceFile", 312], ["Bundle", 313], ["UnparsedSource", 314], ["InputFiles", 315], ["JSDocTypeExpression", 316], ["JSDocNameReference", 317], ["JSDocMemberName", 318], ["JSDocAllType", 319], ["JSDocUnknownType", 320], ["JSDocNullableType", 321], ["JSDocNonNullableType", 322], ["JSDocOptionalType", 323], ["JSDocFunctionType", 324], ["JSDocVariadicType", 325], ["JSDocNamepathType", 326], ["JSDoc", 327], ["JSDocComment", 327], ["JSDocText", 328], ["JSDocTypeLiteral", 329], ["JSDocSignature", 330], ["JSDocLink", 331], ["JSDocLinkCode", 332], ["JSDocLinkPlain", 333], ["JSDocTag", 334], ["JSDocAugmentsTag", 335], ["JSDocImplementsTag", 336], ["JSDocAuthorTag", 337], ["JSDocDeprecatedTag", 338], ["JSDocClassTag", 339], ["JSDocPublicTag", 340], ["JSDocPrivateTag", 341], ["JSDocProtectedTag", 342], ["JSDocReadonlyTag", 343], ["JSDocOverrideTag", 344], ["JSDocCallbackTag", 345], ["JSDocOverloadTag", 346], ["JSDocEnumTag", 347], ["JSDocParameterTag", 348], ["JSDocReturnTag", 349], ["JSDocThisTag", 350], ["JSDocTypeTag", 351], ["JSDocTemplateTag", 352], ["JSDocTypedefTag", 353], ["JSDocSeeTag", 354], ["JSDocPropertyTag", 355], ["JSDocThrowsTag", 356], ["JSDocSatisfiesTag", 357], ["SyntaxList", 358], ["NotEmittedStatement", 359], ["PartiallyEmittedExpression", 360], ["CommaListExpression", 361], ["SyntheticReferenceExpression", 362], ["Count", 363], ["FirstAssignment", 64], ["LastAssignment", 79], ["FirstCompoundAssignment", 65], ["LastCompoundAssignment", 79], ["FirstReservedWord", 83], ["LastReservedWord", 118], ["FirstKeyword", 83], ["LastKeyword", 165], ["FirstFutureReservedWord", 119], ["LastFutureReservedWord", 127], ["FirstTypeNode", 182], ["LastTypeNode", 205], ["FirstPunctuation", 19], ["LastPunctuation", 79], ["FirstToken", 0], ["LastToken", 165], ["FirstTriviaToken", 2], ["LastTriviaToken", 7], ["FirstLiteralToken", 9], ["LastLiteralToken", 15], ["FirstTemplateToken", 15], ["LastTemplateToken", 18], ["FirstBinaryOperator", 30], ["LastBinaryOperator", 79], ["FirstStatement", 243], ["LastStatement", 259], ["FirstNode", 166], ["FirstJSDocNode", 316], ["LastJSDocNode", 357], ["FirstJSDocTagNode", 334], ["LastJSDocTagNode", 357]])]], [["Item", FSharpMapped_$reflection()]], [["Item", FSharpPrimitive_$reflection()]], [["Item", FSharpTypeAlias_$reflection()]], [], [["Item", FSharpTypeReference_$reflection()]], [["Item", string_type]], [["Item", FSharpType_$reflection()]]]);
312
+ }
313
+
314
+ export class FSharpOutFile extends Record {
315
+ constructor(Name, Opens) {
316
+ super();
317
+ this.Name = Name;
318
+ this.Opens = Opens;
319
+ }
320
+ }
321
+
322
+ export function FSharpOutFile_$reflection() {
323
+ return record_type("Glutinum.Converter.FSharpAST.FSharpOutFile", [], FSharpOutFile, () => [["Name", string_type], ["Opens", list_type(string_type)]]);
324
+ }
325
+
326
+ export function FSharpLiteral__ToText(this$) {
327
+ switch (this$.tag) {
328
+ case 1:
329
+ return int32ToString(this$.fields[0]);
330
+ case 2:
331
+ return this$.fields[0].toString();
332
+ case 3:
333
+ return toString(this$.fields[0]);
334
+ default:
335
+ return this$.fields[0];
336
+ }
337
+ }
338
+
339
+ export function FSharpEnum__get_Type(this$) {
340
+ const isString = forAll((c) => {
341
+ const matchValue = c.Value;
342
+ switch (matchValue.tag) {
343
+ case 2:
344
+ case 1:
345
+ case 3:
346
+ return false;
347
+ default:
348
+ return true;
349
+ }
350
+ }, this$.Cases);
351
+ if (forAll((c_1) => {
352
+ const matchValue_1 = c_1.Value;
353
+ switch (matchValue_1.tag) {
354
+ case 2:
355
+ case 1:
356
+ return true;
357
+ default:
358
+ return false;
359
+ }
360
+ }, this$.Cases)) {
361
+ return new FSharpEnumType(1, []);
362
+ }
363
+ else if (isString) {
364
+ return new FSharpEnumType(0, []);
365
+ }
366
+ else {
367
+ return new FSharpEnumType(2, []);
368
+ }
369
+ }
370
+
371
+ //# sourceMappingURL=FsharpAST.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Glutinum.Converter/FsharpAST.fs"],"names":["this","value","isString","matchValue","c"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAYcA;;iCAES,AAAAA;;mBACSC,AAAP,AAAAD;;AACD,mBAAA,SAAA,AAAAA;;AAHE,mBAAA,AAAAA;;;;;AA6BdE,qBAEG;AACOC,2BAAA,AAAAC;gBAAAD;;;;uBAIoB;;uBAHE;;OAHhC,AAAAH;AAmBJ,QARO;AACOG,6BAAA,AAAAC;gBAAAD;;;uBAImB;;uBAFC;;OAJ9B,AAAAH;AAUA,eAAA;;SACJ,IAAKE;AACD,eAAA;;;AAEA,eAAA","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,28 @@
1
+ import * as fs from "fs";
2
+ import typescript from "typescript";
3
+ import { print, printOutFile, Printer_$ctor } from "./Printer.js";
4
+ import { transform } from "./Transform.js";
5
+ import { readSourceFile } from "./Read.js";
6
+ import { ofArray } from "../fable_modules/fable-library.4.5.0/List.js";
7
+ import { FSharpOutFile } from "./FsharpAST.js";
8
+ import { toString } from "../fable_modules/fable-library.4.5.0/Types.js";
9
+
10
+ export function generateBindingFile(filePath) {
11
+ if (!fs.existsSync(filePath)) {
12
+ throw new Error(`File does not exist: ${filePath}`);
13
+ }
14
+ const options = {
15
+ target: 2,
16
+ module: 1,
17
+ };
18
+ const program = typescript.createProgram([filePath], options);
19
+ const checker = program.getTypeChecker();
20
+ const sourceFile = program.getSourceFile(filePath);
21
+ const printer = Printer_$ctor();
22
+ const res = transform(true, readSourceFile(checker, sourceFile));
23
+ printOutFile(printer, new FSharpOutFile("Glutinum", ofArray(["Fable.Core", "System"])));
24
+ print(printer, res);
25
+ return toString(printer);
26
+ }
27
+
28
+ //# sourceMappingURL=Generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Glutinum.Converter/Generate.fs"],"names":["filePath","options","program","checker","sourceFile","printer","res"],"mappings":";;;;;;;;;;AAcI,QAAwC,CAArC,cAAwBA;AACvB,wBAAS,wBAAwBA;;AAIjCC;gBAEqB;gBACI;;AAGzBC,oBAAU,0BARAF,WAQqCC;AAE/CE,oBAAU,AAAAD;AAEVE,uBAAa,AAAAF,sBAAsBF;AAEnCK,oBAAU;AAQVC,gBAAM,UAAoB,MANhB,eAAoBH,SAAQC;AAsB1C,iBAAqBC,SATjB,kBACW,YAEH,SACI,cACA;AAMhB,UAAcA,SAAQC;AAEtB,WAAA,SAAAD","file":null,"sourcesContent":null,"sourceRoot":null}