create-mendix-widget-gleam 2.0.13 → 2.0.15

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 (205) hide show
  1. package/README.md +3 -2
  2. package/package.json +5 -1
  3. package/src/index.mjs +22 -7
  4. package/src/templates/readme_md.mjs +6 -6
  5. package/template/docs/glendix_guide.md +204 -1
  6. package/template/gleam.toml +1 -1
  7. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache +0 -0
  8. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache_inline +0 -0
  9. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache_meta +0 -0
  10. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache +0 -0
  11. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache_inline +0 -0
  12. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache_meta +0 -0
  13. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache +0 -0
  14. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache_inline +0 -0
  15. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache_meta +0 -0
  16. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache +0 -0
  17. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache_inline +0 -0
  18. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache_meta +0 -0
  19. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache +0 -0
  20. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache_inline +0 -0
  21. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache_meta +0 -0
  22. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache +0 -0
  23. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache_inline +0 -0
  24. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache_meta +0 -0
  25. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache +0 -0
  26. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache_inline +0 -0
  27. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache_meta +0 -0
  28. package/tui/build/dev/javascript/etch/etch/command.mjs +479 -0
  29. package/tui/build/dev/javascript/etch/etch/cursor.mjs +164 -0
  30. package/tui/build/dev/javascript/etch/etch/event.mjs +2399 -0
  31. package/tui/build/dev/javascript/etch/etch/internal/consts.mjs +3 -0
  32. package/tui/build/dev/javascript/etch/etch/stdout.mjs +375 -0
  33. package/tui/build/dev/javascript/etch/etch/style.mjs +741 -0
  34. package/tui/build/dev/javascript/etch/etch/terminal.mjs +137 -0
  35. package/tui/build/dev/javascript/etch/gleam.mjs +1 -0
  36. package/tui/build/dev/javascript/etch/input/event_ffi.erl +73 -0
  37. package/tui/build/dev/javascript/etch/input/input_ffi.mjs +192 -0
  38. package/tui/build/dev/javascript/etch/input/signal_handler.erl +33 -0
  39. package/tui/build/dev/javascript/etch/terminal/terminal_ffi.erl +22 -0
  40. package/tui/build/dev/javascript/etch/terminal/terminal_ffi.mjs +37 -0
  41. package/tui/build/dev/javascript/etch/terminal/tty_state.erl +29 -0
  42. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache +0 -0
  43. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache_inline +0 -0
  44. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache_meta +0 -0
  45. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache +0 -0
  46. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache_inline +0 -0
  47. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache_meta +0 -0
  48. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache +0 -0
  49. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache_inline +0 -0
  50. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache_meta +0 -0
  51. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache +0 -0
  52. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache_inline +0 -0
  53. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache_meta +0 -0
  54. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache +0 -0
  55. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache_inline +0 -0
  56. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache_meta +0 -0
  57. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache +0 -0
  58. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache_inline +0 -0
  59. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache_meta +0 -0
  60. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache +0 -0
  61. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache_inline +0 -0
  62. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache_meta +0 -0
  63. package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/application.mjs +38 -0
  64. package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/atom.mjs +2 -0
  65. package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/charlist.mjs +1 -0
  66. package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/node.mjs +12 -0
  67. package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/port.mjs +1 -0
  68. package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/process.mjs +161 -0
  69. package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/reference.mjs +1 -0
  70. package/tui/build/dev/javascript/gleam_erlang/gleam.mjs +1 -0
  71. package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@application.erl +43 -0
  72. package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@atom.erl +94 -0
  73. package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@charlist.erl +42 -0
  74. package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@node.erl +80 -0
  75. package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@port.erl +8 -0
  76. package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@process.erl +868 -0
  77. package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@reference.erl +21 -0
  78. package/tui/build/dev/javascript/gleam_erlang/gleam_erlang_ffi.erl +164 -0
  79. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache +0 -0
  80. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache_inline +0 -0
  81. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache_meta +0 -0
  82. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache +0 -0
  83. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache_inline +0 -0
  84. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache_meta +0 -0
  85. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache +0 -0
  86. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache_inline +0 -0
  87. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache_meta +0 -0
  88. package/tui/build/dev/javascript/gleam_javascript/gleam/javascript/array.mjs +24 -0
  89. package/tui/build/dev/javascript/gleam_javascript/gleam/javascript/promise.mjs +105 -0
  90. package/tui/build/dev/javascript/gleam_javascript/gleam/javascript/symbol.mjs +7 -0
  91. package/tui/build/dev/javascript/gleam_javascript/gleam.mjs +1 -0
  92. package/tui/build/dev/javascript/gleam_javascript/gleam_javascript_ffi.mjs +133 -0
  93. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
  94. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline +0 -0
  95. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta +0 -0
  96. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
  97. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
  98. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta +0 -0
  99. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
  100. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline +0 -0
  101. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta +0 -0
  102. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
  103. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline +0 -0
  104. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta +0 -0
  105. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
  106. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline +0 -0
  107. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta +0 -0
  108. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
  109. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline +0 -0
  110. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
  111. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
  112. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline +0 -0
  113. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta +0 -0
  114. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
  115. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline +0 -0
  116. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta +0 -0
  117. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
  118. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline +0 -0
  119. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta +0 -0
  120. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
  121. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline +0 -0
  122. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta +0 -0
  123. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
  124. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline +0 -0
  125. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta +0 -0
  126. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
  127. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline +0 -0
  128. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta +0 -0
  129. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
  130. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline +0 -0
  131. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta +0 -0
  132. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
  133. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline +0 -0
  134. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta +0 -0
  135. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
  136. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
  137. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta +0 -0
  138. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
  139. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline +0 -0
  140. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta +0 -0
  141. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
  142. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline +0 -0
  143. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
  144. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
  145. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline +0 -0
  146. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta +0 -0
  147. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
  148. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline +0 -0
  149. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta +0 -0
  150. package/tui/build/dev/javascript/gleam_stdlib/dict.mjs +710 -0
  151. package/tui/build/dev/javascript/gleam_stdlib/gleam/bit_array.mjs +286 -0
  152. package/tui/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +295 -0
  153. package/tui/build/dev/javascript/gleam_stdlib/gleam/bytes_tree.mjs +225 -0
  154. package/tui/build/dev/javascript/gleam_stdlib/gleam/dict.mjs +455 -0
  155. package/tui/build/dev/javascript/gleam_stdlib/gleam/dynamic/decode.mjs +993 -0
  156. package/tui/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +35 -0
  157. package/tui/build/dev/javascript/gleam_stdlib/gleam/float.mjs +528 -0
  158. package/tui/build/dev/javascript/gleam_stdlib/gleam/function.mjs +6 -0
  159. package/tui/build/dev/javascript/gleam_stdlib/gleam/int.mjs +764 -0
  160. package/tui/build/dev/javascript/gleam_stdlib/gleam/io.mjs +8 -0
  161. package/tui/build/dev/javascript/gleam_stdlib/gleam/list.mjs +3063 -0
  162. package/tui/build/dev/javascript/gleam_stdlib/gleam/option.mjs +386 -0
  163. package/tui/build/dev/javascript/gleam_stdlib/gleam/order.mjs +166 -0
  164. package/tui/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +96 -0
  165. package/tui/build/dev/javascript/gleam_stdlib/gleam/result.mjs +448 -0
  166. package/tui/build/dev/javascript/gleam_stdlib/gleam/set.mjs +413 -0
  167. package/tui/build/dev/javascript/gleam_stdlib/gleam/string.mjs +695 -0
  168. package/tui/build/dev/javascript/gleam_stdlib/gleam/string_tree.mjs +128 -0
  169. package/tui/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +1151 -0
  170. package/tui/build/dev/javascript/gleam_stdlib/gleam.mjs +1 -0
  171. package/tui/build/dev/javascript/gleam_stdlib/gleam@bit_array.erl +347 -0
  172. package/tui/build/dev/javascript/gleam_stdlib/gleam@bool.erl +334 -0
  173. package/tui/build/dev/javascript/gleam_stdlib/gleam@bytes_tree.erl +211 -0
  174. package/tui/build/dev/javascript/gleam_stdlib/gleam@dict.erl +513 -0
  175. package/tui/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +105 -0
  176. package/tui/build/dev/javascript/gleam_stdlib/gleam@dynamic@decode.erl +1114 -0
  177. package/tui/build/dev/javascript/gleam_stdlib/gleam@float.erl +711 -0
  178. package/tui/build/dev/javascript/gleam_stdlib/gleam@function.erl +18 -0
  179. package/tui/build/dev/javascript/gleam_stdlib/gleam@int.erl +972 -0
  180. package/tui/build/dev/javascript/gleam_stdlib/gleam@io.erl +76 -0
  181. package/tui/build/dev/javascript/gleam_stdlib/gleam@list.erl +2735 -0
  182. package/tui/build/dev/javascript/gleam_stdlib/gleam@option.erl +381 -0
  183. package/tui/build/dev/javascript/gleam_stdlib/gleam@order.erl +188 -0
  184. package/tui/build/dev/javascript/gleam_stdlib/gleam@pair.erl +104 -0
  185. package/tui/build/dev/javascript/gleam_stdlib/gleam@result.erl +500 -0
  186. package/tui/build/dev/javascript/gleam_stdlib/gleam@set.erl +430 -0
  187. package/tui/build/dev/javascript/gleam_stdlib/gleam@string.erl +964 -0
  188. package/tui/build/dev/javascript/gleam_stdlib/gleam@string_tree.erl +202 -0
  189. package/tui/build/dev/javascript/gleam_stdlib/gleam@uri.erl +1042 -0
  190. package/tui/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +534 -0
  191. package/tui/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +1133 -0
  192. package/tui/build/dev/javascript/gleam_version +1 -0
  193. package/tui/build/dev/javascript/prelude.mjs +1575 -0
  194. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache +0 -0
  195. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_inline +0 -0
  196. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_meta +0 -0
  197. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_warnings +0 -0
  198. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache +0 -0
  199. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_inline +0 -0
  200. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_meta +0 -0
  201. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_warnings +0 -0
  202. package/tui/build/dev/javascript/tui/gleam.mjs +1 -0
  203. package/tui/build/dev/javascript/tui/tui/prompt.mjs +521 -0
  204. package/tui/build/dev/javascript/tui/tui.mjs +334 -0
  205. package/tui/build/dev/javascript/tui/tui_ffi.mjs +32 -0
