ratatui_ruby 1.4.0-x86_64-linux

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 (292) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +15 -0
  3. data/LICENSES/AGPL-3.0-or-later.txt +661 -0
  4. data/LICENSES/CC-BY-SA-4.0.txt +427 -0
  5. data/LICENSES/CC0-1.0.txt +121 -0
  6. data/LICENSES/LGPL-3.0-or-later.txt +304 -0
  7. data/LICENSES/MIT-0.txt +16 -0
  8. data/LICENSES/MIT.txt +21 -0
  9. data/REUSE.toml +42 -0
  10. data/exe/.gitkeep +0 -0
  11. data/ext/ratatui_ruby/.cargo/config.toml +13 -0
  12. data/ext/ratatui_ruby/.gitignore +4 -0
  13. data/ext/ratatui_ruby/Cargo.lock +1737 -0
  14. data/ext/ratatui_ruby/Cargo.toml +24 -0
  15. data/ext/ratatui_ruby/clippy.toml +7 -0
  16. data/ext/ratatui_ruby/extconf.rb +21 -0
  17. data/ext/ratatui_ruby/src/color.rs +82 -0
  18. data/ext/ratatui_ruby/src/errors.rs +28 -0
  19. data/ext/ratatui_ruby/src/events.rs +700 -0
  20. data/ext/ratatui_ruby/src/frame.rs +241 -0
  21. data/ext/ratatui_ruby/src/lib.rs +343 -0
  22. data/ext/ratatui_ruby/src/lib_header.rs +11 -0
  23. data/ext/ratatui_ruby/src/rendering.rs +158 -0
  24. data/ext/ratatui_ruby/src/string_width.rs +101 -0
  25. data/ext/ratatui_ruby/src/style.rs +469 -0
  26. data/ext/ratatui_ruby/src/terminal/capabilities.rs +46 -0
  27. data/ext/ratatui_ruby/src/terminal/init.rs +233 -0
  28. data/ext/ratatui_ruby/src/terminal/mod.rs +42 -0
  29. data/ext/ratatui_ruby/src/terminal/mutations.rs +158 -0
  30. data/ext/ratatui_ruby/src/terminal/queries.rs +231 -0
  31. data/ext/ratatui_ruby/src/terminal/query.rs +400 -0
  32. data/ext/ratatui_ruby/src/terminal/storage.rs +109 -0
  33. data/ext/ratatui_ruby/src/terminal/wrapper.rs +16 -0
  34. data/ext/ratatui_ruby/src/text.rs +225 -0
  35. data/ext/ratatui_ruby/src/widgets/barchart.rs +169 -0
  36. data/ext/ratatui_ruby/src/widgets/block.rs +41 -0
  37. data/ext/ratatui_ruby/src/widgets/calendar.rs +84 -0
  38. data/ext/ratatui_ruby/src/widgets/canvas.rs +183 -0
  39. data/ext/ratatui_ruby/src/widgets/center.rs +79 -0
  40. data/ext/ratatui_ruby/src/widgets/chart.rs +222 -0
  41. data/ext/ratatui_ruby/src/widgets/clear.rs +39 -0
  42. data/ext/ratatui_ruby/src/widgets/cursor.rs +32 -0
  43. data/ext/ratatui_ruby/src/widgets/gauge.rs +65 -0
  44. data/ext/ratatui_ruby/src/widgets/layout.rs +379 -0
  45. data/ext/ratatui_ruby/src/widgets/line_gauge.rs +100 -0
  46. data/ext/ratatui_ruby/src/widgets/list.rs +378 -0
  47. data/ext/ratatui_ruby/src/widgets/list_state.rs +173 -0
  48. data/ext/ratatui_ruby/src/widgets/mod.rs +26 -0
  49. data/ext/ratatui_ruby/src/widgets/overlay.rs +24 -0
  50. data/ext/ratatui_ruby/src/widgets/paragraph.rs +87 -0
  51. data/ext/ratatui_ruby/src/widgets/ratatui_logo.rs +40 -0
  52. data/ext/ratatui_ruby/src/widgets/ratatui_mascot.rs +55 -0
  53. data/ext/ratatui_ruby/src/widgets/scrollbar.rs +214 -0
  54. data/ext/ratatui_ruby/src/widgets/scrollbar_state.rs +169 -0
  55. data/ext/ratatui_ruby/src/widgets/sparkline.rs +127 -0
  56. data/ext/ratatui_ruby/src/widgets/table.rs +415 -0
  57. data/ext/ratatui_ruby/src/widgets/table_state.rs +203 -0
  58. data/ext/ratatui_ruby/src/widgets/tabs.rs +194 -0
  59. data/lib/ratatui_ruby/backend/window_size.rb +50 -0
  60. data/lib/ratatui_ruby/backend.rb +59 -0
  61. data/lib/ratatui_ruby/buffer/cell.rb +212 -0
  62. data/lib/ratatui_ruby/buffer.rb +149 -0
  63. data/lib/ratatui_ruby/cell.rb +208 -0
  64. data/lib/ratatui_ruby/debug.rb +215 -0
  65. data/lib/ratatui_ruby/draw.rb +63 -0
  66. data/lib/ratatui_ruby/event/focus_gained.rb +125 -0
  67. data/lib/ratatui_ruby/event/focus_lost.rb +127 -0
  68. data/lib/ratatui_ruby/event/key/character.rb +53 -0
  69. data/lib/ratatui_ruby/event/key/dwim.rb +301 -0
  70. data/lib/ratatui_ruby/event/key/media.rb +46 -0
  71. data/lib/ratatui_ruby/event/key/modifier.rb +107 -0
  72. data/lib/ratatui_ruby/event/key/navigation.rb +72 -0
  73. data/lib/ratatui_ruby/event/key/system.rb +47 -0
  74. data/lib/ratatui_ruby/event/key.rb +479 -0
  75. data/lib/ratatui_ruby/event/mouse.rb +291 -0
  76. data/lib/ratatui_ruby/event/none.rb +53 -0
  77. data/lib/ratatui_ruby/event/paste.rb +130 -0
  78. data/lib/ratatui_ruby/event/resize.rb +221 -0
  79. data/lib/ratatui_ruby/event/sync.rb +52 -0
  80. data/lib/ratatui_ruby/event.rb +163 -0
  81. data/lib/ratatui_ruby/frame.rb +257 -0
  82. data/lib/ratatui_ruby/labs/a11y.rb +182 -0
  83. data/lib/ratatui_ruby/labs/frame_a11y_capture.rb +50 -0
  84. data/lib/ratatui_ruby/labs.rb +47 -0
  85. data/lib/ratatui_ruby/layout/alignment.rb +91 -0
  86. data/lib/ratatui_ruby/layout/constraint.rb +337 -0
  87. data/lib/ratatui_ruby/layout/layout.rb +258 -0
  88. data/lib/ratatui_ruby/layout/position.rb +81 -0
  89. data/lib/ratatui_ruby/layout/rect.rb +733 -0
  90. data/lib/ratatui_ruby/layout/size.rb +62 -0
  91. data/lib/ratatui_ruby/layout.rb +29 -0
  92. data/lib/ratatui_ruby/list_state.rb +201 -0
  93. data/lib/ratatui_ruby/output_guard.rb +171 -0
  94. data/lib/ratatui_ruby/ratatui_ruby.so +0 -0
  95. data/lib/ratatui_ruby/scrollbar_state.rb +122 -0
  96. data/lib/ratatui_ruby/style/color.rb +149 -0
  97. data/lib/ratatui_ruby/style/style.rb +147 -0
  98. data/lib/ratatui_ruby/style.rb +19 -0
  99. data/lib/ratatui_ruby/symbols.rb +435 -0
  100. data/lib/ratatui_ruby/synthetic_events.rb +106 -0
  101. data/lib/ratatui_ruby/table_state.rb +251 -0
  102. data/lib/ratatui_ruby/terminal/capabilities.rb +316 -0
  103. data/lib/ratatui_ruby/terminal/viewport.rb +80 -0
  104. data/lib/ratatui_ruby/terminal.rb +66 -0
  105. data/lib/ratatui_ruby/terminal_lifecycle.rb +303 -0
  106. data/lib/ratatui_ruby/terminal_lifecycle.rb.bak +197 -0
  107. data/lib/ratatui_ruby/test_helper/event_injection.rb +241 -0
  108. data/lib/ratatui_ruby/test_helper/global_state.rb +111 -0
  109. data/lib/ratatui_ruby/test_helper/snapshot.rb +568 -0
  110. data/lib/ratatui_ruby/test_helper/snapshots/axis_labels_alignment.ansi +24 -0
  111. data/lib/ratatui_ruby/test_helper/snapshots/axis_labels_alignment.txt +24 -0
  112. data/lib/ratatui_ruby/test_helper/snapshots/barchart_styled_label.ansi +5 -0
  113. data/lib/ratatui_ruby/test_helper/snapshots/barchart_styled_label.txt +5 -0
  114. data/lib/ratatui_ruby/test_helper/snapshots/chart_rendering.ansi +24 -0
  115. data/lib/ratatui_ruby/test_helper/snapshots/chart_rendering.txt +24 -0
  116. data/lib/ratatui_ruby/test_helper/snapshots/half_block_marker.ansi +12 -0
  117. data/lib/ratatui_ruby/test_helper/snapshots/half_block_marker.txt +12 -0
  118. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_bottom.ansi +12 -0
  119. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_bottom.txt +12 -0
  120. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_left.ansi +12 -0
  121. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_left.txt +12 -0
  122. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_right.ansi +12 -0
  123. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_right.txt +12 -0
  124. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_top.ansi +12 -0
  125. data/lib/ratatui_ruby/test_helper/snapshots/legend_position_top.txt +12 -0
  126. data/lib/ratatui_ruby/test_helper/snapshots/my_snapshot.txt +1 -0
  127. data/lib/ratatui_ruby/test_helper/snapshots/styled_axis_title.ansi +10 -0
  128. data/lib/ratatui_ruby/test_helper/snapshots/styled_axis_title.txt +10 -0
  129. data/lib/ratatui_ruby/test_helper/snapshots/styled_dataset_name.ansi +10 -0
  130. data/lib/ratatui_ruby/test_helper/snapshots/styled_dataset_name.txt +10 -0
  131. data/lib/ratatui_ruby/test_helper/style_assertions.rb +449 -0
  132. data/lib/ratatui_ruby/test_helper/subprocess_timeout.rb +35 -0
  133. data/lib/ratatui_ruby/test_helper/terminal.rb +187 -0
  134. data/lib/ratatui_ruby/test_helper/test_doubles.rb +86 -0
  135. data/lib/ratatui_ruby/test_helper.rb +115 -0
  136. data/lib/ratatui_ruby/text/line.rb +245 -0
  137. data/lib/ratatui_ruby/text/span.rb +158 -0
  138. data/lib/ratatui_ruby/text.rb +99 -0
  139. data/lib/ratatui_ruby/tui/buffer_factories.rb +22 -0
  140. data/lib/ratatui_ruby/tui/canvas_factories.rb +149 -0
  141. data/lib/ratatui_ruby/tui/core.rb +67 -0
  142. data/lib/ratatui_ruby/tui/layout_factories.rb +153 -0
  143. data/lib/ratatui_ruby/tui/state_factories.rb +77 -0
  144. data/lib/ratatui_ruby/tui/style_factories.rb +22 -0
  145. data/lib/ratatui_ruby/tui/text_factories.rb +86 -0
  146. data/lib/ratatui_ruby/tui/widget_factories.rb +272 -0
  147. data/lib/ratatui_ruby/tui.rb +106 -0
  148. data/lib/ratatui_ruby/version.rb +12 -0
  149. data/lib/ratatui_ruby/widgets/bar_chart/bar.rb +51 -0
  150. data/lib/ratatui_ruby/widgets/bar_chart/bar_group.rb +29 -0
  151. data/lib/ratatui_ruby/widgets/bar_chart.rb +308 -0
  152. data/lib/ratatui_ruby/widgets/block.rb +266 -0
  153. data/lib/ratatui_ruby/widgets/calendar.rb +88 -0
  154. data/lib/ratatui_ruby/widgets/canvas.rb +297 -0
  155. data/lib/ratatui_ruby/widgets/cell.rb +59 -0
  156. data/lib/ratatui_ruby/widgets/center.rb +71 -0
  157. data/lib/ratatui_ruby/widgets/chart.rb +172 -0
  158. data/lib/ratatui_ruby/widgets/clear.rb +66 -0
  159. data/lib/ratatui_ruby/widgets/coerceable_widget.rb +77 -0
  160. data/lib/ratatui_ruby/widgets/cursor.rb +54 -0
  161. data/lib/ratatui_ruby/widgets/gauge.rb +146 -0
  162. data/lib/ratatui_ruby/widgets/line_gauge.rb +158 -0
  163. data/lib/ratatui_ruby/widgets/list.rb +252 -0
  164. data/lib/ratatui_ruby/widgets/list_item.rb +55 -0
  165. data/lib/ratatui_ruby/widgets/overlay.rb +55 -0
  166. data/lib/ratatui_ruby/widgets/paragraph.rb +113 -0
  167. data/lib/ratatui_ruby/widgets/ratatui_logo.rb +35 -0
  168. data/lib/ratatui_ruby/widgets/ratatui_mascot.rb +40 -0
  169. data/lib/ratatui_ruby/widgets/row.rb +123 -0
  170. data/lib/ratatui_ruby/widgets/scrollbar.rb +147 -0
  171. data/lib/ratatui_ruby/widgets/shape/label.rb +80 -0
  172. data/lib/ratatui_ruby/widgets/sparkline.rb +153 -0
  173. data/lib/ratatui_ruby/widgets/table.rb +213 -0
  174. data/lib/ratatui_ruby/widgets/tabs.rb +91 -0
  175. data/lib/ratatui_ruby/widgets.rb +43 -0
  176. data/lib/ratatui_ruby.rb +555 -0
  177. data/sig/examples/app_all_events/app.rbs +11 -0
  178. data/sig/examples/app_all_events/model/app_model.rbs +23 -0
  179. data/sig/examples/app_all_events/model/event_entry.rbs +23 -0
  180. data/sig/examples/app_all_events/model/timestamp.rbs +11 -0
  181. data/sig/examples/app_all_events/view/app_view.rbs +8 -0
  182. data/sig/examples/app_all_events/view/controls_view.rbs +6 -0
  183. data/sig/examples/app_all_events/view/counts_view.rbs +6 -0
  184. data/sig/examples/app_all_events/view/live_view.rbs +6 -0
  185. data/sig/examples/app_all_events/view/log_view.rbs +6 -0
  186. data/sig/examples/app_all_events/view.rbs +14 -0
  187. data/sig/examples/app_cli_rich_moments/app.rbs +12 -0
  188. data/sig/examples/app_color_picker/app.rbs +17 -0
  189. data/sig/examples/app_external_editor/app.rbs +12 -0
  190. data/sig/examples/app_login_form/app.rbs +11 -0
  191. data/sig/examples/app_stateful_interaction/app.rbs +39 -0
  192. data/sig/examples/verify_quickstart_dsl/app.rbs +17 -0
  193. data/sig/examples/verify_quickstart_lifecycle/app.rbs +17 -0
  194. data/sig/examples/verify_readme_usage/app.rbs +17 -0
  195. data/sig/examples/widget_block_demo/app.rbs +38 -0
  196. data/sig/examples/widget_box_demo/app.rbs +17 -0
  197. data/sig/examples/widget_calendar_demo/app.rbs +17 -0
  198. data/sig/examples/widget_cell_demo/app.rbs +17 -0
  199. data/sig/examples/widget_chart_demo/app.rbs +17 -0
  200. data/sig/examples/widget_gauge_demo/app.rbs +17 -0
  201. data/sig/examples/widget_layout_split/app.rbs +16 -0
  202. data/sig/examples/widget_line_gauge_demo/app.rbs +17 -0
  203. data/sig/examples/widget_list_demo/app.rbs +17 -0
  204. data/sig/examples/widget_map_demo/app.rbs +17 -0
  205. data/sig/examples/widget_popup_demo/app.rbs +17 -0
  206. data/sig/examples/widget_ratatui_logo_demo/app.rbs +17 -0
  207. data/sig/examples/widget_ratatui_mascot_demo/app.rbs +17 -0
  208. data/sig/examples/widget_rect/app.rbs +18 -0
  209. data/sig/examples/widget_render/app.rbs +16 -0
  210. data/sig/examples/widget_rich_text/app.rbs +17 -0
  211. data/sig/examples/widget_scroll_text/app.rbs +17 -0
  212. data/sig/examples/widget_scrollbar_demo/app.rbs +17 -0
  213. data/sig/examples/widget_sparkline_demo/app.rbs +16 -0
  214. data/sig/examples/widget_style_colors/app.rbs +20 -0
  215. data/sig/examples/widget_table_demo/app.rbs +17 -0
  216. data/sig/examples/widget_text_width/app.rbs +16 -0
  217. data/sig/generated/event_key_predicates.rbs +1348 -0
  218. data/sig/manifest.yaml +5 -0
  219. data/sig/patches/data.rbs +26 -0
  220. data/sig/patches/debugger__.rbs +8 -0
  221. data/sig/ratatui_ruby/backend/window_size.rbs +17 -0
  222. data/sig/ratatui_ruby/backend.rbs +12 -0
  223. data/sig/ratatui_ruby/buffer/cell.rbs +46 -0
  224. data/sig/ratatui_ruby/buffer.rbs +18 -0
  225. data/sig/ratatui_ruby/cell.rbs +44 -0
  226. data/sig/ratatui_ruby/clear.rbs +18 -0
  227. data/sig/ratatui_ruby/constraint.rbs +26 -0
  228. data/sig/ratatui_ruby/debug.rbs +45 -0
  229. data/sig/ratatui_ruby/draw.rbs +30 -0
  230. data/sig/ratatui_ruby/event.rbs +249 -0
  231. data/sig/ratatui_ruby/frame.rbs +23 -0
  232. data/sig/ratatui_ruby/interfaces.rbs +25 -0
  233. data/sig/ratatui_ruby/labs.rbs +90 -0
  234. data/sig/ratatui_ruby/layout/alignment.rbs +26 -0
  235. data/sig/ratatui_ruby/layout/constraint.rbs +39 -0
  236. data/sig/ratatui_ruby/layout/layout.rbs +45 -0
  237. data/sig/ratatui_ruby/layout/position.rbs +18 -0
  238. data/sig/ratatui_ruby/layout/rect.rbs +64 -0
  239. data/sig/ratatui_ruby/layout/size.rbs +18 -0
  240. data/sig/ratatui_ruby/list_state.rbs +23 -0
  241. data/sig/ratatui_ruby/output_guard.rbs +23 -0
  242. data/sig/ratatui_ruby/ratatui_ruby.rbs +113 -0
  243. data/sig/ratatui_ruby/rect.rbs +17 -0
  244. data/sig/ratatui_ruby/scrollbar_state.rbs +24 -0
  245. data/sig/ratatui_ruby/session.rbs +93 -0
  246. data/sig/ratatui_ruby/style/color.rbs +22 -0
  247. data/sig/ratatui_ruby/style/style.rbs +29 -0
  248. data/sig/ratatui_ruby/symbols.rbs +141 -0
  249. data/sig/ratatui_ruby/synthetic_events.rbs +24 -0
  250. data/sig/ratatui_ruby/table_state.rbs +27 -0
  251. data/sig/ratatui_ruby/terminal/capabilities.rbs +38 -0
  252. data/sig/ratatui_ruby/terminal/viewport.rbs +33 -0
  253. data/sig/ratatui_ruby/terminal_lifecycle.rbs +39 -0
  254. data/sig/ratatui_ruby/test_helper/event_injection.rbs +22 -0
  255. data/sig/ratatui_ruby/test_helper/snapshot.rbs +37 -0
  256. data/sig/ratatui_ruby/test_helper/style_assertions.rbs +77 -0
  257. data/sig/ratatui_ruby/test_helper/terminal.rbs +20 -0
  258. data/sig/ratatui_ruby/test_helper/test_doubles.rbs +32 -0
  259. data/sig/ratatui_ruby/test_helper.rbs +18 -0
  260. data/sig/ratatui_ruby/text/line.rbs +27 -0
  261. data/sig/ratatui_ruby/text/span.rbs +23 -0
  262. data/sig/ratatui_ruby/text.rbs +12 -0
  263. data/sig/ratatui_ruby/tui/buffer_factories.rbs +16 -0
  264. data/sig/ratatui_ruby/tui/canvas_factories.rbs +38 -0
  265. data/sig/ratatui_ruby/tui/core.rbs +23 -0
  266. data/sig/ratatui_ruby/tui/layout_factories.rbs +39 -0
  267. data/sig/ratatui_ruby/tui/state_factories.rbs +23 -0
  268. data/sig/ratatui_ruby/tui/style_factories.rbs +18 -0
  269. data/sig/ratatui_ruby/tui/text_factories.rbs +23 -0
  270. data/sig/ratatui_ruby/tui/widget_factories.rbs +138 -0
  271. data/sig/ratatui_ruby/tui.rbs +25 -0
  272. data/sig/ratatui_ruby/version.rbs +12 -0
  273. data/sig/ratatui_ruby/widgets/bar_chart.rbs +95 -0
  274. data/sig/ratatui_ruby/widgets/block.rbs +51 -0
  275. data/sig/ratatui_ruby/widgets/calendar.rbs +45 -0
  276. data/sig/ratatui_ruby/widgets/canvas.rbs +95 -0
  277. data/sig/ratatui_ruby/widgets/chart.rbs +91 -0
  278. data/sig/ratatui_ruby/widgets/coerceable_widget.rbs +26 -0
  279. data/sig/ratatui_ruby/widgets/gauge.rbs +44 -0
  280. data/sig/ratatui_ruby/widgets/line_gauge.rbs +48 -0
  281. data/sig/ratatui_ruby/widgets/list.rbs +63 -0
  282. data/sig/ratatui_ruby/widgets/misc.rbs +158 -0
  283. data/sig/ratatui_ruby/widgets/paragraph.rbs +45 -0
  284. data/sig/ratatui_ruby/widgets/row.rbs +43 -0
  285. data/sig/ratatui_ruby/widgets/scrollbar.rbs +53 -0
  286. data/sig/ratatui_ruby/widgets/shape/label.rbs +37 -0
  287. data/sig/ratatui_ruby/widgets/sparkline.rbs +45 -0
  288. data/sig/ratatui_ruby/widgets/table.rbs +78 -0
  289. data/sig/ratatui_ruby/widgets/tabs.rbs +44 -0
  290. data/sig/ratatui_ruby/widgets.rbs +16 -0
  291. data/vendor/goodcop/base.yml +1047 -0
  292. metadata +729 -0
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: AGPL-3.0-or-later
6
+ #++
7
+
8
+ # RBS type definitions for RatatuiRuby::Labs module
9
+
10
+ # Dir.tmpdir is from stdlib tmpdir extension
11
+ class Dir
12
+ def self.tmpdir: () -> String
13
+ end
14
+
15
+ # Interface for Data.define objects (widgets/nodes with to_h/members)
16
+ interface _DataLike
17
+ def to_h: () -> Hash[Symbol, Object]
18
+ def members: () -> Array[Symbol]
19
+ end
20
+
21
+ # Minimal REXML stubs (no official RBS types available)
22
+ module REXML
23
+ class Document
24
+ def self.new: (?untyped?) -> Document
25
+ def add: (untyped) -> void
26
+ end
27
+
28
+ class Element
29
+ def self.new: (String) -> Element
30
+ def add: (untyped) -> void
31
+ def add_attribute: (String, String) -> void
32
+ attr_accessor text: String?
33
+ end
34
+
35
+ class XMLDecl
36
+ def self.new: (String, String) -> XMLDecl
37
+ end
38
+
39
+ module Formatters
40
+ class Pretty
41
+ def self.new: (Integer) -> Pretty
42
+ attr_accessor compact: bool
43
+ def write: (untyped, untyped) -> void
44
+ end
45
+ end
46
+ end
47
+
48
+ module RatatuiRuby
49
+ module Labs
50
+ @enabled_lab: Symbol?
51
+ @warned: bool
52
+
53
+ def self.enabled?: (Symbol lab) -> bool
54
+ def self.enable!: (Symbol | String lab) -> void
55
+ def self.reset!: () -> void
56
+ def self.warn_once!: (String feature_name) -> void
57
+
58
+ module A11y
59
+ OUTPUT_PATH: String
60
+
61
+ @rexml_loaded: bool?
62
+
63
+ def self.dump_widget_tree: ((_CustomWidget | widget) widget, ?Layout::Rect? area) -> void
64
+ def self.dump_widgets: (Array[[(_CustomWidget | widget), Layout::Rect]] widgets_with_areas) -> void
65
+ def self.startup_message: () -> String
66
+
67
+ # Private class methods (called via class << self)
68
+ # Duck-typed serialization accepts any widget/value that may have to_h/members
69
+ def self.write_document: (REXML::Document doc) -> void
70
+ def self.build_element_with_area: ((_CustomWidget | widget) widget, Layout::Rect area) -> REXML::Element
71
+ def self.build_element: (untyped node) -> REXML::Element
72
+ def self.add_members: (REXML::Element element, untyped node, ?parent_id: String?) -> void
73
+ def self.scalar?: (untyped value) -> bool
74
+ def self.build_child_element: (Symbol key, untyped value, ?is_wrapper: bool, ?parent_id: String?) -> REXML::Element
75
+ def self.ensure_rexml_loaded: () -> void
76
+ end
77
+ end
78
+
79
+ class Frame
80
+ prepend A11yCapture
81
+
82
+ module A11yCapture
83
+ @a11y_widgets: Array[[(_CustomWidget | widget), Layout::Rect]]?
84
+
85
+ def render_widget: ((_CustomWidget | widget) widget, Layout::Rect area) -> void
86
+ def render_stateful_widget: (widget widget, Layout::Rect area, Object state) -> void
87
+ def flush_a11y_capture: () -> void
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ module RatatuiRuby
9
+ module Layout
10
+ module HorizontalAlignment
11
+ LEFT: :left
12
+ CENTER: :center
13
+ RIGHT: :right
14
+ ALL: Array[:left | :center | :right]
15
+ end
16
+
17
+ module VerticalAlignment
18
+ TOP: :top
19
+ CENTER: :center
20
+ BOTTOM: :bottom
21
+ ALL: Array[:top | :center | :bottom]
22
+ end
23
+
24
+ Alignment: singleton(HorizontalAlignment)
25
+ end
26
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ module Layout
12
+ class Constraint < Data
13
+ attr_reader type: Symbol
14
+ attr_reader value: (Integer | Array[Integer])
15
+ def self.length: (_ToI) -> Constraint
16
+ def self.percentage: (_ToI) -> Constraint
17
+ def self.min: (_ToI) -> Constraint
18
+ def self.max: (_ToI) -> Constraint
19
+ def self.fill: (?_ToI) -> Constraint
20
+ def self.ratio: (_ToI, _ToI) -> Constraint
21
+ def self.new: (type: Symbol, value: (Integer | Array[Integer])) -> Constraint
22
+ def initialize: (type: Symbol, value: (Integer | Array[Integer])) -> void
23
+
24
+ # Batch constructors
25
+ def self.from_lengths: (Enumerable[_ToI]) -> Array[Constraint]
26
+ def self.from_percentages: (Enumerable[_ToI]) -> Array[Constraint]
27
+ def self.from_mins: (Enumerable[_ToI]) -> Array[Constraint]
28
+ def self.from_maxes: (Enumerable[_ToI]) -> Array[Constraint]
29
+ def self.from_fills: (Enumerable[_ToI]) -> Array[Constraint]
30
+ def self.from_ratios: (Enumerable[[_ToI, _ToI]]) -> Array[Constraint]
31
+
32
+ # Instance methods
33
+ def apply: (_ToInt) -> Integer
34
+
35
+ # Ruby-idiomatic alias
36
+ alias call apply
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ module Layout
12
+ type flex_mode = Symbol
13
+
14
+ class Layout < Data
15
+ FLEX_MODES: Array[Symbol]
16
+ DIRECTION_VERTICAL: Symbol
17
+ DIRECTION_HORIZONTAL: Symbol
18
+ FLEX_LEGACY: Symbol
19
+ FLEX_START: Symbol
20
+ FLEX_CENTER: Symbol
21
+ FLEX_END: Symbol
22
+ FLEX_SPACE_BETWEEN: Symbol
23
+ FLEX_SPACE_AROUND: Symbol
24
+ FLEX_SPACE_EVENLY: Symbol
25
+
26
+ attr_reader direction: Symbol
27
+ attr_reader constraints: Array[Constraint]
28
+ attr_reader children: Array[RatatuiRuby::widget]
29
+ attr_reader flex: flex_mode
30
+ attr_reader margin: (Integer | Hash[Symbol, Integer])
31
+ attr_reader spacing: Integer
32
+ def self.new: (?direction: Symbol, ?constraints: Array[Constraint], ?children: Array[RatatuiRuby::widget], ?flex: flex_mode, ?margin: (Integer | Hash[Symbol, Integer]), ?spacing: Integer) -> Layout
33
+ def initialize: (?direction: Symbol, ?constraints: Array[Constraint], ?children: Array[RatatuiRuby::widget], ?flex: flex_mode, ?margin: (Integer | Hash[Symbol, Integer]), ?spacing: Integer) -> void
34
+ def self.split: ((Rect | Hash[Symbol, Integer]) area, ?direction: Symbol, constraints: Array[Constraint], ?flex: flex_mode) -> Array[Rect]
35
+
36
+ # Splits an area into segments and spacers.
37
+ # Returns [segments, spacers] where each is an Array of Rects.
38
+ def self.split_with_spacers: ((Rect | Hash[Symbol, Integer]) area, ?direction: Symbol, constraints: Array[Constraint], ?flex: flex_mode) -> [Array[Rect], Array[Rect]]
39
+
40
+ private
41
+
42
+ def self._split: (Rect, Symbol, Array[Constraint], Symbol) -> Array[Hash[Symbol, Integer]]
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ module RatatuiRuby
9
+ module Layout
10
+ class Position < Data
11
+ attr_reader x: Integer
12
+ attr_reader y: Integer
13
+
14
+ def self.new: (?x: _ToInt, ?y: _ToInt) -> instance
15
+ def initialize: (?x: _ToInt, ?y: _ToInt) -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ module Layout
12
+ class Rect < Data
13
+ attr_reader x: Integer
14
+ attr_reader y: Integer
15
+ attr_reader width: Integer
16
+ attr_reader height: Integer
17
+
18
+ def self.new: (?x: _ToI, ?y: _ToI, ?width: _ToI, ?height: _ToI) -> instance
19
+ def initialize: (?x: _ToI, ?y: _ToI, ?width: _ToI, ?height: _ToI) -> void
20
+
21
+ # Predicates
22
+ def contains?: (Integer px, Integer py) -> bool
23
+ def intersects?: (Rect other) -> bool
24
+ def empty?: () -> bool
25
+
26
+ # Edge accessors
27
+ def left: () -> Integer
28
+ def right: () -> Integer
29
+ def top: () -> Integer
30
+ def bottom: () -> Integer
31
+ def area: () -> Integer
32
+
33
+ # Geometry transformations
34
+ def intersection: (Rect other) -> Rect?
35
+ def union: (Rect other) -> Rect
36
+ def inner: (Integer margin) -> Rect
37
+ def outer: (Integer margin) -> Rect
38
+ def resize: (Size new_size) -> Rect
39
+ def offset: (Integer dx, Integer dy) -> Rect
40
+ def clamp: (Rect other) -> Rect
41
+
42
+ # Iterators
43
+ def rows: () -> Enumerator[Rect, void]
44
+ | () { (Rect) -> void } -> void
45
+ def columns: () -> Enumerator[Rect, void]
46
+ | () { (Rect) -> void } -> void
47
+ def positions: () -> Enumerator[[Integer, Integer], void]
48
+ | () { ([Integer, Integer]) -> void } -> void
49
+
50
+ # Conversions
51
+ def as_position: () -> Position
52
+ def as_size: () -> Size
53
+
54
+ # Centering
55
+ def centered_horizontally: (Constraint) -> Rect
56
+ def centered_vertically: (Constraint) -> Rect
57
+ def centered: (Constraint, Constraint) -> Rect
58
+
59
+ # Ruby-idiomatic aliases
60
+ alias position as_position
61
+ alias size as_size
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ module RatatuiRuby
9
+ module Layout
10
+ class Size < Data
11
+ attr_reader width: Integer
12
+ attr_reader height: Integer
13
+
14
+ def self.new: (?width: _ToInt, ?height: _ToInt) -> instance
15
+ def initialize: (?width: _ToInt, ?height: _ToInt) -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ class ListState
12
+ def self.new: (?Integer? selected) -> ListState
13
+ def select: (Integer? index) -> nil
14
+ def selected: () -> Integer?
15
+ def offset: () -> Integer
16
+ def scroll_down_by: (Integer n) -> nil
17
+ def scroll_up_by: (Integer n) -> nil
18
+ def select_next: () -> nil
19
+ def select_previous: () -> nil
20
+ def select_first: () -> nil
21
+ def select_last: () -> nil
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ module OutputGuard
12
+ # Null IO object that discards all output
13
+ class NullIO
14
+ def method_missing: (Symbol name, *untyped args) ?{ (*untyped) -> untyped } -> NullIO
15
+ def respond_to_missing?: (Symbol name, ?bool include_private) -> true
16
+ end
17
+
18
+ def is_headless?: () -> bool
19
+ def headless!: () -> void
20
+ def guard_io: [T] () { () -> T } -> T
21
+ def terminal_active?: () -> bool
22
+ end
23
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ # Common type aliases for widget parameters
12
+ type alignment = :left | :center | :right
13
+ type border_side = :top | :bottom | :left | :right | :all
14
+ type border_type = :plain | :rounded | :double | :thick | :hidden | :quadrant_inside | :quadrant_outside
15
+ type title_position = :top | :bottom
16
+ type style_input = Style::Style | { ?fg: (Symbol | String | Integer), ?bg: (Symbol | String | Integer), ?modifiers: Array[Symbol] }
17
+ type title_entry = String | { content: (String | Text::Line), ?alignment: alignment, ?position: title_position, ?style: style_input }
18
+ type border_set_hash = { ?top_left: String, ?top_right: String, ?bottom_left: String, ?bottom_right: String, ?vertical_left: String, ?vertical_right: String, ?horizontal_top: String, ?horizontal_bottom: String }
19
+ type date_key = Date | [Integer, Integer, Integer]
20
+
21
+ type widget = Widgets::Paragraph | Layout::Layout | Widgets::List | Widgets::Gauge | Widgets::Table | Widgets::Tabs | Widgets::BarChart | Widgets::Block | Widgets::Sparkline
22
+
23
+ interface _ToS
24
+ def to_s: () -> String
25
+ end
26
+
27
+ # Error classes
28
+ class Error < StandardError
29
+ class Terminal < Error
30
+ end
31
+ class Safety < Error
32
+ end
33
+ class Invariant < Error
34
+ end
35
+ class Internal < Error
36
+ end
37
+ end
38
+
39
+ # NullIO for headless mode
40
+
41
+
42
+ # Core module methods
43
+ def self.init_terminal: (?focus_events: bool, ?bracketed_paste: bool, ?viewport: (Terminal::Viewport | :fullscreen | :inline)?, ?height: Integer?) -> void
44
+ def self.init_test_terminal: (Integer width, Integer height, ?String viewport_type, ?Integer? viewport_height) -> void
45
+ def self.restore_terminal: () -> void
46
+ def self.terminal_active?: () -> bool
47
+ def self.run: (?focus_events: bool, ?bracketed_paste: bool, ?viewport: (Terminal::Viewport | :fullscreen | :inline)?, ?height: Integer?) { (TUI) -> void } -> void
48
+ def self.draw: (?widget? tree) -> void
49
+ | () { (Frame) -> void } -> void
50
+ # untyped: FFI boundary - Rust returns dynamic event hash with varying keys per event type
51
+ def self._poll_event: (Float?) -> Hash[Symbol, untyped]?
52
+ def self.poll_event: (?timeout: Float?) -> Event
53
+ def self.inject_test_event: ("key", { code: String, ?modifiers: Array[String], ?kind: Event::key_kind }) -> void
54
+ | ("mouse", { kind: String, x: Integer, y: Integer, ?button: String, ?modifiers: Array[String] }) -> void
55
+ | ("resize", { width: Integer, height: Integer }) -> void
56
+ | ("paste", { content: String }) -> void
57
+ | ("focus_gained", { }) -> void
58
+ | ("focus_lost", { }) -> void
59
+ def self.get_cell_at: (Integer x, Integer y) -> Buffer::Cell
60
+ def self.experimental_warnings: () -> bool
61
+ def self.experimental_warnings=: (bool) -> bool
62
+ def self.warn_experimental_feature: (String feature_name) -> void
63
+
64
+ # Warning queue (private)
65
+ def self.queue_warning: (String message) -> void
66
+ def self.flush_warnings: () -> void
67
+
68
+ # Panic info (private, for deferred backtrace output)
69
+ def self._get_last_panic: () -> String?
70
+ def self.flush_panic_info: () -> void
71
+
72
+ # Draw internal
73
+ def self._draw: (widget) -> void
74
+ | () { (Frame) -> void } -> void
75
+
76
+ # Cell accessor internal (returns Hash with String keys from Rust FFI)
77
+ def self._get_cell_at: (Integer x, Integer y) -> Hash[String, untyped]
78
+
79
+ # Signal handling
80
+ def self.trap: (String | Symbol signal) { () -> void } -> void
81
+
82
+ # Paragraph helpers
83
+ def self._paragraph_line_count: (Widgets::Paragraph p, Integer width) -> Integer
84
+ def self._paragraph_line_width: (Widgets::Paragraph p) -> Integer
85
+
86
+ # Tabs/Text helpers
87
+ def self._tabs_width: (Widgets::Tabs t) -> Integer
88
+ def self._text_width: (String text) -> Integer
89
+
90
+ # Debug mode convenience method
91
+ def self.debug_mode!: () -> void
92
+
93
+ # Headless mode
94
+ def self.headless!: () -> void
95
+ def self.headless?: () -> bool
96
+
97
+ def self._get_terminal_area: () -> Hash[String, Integer]
98
+ def self.get_viewport_area: () -> RatatuiRuby::Layout::Rect
99
+ def self.terminal_area: () -> RatatuiRuby::Layout::Rect
100
+ def self.viewport_area: () -> RatatuiRuby::Layout::Rect
101
+ def self.get_terminal_size: () -> RatatuiRuby::Layout::Rect
102
+ def self._get_terminal_size: () -> Hash[String, Integer]
103
+ def self._get_viewport_type: () -> String
104
+ def self.insert_before: (Integer height, ?widget? widget) ?{ () -> widget } -> void
105
+ def self._frame_count: () -> Integer
106
+ def self.frame_count: () -> Integer
107
+
108
+ # Color conversion (internal, Rust FFI)
109
+ def self._color_from_u32: (Integer) -> String
110
+ def self._color_from_hsl: (Float, Float, Float) -> String
111
+ def self._color_from_hsluv: (Float, Float, Float) -> String
112
+ end
113
+
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ # NOTE: RatatuiRuby::Rect is not defined at runtime in the main gem.
11
+ # This file exists only to satisfy the build system.
12
+ # The actual Rect class is Layout::Rect in sig/ratatui_ruby/schema/rect.rbs.
13
+ #
14
+ # The schema/ folder structure is pending migration per:
15
+ # doc/contributors/v1.0.0_blockers.md
16
+
17
+ # Empty placeholder - actual type is RatatuiRuby::Layout::Rect
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ class ScrollbarState
12
+ def self.new: (Integer content_length) -> ScrollbarState
13
+ def position: () -> Integer
14
+ def position=: (Integer value) -> Integer
15
+ def content_length: () -> Integer
16
+ def content_length=: (Integer value) -> Integer
17
+ def viewport_content_length: () -> Integer
18
+ def viewport_content_length=: (Integer value) -> Integer
19
+ def first: () -> nil
20
+ def last: () -> nil
21
+ def next: () -> nil
22
+ def prev: () -> nil
23
+ end
24
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ # !!! DO NOT EDIT THIS FILE BY HAND !!!
11
+ # This file is automatically generated by `rake autodoc:rbs:session`.
12
+ # Any changes will be overwritten.
13
+
14
+ module RatatuiRuby
15
+ class Session
16
+ def self.new: () -> Session
17
+ | () { (Session) -> void } -> void
18
+
19
+ def _paragraph_line_count: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
20
+ def _paragraph_line_width: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
21
+ def _tabs_width: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
22
+ def _text_width: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
23
+ def clear_events: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
24
+ def draw: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
25
+ def experimental_warnings: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
26
+ def experimental_warnings=: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
27
+ def get_buffer_content: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
28
+ def get_cell_at: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
29
+ def get_cursor_position: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
30
+ def init_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
31
+ def init_test_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
32
+ def inject_test_event: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
33
+ def poll_event: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
34
+ def resize_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
35
+ def restore_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
36
+ def run: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
37
+ def warn_experimental_feature: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
38
+ def draw_cell: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
39
+ def draw_string: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
40
+ def draw_cell_cmd: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
41
+ def draw_string_cmd: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
42
+ def error: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
43
+ def error_safety: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
44
+ def error_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
45
+ def event: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
46
+ def event_focus_gained: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
47
+ def event_focus_lost: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
48
+ def event_key: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
49
+ def event_mouse: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
50
+ def event_none: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
51
+ def event_paste: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
52
+ def event_resize: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
53
+ def frame: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
54
+ def layout_constraint: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
55
+ def layout_layout: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
56
+ def layout_rect: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
57
+ def list_state: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
58
+ def list_state_new: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
59
+ def scrollbar_state: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
60
+ def scrollbar_state_new: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
61
+ def style_style: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
62
+ def table_state: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
63
+ def table_state_new: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
64
+ def text_width: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
65
+ def text_line: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
66
+ def text_span: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
67
+ def widgets_axis: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
68
+ def widgets_bar_chart: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
69
+ def widgets_block: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
70
+ def widgets_calendar: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
71
+ def widgets_canvas: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
72
+ def widgets_cell: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
73
+ def widgets_center: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
74
+ def widgets_chart: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
75
+ def widgets_clear: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
76
+ def widgets_cursor: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
77
+ def widgets_dataset: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
78
+ def widgets_gauge: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
79
+ def widgets_line_chart: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
80
+ def widgets_line_gauge: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
81
+ def widgets_list: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
82
+ def widgets_list_item: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
83
+ def widgets_overlay: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
84
+ def widgets_paragraph: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
85
+ def widgets_ratatui_logo: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
86
+ def widgets_ratatui_mascot: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
87
+ def widgets_row: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
88
+ def widgets_scrollbar: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
89
+ def widgets_sparkline: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
90
+ def widgets_table: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
91
+ def widgets_tabs: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
92
+ end
93
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ module RatatuiRuby
9
+ module Style
10
+ module Color
11
+ def self.from_u32: (Integer) -> String
12
+ def self.from_hsl: (_ToF, _ToF, _ToF) -> String
13
+ def self.from_hsluv: (_ToF, _ToF, _ToF) -> String
14
+
15
+ # Ruby-idiomatic aliases
16
+ alias self.hex self.from_u32
17
+ alias self.hsl self.from_hsl
18
+ alias self.hsluv self.from_hsluv
19
+ end
20
+ end
21
+ end
22
+
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
+ #++
7
+
8
+ # SPDX-License-Identifier: AGPL-3.0-or-later
9
+
10
+ module RatatuiRuby
11
+ # Style module at RatatuiRuby::Style
12
+ module Style
13
+ # Style class for RatatuiRuby::Style::Style
14
+ class Style < Data
15
+ type color = String | Symbol | Integer
16
+
17
+ attr_reader fg: color?
18
+ attr_reader bg: color?
19
+ attr_reader underline_color: color?
20
+ attr_reader modifiers: Array[Symbol]
21
+ attr_reader remove_modifiers: Array[Symbol]
22
+
23
+ def self.new: (?fg: color?, ?bg: color?, ?underline_color: color?, ?modifiers: Array[Symbol], ?remove_modifiers: Array[Symbol]) -> Style
24
+ def initialize: (?fg: color?, ?bg: color?, ?underline_color: color?, ?modifiers: Array[Symbol], ?remove_modifiers: Array[Symbol]) -> void
25
+ def self.default: () -> Style
26
+ def self.with: (?fg: color?, ?bg: color?, ?underline_color: color?, ?modifiers: Array[Symbol], ?remove_modifiers: Array[Symbol]) -> Style
27
+ end
28
+ end
29
+ end