@@ -0,0 +1,479 @@
1
+ import * as $cursor from "../etch/cursor.mjs";
2
+ import * as $event from "../etch/event.mjs";
3
+ import * as $style from "../etch/style.mjs";
4
+ import * as $terminal from "../etch/terminal.mjs";
5
+ import { CustomType as $CustomType } from "../gleam.mjs";
6
+
7
+ /**
8
+ * Prints text.
9
+ */
10
+ export class Print extends $CustomType {
11
+ constructor(s) {
12
+ super();
13
+ this.s = s;
14
+ }
15
+ }
16
+ export const Command$Print = (s) => new Print(s);
17
+ export const Command$isPrint = (value) => value instanceof Print;
18
+ export const Command$Print$s = (value) => value.s;
19
+ export const Command$Print$0 = (value) => value.s;
20
+
21
+ /**
22
+ * Prints text and resets its [`Colors`](style.html#Color)
23
+ * and [`Attributes`](style.html#Attribute).
24
+ */
25
+ export class PrintReset extends $CustomType {
26
+ constructor(s) {
27
+ super();
28
+ this.s = s;
29
+ }
30
+ }
31
+ export const Command$PrintReset = (s) => new PrintReset(s);
32
+ export const Command$isPrintReset = (value) => value instanceof PrintReset;
33
+ export const Command$PrintReset$s = (value) => value.s;
34
+ export const Command$PrintReset$0 = (value) => value.s;
35
+
36
+ /**
37
+ * Prints text and moves the caret to the beginning of a new line.
38
+ */
39
+ export class Println extends $CustomType {
40
+ constructor(s) {
41
+ super();
42
+ this.s = s;
43
+ }
44
+ }
45
+ export const Command$Println = (s) => new Println(s);
46
+ export const Command$isPrintln = (value) => value instanceof Println;
47
+ export const Command$Println$s = (value) => value.s;
48
+ export const Command$Println$0 = (value) => value.s;
49
+
50
+ /**
51
+ * Prints text, resets its [`Colors`](style.html#Color)
52
+ * and [`Attributes`](style.html#Attribute)
53
+ * and moves the caret to the beginning of a new line.
54
+ */
55
+ export class PrintlnReset extends $CustomType {
56
+ constructor(s) {
57
+ super();
58
+ this.s = s;
59
+ }
60
+ }
61
+ export const Command$PrintlnReset = (s) => new PrintlnReset(s);
62
+ export const Command$isPrintlnReset = (value) => value instanceof PrintlnReset;
63
+ export const Command$PrintlnReset$s = (value) => value.s;
64
+ export const Command$PrintlnReset$0 = (value) => value.s;
65
+
66
+ /**
67
+ * Moves the cursor n lines up.
68
+ */
69
+ export class MoveUp extends $CustomType {
70
+ constructor(n) {
71
+ super();
72
+ this.n = n;
73
+ }
74
+ }
75
+ export const Command$MoveUp = (n) => new MoveUp(n);
76
+ export const Command$isMoveUp = (value) => value instanceof MoveUp;
77
+ export const Command$MoveUp$n = (value) => value.n;
78
+ export const Command$MoveUp$0 = (value) => value.n;
79
+
80
+ /**
81
+ * Moves the cursor n lines down.
82
+ */
83
+ export class MoveDown extends $CustomType {
84
+ constructor(n) {
85
+ super();
86
+ this.n = n;
87
+ }
88
+ }
89
+ export const Command$MoveDown = (n) => new MoveDown(n);
90
+ export const Command$isMoveDown = (value) => value instanceof MoveDown;
91
+ export const Command$MoveDown$n = (value) => value.n;
92
+ export const Command$MoveDown$0 = (value) => value.n;
93
+
94
+ /**
95
+ * Moves the cursor n characters left.
96
+ */
97
+ export class MoveLeft extends $CustomType {
98
+ constructor(n) {
99
+ super();
100
+ this.n = n;
101
+ }
102
+ }
103
+ export const Command$MoveLeft = (n) => new MoveLeft(n);
104
+ export const Command$isMoveLeft = (value) => value instanceof MoveLeft;
105
+ export const Command$MoveLeft$n = (value) => value.n;
106
+ export const Command$MoveLeft$0 = (value) => value.n;
107
+
108
+ /**
109
+ * Moves the cursor n characters right.
110
+ */
111
+ export class MoveRight extends $CustomType {
112
+ constructor(n) {
113
+ super();
114
+ this.n = n;
115
+ }
116
+ }
117
+ export const Command$MoveRight = (n) => new MoveRight(n);
118
+ export const Command$isMoveRight = (value) => value instanceof MoveRight;
119
+ export const Command$MoveRight$n = (value) => value.n;
120
+ export const Command$MoveRight$0 = (value) => value.n;
121
+
122
+ /**
123
+ * Moves the cursor n lines down and moves the caret
124
+ * to the beginning of the line.
125
+ */
126
+ export class MoveToNextLine extends $CustomType {
127
+ constructor(n) {
128
+ super();
129
+ this.n = n;
130
+ }
131
+ }
132
+ export const Command$MoveToNextLine = (n) => new MoveToNextLine(n);
133
+ export const Command$isMoveToNextLine = (value) =>
134
+ value instanceof MoveToNextLine;
135
+ export const Command$MoveToNextLine$n = (value) => value.n;
136
+ export const Command$MoveToNextLine$0 = (value) => value.n;
137
+
138
+ /**
139
+ * Moves the cursor n lines up and moves the caret
140
+ * to the beginning of the line.
141
+ */
142
+ export class MoveToPreviousLine extends $CustomType {
143
+ constructor(n) {
144
+ super();
145
+ this.n = n;
146
+ }
147
+ }
148
+ export const Command$MoveToPreviousLine = (n) => new MoveToPreviousLine(n);
149
+ export const Command$isMoveToPreviousLine = (value) =>
150
+ value instanceof MoveToPreviousLine;
151
+ export const Command$MoveToPreviousLine$n = (value) => value.n;
152
+ export const Command$MoveToPreviousLine$0 = (value) => value.n;
153
+
154
+ /**
155
+ * Moves the cursor to the given column while the row remains the same.
156
+ */
157
+ export class MoveToColumn extends $CustomType {
158
+ constructor(n) {
159
+ super();
160
+ this.n = n;
161
+ }
162
+ }
163
+ export const Command$MoveToColumn = (n) => new MoveToColumn(n);
164
+ export const Command$isMoveToColumn = (value) => value instanceof MoveToColumn;
165
+ export const Command$MoveToColumn$n = (value) => value.n;
166
+ export const Command$MoveToColumn$0 = (value) => value.n;
167
+
168
+ /**
169
+ * Moves the cursor to the given row while the column remains the same.
170
+ */
171
+ export class MoveToRow extends $CustomType {
172
+ constructor(n) {
173
+ super();
174
+ this.n = n;
175
+ }
176
+ }
177
+ export const Command$MoveToRow = (n) => new MoveToRow(n);
178
+ export const Command$isMoveToRow = (value) => value instanceof MoveToRow;
179
+ export const Command$MoveToRow$n = (value) => value.n;
180
+ export const Command$MoveToRow$0 = (value) => value.n;
181
+
182
+ /**
183
+ * Moves the cursor to the given row and column.
184
+ */
185
+ export class MoveTo extends $CustomType {
186
+ constructor(column, row) {
187
+ super();
188
+ this.column = column;
189
+ this.row = row;
190
+ }
191
+ }
192
+ export const Command$MoveTo = (column, row) => new MoveTo(column, row);
193
+ export const Command$isMoveTo = (value) => value instanceof MoveTo;
194
+ export const Command$MoveTo$column = (value) => value.column;
195
+ export const Command$MoveTo$0 = (value) => value.column;
196
+ export const Command$MoveTo$row = (value) => value.row;
197
+ export const Command$MoveTo$1 = (value) => value.row;
198
+
199
+ export class SavePosition extends $CustomType {}
200
+ export const Command$SavePosition = () => new SavePosition();
201
+ export const Command$isSavePosition = (value) => value instanceof SavePosition;
202
+
203
+ export class RestorePosition extends $CustomType {}
204
+ export const Command$RestorePosition = () => new RestorePosition();
205
+ export const Command$isRestorePosition = (value) =>
206
+ value instanceof RestorePosition;
207
+
208
+ export class ShowCursor extends $CustomType {}
209
+ export const Command$ShowCursor = () => new ShowCursor();
210
+ export const Command$isShowCursor = (value) => value instanceof ShowCursor;
211
+
212
+ export class HideCursor extends $CustomType {}
213
+ export const Command$HideCursor = () => new HideCursor();
214
+ export const Command$isHideCursor = (value) => value instanceof HideCursor;
215
+
216
+ /**
217
+ * Sets cursor style. See [`CursorStyle`](cursor.html#CursorStyle).
218
+ */
219
+ export class SetCursorStyle extends $CustomType {
220
+ constructor(style) {
221
+ super();
222
+ this.style = style;
223
+ }
224
+ }
225
+ export const Command$SetCursorStyle = (style) => new SetCursorStyle(style);
226
+ export const Command$isSetCursorStyle = (value) =>
227
+ value instanceof SetCursorStyle;
228
+ export const Command$SetCursorStyle$style = (value) => value.style;
229
+ export const Command$SetCursorStyle$0 = (value) => value.style;
230
+
231
+ /**
232
+ * Scrolls the terminal n lines up.
233
+ */
234
+ export class ScrollUp extends $CustomType {
235
+ constructor(n) {
236
+ super();
237
+ this.n = n;
238
+ }
239
+ }
240
+ export const Command$ScrollUp = (n) => new ScrollUp(n);
241
+ export const Command$isScrollUp = (value) => value instanceof ScrollUp;
242
+ export const Command$ScrollUp$n = (value) => value.n;
243
+ export const Command$ScrollUp$0 = (value) => value.n;
244
+
245
+ /**
246
+ * Scrolls the terminal n lines down.
247
+ */
248
+ export class ScrollDown extends $CustomType {
249
+ constructor(n) {
250
+ super();
251
+ this.n = n;
252
+ }
253
+ }
254
+ export const Command$ScrollDown = (n) => new ScrollDown(n);
255
+ export const Command$isScrollDown = (value) => value instanceof ScrollDown;
256
+ export const Command$ScrollDown$n = (value) => value.n;
257
+ export const Command$ScrollDown$0 = (value) => value.n;
258
+
259
+ /**
260
+ * Clears the terminal. See [`ClearType`](terminal.html#ClearType).
261
+ */
262
+ export class Clear extends $CustomType {
263
+ constructor(clear_type) {
264
+ super();
265
+ this.clear_type = clear_type;
266
+ }
267
+ }
268
+ export const Command$Clear = (clear_type) => new Clear(clear_type);
269
+ export const Command$isClear = (value) => value instanceof Clear;
270
+ export const Command$Clear$clear_type = (value) => value.clear_type;
271
+ export const Command$Clear$0 = (value) => value.clear_type;
272
+
273
+ /**
274
+ * Sets terminal size.
275
+ */
276
+ export class SetSize extends $CustomType {
277
+ constructor(columns, rows) {
278
+ super();
279
+ this.columns = columns;
280
+ this.rows = rows;
281
+ }
282
+ }
283
+ export const Command$SetSize = (columns, rows) => new SetSize(columns, rows);
284
+ export const Command$isSetSize = (value) => value instanceof SetSize;
285
+ export const Command$SetSize$columns = (value) => value.columns;
286
+ export const Command$SetSize$0 = (value) => value.columns;
287
+ export const Command$SetSize$rows = (value) => value.rows;
288
+ export const Command$SetSize$1 = (value) => value.rows;
289
+
290
+ /**
291
+ * Sets terminal title.
292
+ */
293
+ export class SetTitle extends $CustomType {
294
+ constructor(title) {
295
+ super();
296
+ this.title = title;
297
+ }
298
+ }
299
+ export const Command$SetTitle = (title) => new SetTitle(title);
300
+ export const Command$isSetTitle = (value) => value instanceof SetTitle;
301
+ export const Command$SetTitle$title = (value) => value.title;
302
+ export const Command$SetTitle$0 = (value) => value.title;
303
+
304
+ export class DisableLineWrap extends $CustomType {}
305
+ export const Command$DisableLineWrap = () => new DisableLineWrap();
306
+ export const Command$isDisableLineWrap = (value) =>
307
+ value instanceof DisableLineWrap;
308
+
309
+ export class EnableLineWrap extends $CustomType {}
310
+ export const Command$EnableLineWrap = () => new EnableLineWrap();
311
+ export const Command$isEnableLineWrap = (value) =>
312
+ value instanceof EnableLineWrap;
313
+
314
+ export class EnterAlternateScreen extends $CustomType {}
315
+ export const Command$EnterAlternateScreen = () => new EnterAlternateScreen();
316
+ export const Command$isEnterAlternateScreen = (value) =>
317
+ value instanceof EnterAlternateScreen;
318
+
319
+ export class LeaveAlternateScreen extends $CustomType {}
320
+ export const Command$LeaveAlternateScreen = () => new LeaveAlternateScreen();
321
+ export const Command$isLeaveAlternateScreen = (value) =>
322
+ value instanceof LeaveAlternateScreen;
323
+
324
+ export class EnableMouseCapture extends $CustomType {}
325
+ export const Command$EnableMouseCapture = () => new EnableMouseCapture();
326
+ export const Command$isEnableMouseCapture = (value) =>
327
+ value instanceof EnableMouseCapture;
328
+
329
+ export class DisableMouseCapture extends $CustomType {}
330
+ export const Command$DisableMouseCapture = () => new DisableMouseCapture();
331
+ export const Command$isDisableMouseCapture = (value) =>
332
+ value instanceof DisableMouseCapture;
333
+
334
+ /**
335
+ * Pushes keyboard enhancement flags.
336
+ * See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement
337
+ */
338
+ export class PushKeyboardEnhancementFlags extends $CustomType {
339
+ constructor(flags) {
340
+ super();
341
+ this.flags = flags;
342
+ }
343
+ }
344
+ export const Command$PushKeyboardEnhancementFlags = (flags) =>
345
+ new PushKeyboardEnhancementFlags(flags);
346
+ export const Command$isPushKeyboardEnhancementFlags = (value) =>
347
+ value instanceof PushKeyboardEnhancementFlags;
348
+ export const Command$PushKeyboardEnhancementFlags$flags = (value) =>
349
+ value.flags;
350
+ export const Command$PushKeyboardEnhancementFlags$0 = (value) => value.flags;
351
+
352
+ export class PopKeyboardEnhancementFlags extends $CustomType {}
353
+ export const Command$PopKeyboardEnhancementFlags = () =>
354
+ new PopKeyboardEnhancementFlags();
355
+ export const Command$isPopKeyboardEnhancementFlags = (value) =>
356
+ value instanceof PopKeyboardEnhancementFlags;
357
+
358
+ export class EnableFocusChange extends $CustomType {}
359
+ export const Command$EnableFocusChange = () => new EnableFocusChange();
360
+ export const Command$isEnableFocusChange = (value) =>
361
+ value instanceof EnableFocusChange;
362
+
363
+ export class DisableFocusChange extends $CustomType {}
364
+ export const Command$DisableFocusChange = () => new DisableFocusChange();
365
+ export const Command$isDisableFocusChange = (value) =>
366
+ value instanceof DisableFocusChange;
367
+
368
+ /**
369
+ * Sets foreground [`Color`](style.html#Color).
370
+ * Using [`SetForegroundAndBackgroundColors`](command.html#SetForegroundAndBackgroundColors)
371
+ * is prefered to set both the background and foreground colors.
372
+ */
373
+ export class SetForegroundColor extends $CustomType {
374
+ constructor(fg) {
375
+ super();
376
+ this.fg = fg;
377
+ }
378
+ }
379
+ export const Command$SetForegroundColor = (fg) => new SetForegroundColor(fg);
380
+ export const Command$isSetForegroundColor = (value) =>
381
+ value instanceof SetForegroundColor;
382
+ export const Command$SetForegroundColor$fg = (value) => value.fg;
383
+ export const Command$SetForegroundColor$0 = (value) => value.fg;
384
+
385
+ /**
386
+ * Sets background [`Color`](style.html#Color).
387
+ * Using [`SetForegroundAndBackgroundColors`](command.html#SetForegroundAndBackgroundColors)
388
+ * is prefered to set both the background and foreground colors.
389
+ */
390
+ export class SetBackgroundColor extends $CustomType {
391
+ constructor(bg) {
392
+ super();
393
+ this.bg = bg;
394
+ }
395
+ }
396
+ export const Command$SetBackgroundColor = (bg) => new SetBackgroundColor(bg);
397
+ export const Command$isSetBackgroundColor = (value) =>
398
+ value instanceof SetBackgroundColor;
399
+ export const Command$SetBackgroundColor$bg = (value) => value.bg;
400
+ export const Command$SetBackgroundColor$0 = (value) => value.bg;
401
+
402
+ /**
403
+ * Sets foreground and background [`Colors`](style.html#Color).
404
+ * Using this is prefered to set both the background and foreground colors.
405
+ */
406
+ export class SetForegroundAndBackgroundColors extends $CustomType {
407
+ constructor(fg, bg) {
408
+ super();
409
+ this.fg = fg;
410
+ this.bg = bg;
411
+ }
412
+ }
413
+ export const Command$SetForegroundAndBackgroundColors = (fg, bg) =>
414
+ new SetForegroundAndBackgroundColors(fg, bg);
415
+ export const Command$isSetForegroundAndBackgroundColors = (value) =>
416
+ value instanceof SetForegroundAndBackgroundColors;
417
+ export const Command$SetForegroundAndBackgroundColors$fg = (value) => value.fg;
418
+ export const Command$SetForegroundAndBackgroundColors$0 = (value) => value.fg;
419
+ export const Command$SetForegroundAndBackgroundColors$bg = (value) => value.bg;
420
+ export const Command$SetForegroundAndBackgroundColors$1 = (value) => value.bg;
421
+
422
+ /**
423
+ * Sets [`Style`](style.html#Style)
424
+ * Example:
425
+ * ```gleam
426
+ * execute([
427
+ * command.SetStyle(Style(fg: style.Red, bg: style.Black, attributes: [style.Underline])),
428
+ * command.Print("my string"),
429
+ * command.ResetStyle,
430
+ * ])
431
+ */
432
+ export class SetStyle extends $CustomType {
433
+ constructor(style) {
434
+ super();
435
+ this.style = style;
436
+ }
437
+ }
438
+ export const Command$SetStyle = (style) => new SetStyle(style);
439
+ export const Command$isSetStyle = (value) => value instanceof SetStyle;
440
+ export const Command$SetStyle$style = (value) => value.style;
441
+ export const Command$SetStyle$0 = (value) => value.style;
442
+
443
+ export class ResetStyle extends $CustomType {}
444
+ export const Command$ResetStyle = () => new ResetStyle();
445
+ export const Command$isResetStyle = (value) => value instanceof ResetStyle;
446
+
447
+ export class ResetColor extends $CustomType {}
448
+ export const Command$ResetColor = () => new ResetColor();
449
+ export const Command$isResetColor = (value) => value instanceof ResetColor;
450
+
451
+ export class ResetForeground extends $CustomType {}
452
+ export const Command$ResetForeground = () => new ResetForeground();
453
+ export const Command$isResetForeground = (value) =>
454
+ value instanceof ResetForeground;
455
+
456
+ export class ResetBackground extends $CustomType {}
457
+ export const Command$ResetBackground = () => new ResetBackground();
458
+ export const Command$isResetBackground = (value) =>
459
+ value instanceof ResetBackground;
460
+
461
+ /**
462
+ * Sets [`Attributes`](style.html#Attribute).
463
+ */
464
+ export class SetAttributes extends $CustomType {
465
+ constructor(attrs) {
466
+ super();
467
+ this.attrs = attrs;
468
+ }
469
+ }
470
+ export const Command$SetAttributes = (attrs) => new SetAttributes(attrs);
471
+ export const Command$isSetAttributes = (value) =>
472
+ value instanceof SetAttributes;
473
+ export const Command$SetAttributes$attrs = (value) => value.attrs;
474
+ export const Command$SetAttributes$0 = (value) => value.attrs;
475
+
476
+ export class ResetAttributes extends $CustomType {}
477
+ export const Command$ResetAttributes = () => new ResetAttributes();
478
+ export const Command$isResetAttributes = (value) =>
479
+ value instanceof ResetAttributes;
@@ -0,0 +1,164 @@
1
+ import * as $int from "../../gleam_stdlib/gleam/int.mjs";
2
+ import * as $consts from "../etch/internal/consts.mjs";
3
+ import { csi, esc } from "../etch/internal/consts.mjs";
4
+ import { CustomType as $CustomType } from "../gleam.mjs";
5
+
6
+ export class DefaultShape extends $CustomType {}
7
+ export const CursorStyle$DefaultShape = () => new DefaultShape();
8
+ export const CursorStyle$isDefaultShape = (value) =>
9
+ value instanceof DefaultShape;
10
+
11
+ export class BlinkingBlock extends $CustomType {}
12
+ export const CursorStyle$BlinkingBlock = () => new BlinkingBlock();
13
+ export const CursorStyle$isBlinkingBlock = (value) =>
14
+ value instanceof BlinkingBlock;
15
+
16
+ export class SteadyBlock extends $CustomType {}
17
+ export const CursorStyle$SteadyBlock = () => new SteadyBlock();
18
+ export const CursorStyle$isSteadyBlock = (value) =>
19
+ value instanceof SteadyBlock;
20
+
21
+ export class BlinkingUnderScore extends $CustomType {}
22
+ export const CursorStyle$BlinkingUnderScore = () => new BlinkingUnderScore();
23
+ export const CursorStyle$isBlinkingUnderScore = (value) =>
24
+ value instanceof BlinkingUnderScore;
25
+
26
+ export class SteadyUnderScore extends $CustomType {}
27
+ export const CursorStyle$SteadyUnderScore = () => new SteadyUnderScore();
28
+ export const CursorStyle$isSteadyUnderScore = (value) =>
29
+ value instanceof SteadyUnderScore;
30
+
31
+ export class BlinkingBar extends $CustomType {}
32
+ export const CursorStyle$BlinkingBar = () => new BlinkingBar();
33
+ export const CursorStyle$isBlinkingBar = (value) =>
34
+ value instanceof BlinkingBar;
35
+
36
+ export class SteadyBar extends $CustomType {}
37
+ export const CursorStyle$SteadyBar = () => new SteadyBar();
38
+ export const CursorStyle$isSteadyBar = (value) => value instanceof SteadyBar;
39
+
40
+ /**
41
+ * Moves cursor to the given position.
42
+ * It is prefered not to use this directly. See [`MoveTo`](command.html#MoveTo).
43
+ */
44
+ export function move_to(x, y) {
45
+ return (((csi + $int.to_string(y + 1)) + ";") + $int.to_string(x + 1)) + "H";
46
+ }
47
+
48
+ /**
49
+ * Hides cursor.
50
+ * It is prefered not to use this directly. See [`Hide`](command.html#Hide).
51
+ */
52
+ export function hide() {
53
+ return csi + "?25l";
54
+ }
55
+
56
+ /**
57
+ * Shows cursor.
58
+ * It is prefered not to use this directly. See [`Show`](command.html#Show).
59
+ */
60
+ export function show() {
61
+ return csi + "?25h";
62
+ }
63
+
64
+ /**
65
+ * Moves cursor to the next line (at the beginning of the line below).
66
+ * It is prefered not to use this directly. See [`MoveToNextLine`](command.html#MoveToNextLine).
67
+ */
68
+ export function move_to_next_line(n) {
69
+ return (csi + $int.to_string(n)) + "E";
70
+ }
71
+
72
+ /**
73
+ * Moves cursor to the previous line (at the beginning of the line above).
74
+ * It is prefered not to use this directly. See [`MoveToPreviousLine`](command.html#MoveToPreviousLine).
75
+ */
76
+ export function move_to_previous_line(n) {
77
+ return (csi + $int.to_string(n)) + "F";
78
+ }
79
+
80
+ /**
81
+ * Moves cursor to the given column (the row remains unchainged).
82
+ * It is prefered not to use this directly. See [`MoveToColumn`](command.html#MoveToColumn).
83
+ */
84
+ export function move_to_column(n) {
85
+ return (csi + $int.to_string(n)) + "G";
86
+ }
87
+
88
+ /**
89
+ * Moves cursor to the given row (the column remains unchainged).
90
+ * It is prefered not to use this directly. See [`MoveToRow`](command.html#MoveToRow).
91
+ */
92
+ export function move_to_row(n) {
93
+ return (csi + $int.to_string(n)) + "d";
94
+ }
95
+
96
+ /**
97
+ * Moves cursor n column to the right.
98
+ * It is prefered not to use this directly. See [`MoveRight`](command.html#MoveRight).
99
+ */
100
+ export function move_right(n) {
101
+ return (csi + $int.to_string(n)) + "C";
102
+ }
103
+
104
+ /**
105
+ * Moves cursor n column to the left.
106
+ * It is prefered not to use this directly. See [`MoveLeft`](command.html#MoveLeft).
107
+ */
108
+ export function move_left(n) {
109
+ return (csi + $int.to_string(n)) + "D";
110
+ }
111
+
112
+ /**
113
+ * Moves cursor n rows to the up.
114
+ * It is prefered not to use this directly. See [`MoveUp`](command.html#MoveUp).
115
+ */
116
+ export function move_up(n) {
117
+ return (csi + $int.to_string(n)) + "A";
118
+ }
119
+
120
+ /**
121
+ * Moves cursor n rows to the down.
122
+ * It is prefered not to use this directly. See [`MoveDown`](command.html#MoveDown).
123
+ */
124
+ export function move_down(n) {
125
+ return (csi + $int.to_string(n)) + "B";
126
+ }
127
+
128
+ /**
129
+ * Sets cursor style.
130
+ * It is prefered not to use this directly. See [`SetCursorStyle`](command.html#SetCursorStyle).
131
+ */
132
+ export function set_cursor_style(s) {
133
+ if (s instanceof DefaultShape) {
134
+ return csi + "0 q";
135
+ } else if (s instanceof BlinkingBlock) {
136
+ return csi + "1 q";
137
+ } else if (s instanceof SteadyBlock) {
138
+ return csi + "2 q";
139
+ } else if (s instanceof BlinkingUnderScore) {
140
+ return csi + "3 q";
141
+ } else if (s instanceof SteadyUnderScore) {
142
+ return csi + "4 q";
143
+ } else if (s instanceof BlinkingBar) {
144
+ return csi + "5 q";
145
+ } else {
146
+ return csi + "6 q";
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Saves current cursor position.
152
+ * It is prefered not to use this directly. See [`SavePosition`](command.html#SavePosition).
153
+ */
154
+ export function save_position() {
155
+ return esc + "7";
156
+ }
157
+
158
+ /**
159
+ * Restores saved cursor position.
160
+ * It is prefered not to use this directly. See [`RestorePosition`](command.html#RestorePosition).
161
+ */
162
+ export function restore_position() {
163
+ return esc + "8";
164
+ }