ratatui_ruby 0.3.1 → 0.5.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.
- checksums.yaml +4 -4
- data/.builds/ruby-3.2.yml +14 -12
- data/.builds/ruby-3.3.yml +14 -12
- data/.builds/ruby-3.4.yml +14 -12
- data/.builds/ruby-4.0.0.yml +14 -12
- data/AGENTS.md +89 -132
- data/CHANGELOG.md +223 -1
- data/README.md +23 -16
- data/REUSE.toml +20 -0
- data/doc/application_architecture.md +176 -0
- data/doc/application_testing.md +17 -10
- data/doc/contributors/design/ruby_frontend.md +11 -7
- data/doc/contributors/developing_examples.md +261 -0
- data/doc/contributors/documentation_style.md +104 -0
- data/doc/contributors/dwim_dx.md +366 -0
- data/doc/contributors/index.md +2 -0
- data/doc/custom.css +14 -0
- data/doc/event_handling.md +125 -0
- data/doc/images/app_all_events.png +0 -0
- data/doc/images/app_analytics.png +0 -0
- data/doc/images/app_color_picker.png +0 -0
- data/doc/images/app_custom_widget.png +0 -0
- data/doc/images/app_login_form.png +0 -0
- data/doc/images/app_map_demo.png +0 -0
- data/doc/images/app_mouse_events.png +0 -0
- data/doc/images/app_table_select.png +0 -0
- data/doc/images/verify_quickstart_dsl.png +0 -0
- data/doc/images/verify_quickstart_layout.png +0 -0
- data/doc/images/verify_quickstart_lifecycle.png +0 -0
- data/doc/images/verify_readme_usage.png +0 -0
- data/doc/images/widget_barchart_demo.png +0 -0
- data/doc/images/widget_block_padding.png +0 -0
- data/doc/images/widget_block_titles.png +0 -0
- data/doc/images/widget_box_demo.png +0 -0
- data/doc/images/widget_calendar_demo.png +0 -0
- data/doc/images/widget_cell_demo.png +0 -0
- data/doc/images/widget_chart_demo.png +0 -0
- data/doc/images/widget_gauge_demo.png +0 -0
- data/doc/images/widget_layout_split.png +0 -0
- data/doc/images/widget_line_gauge_demo.png +0 -0
- data/doc/images/widget_list_demo.png +0 -0
- data/doc/images/widget_list_styles.png +0 -0
- data/doc/images/widget_popup_demo.png +0 -0
- data/doc/images/widget_ratatui_logo_demo.png +0 -0
- data/doc/images/widget_ratatui_mascot_demo.png +0 -0
- data/doc/images/widget_rect.png +0 -0
- data/doc/images/widget_render.png +0 -0
- data/doc/images/widget_rich_text.png +0 -0
- data/doc/images/widget_scroll_text.png +0 -0
- data/doc/images/widget_scrollbar_demo.png +0 -0
- data/doc/images/widget_sparkline_demo.png +0 -0
- data/doc/images/widget_style_colors.png +0 -0
- data/doc/images/widget_table_flex.png +0 -0
- data/doc/images/widget_tabs_demo.png +0 -0
- data/doc/index.md +1 -0
- data/doc/interactive_design.md +116 -0
- data/doc/quickstart.md +186 -84
- data/examples/app_all_events/README.md +81 -0
- data/examples/app_all_events/app.rb +93 -0
- data/examples/app_all_events/model/event_color_cycle.rb +41 -0
- data/examples/app_all_events/model/event_entry.rb +75 -0
- data/examples/app_all_events/model/events.rb +180 -0
- data/examples/app_all_events/model/highlight.rb +57 -0
- data/examples/app_all_events/model/timestamp.rb +54 -0
- data/examples/app_all_events/test/snapshots/after_focus_lost.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_focus_regained.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_horizontal_resize.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_key_a.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_key_ctrl_x.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_mouse_click.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_mouse_drag.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_multiple_events.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_paste.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_resize.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_right_click.txt +24 -0
- data/examples/app_all_events/test/snapshots/after_vertical_resize.txt +24 -0
- data/examples/app_all_events/test/snapshots/initial_state.txt +24 -0
- data/examples/app_all_events/view/app_view.rb +78 -0
- data/examples/app_all_events/view/controls_view.rb +50 -0
- data/examples/app_all_events/view/counts_view.rb +55 -0
- data/examples/app_all_events/view/live_view.rb +69 -0
- data/examples/app_all_events/view/log_view.rb +60 -0
- data/{lib/ratatui_ruby/output.rb → examples/app_all_events/view.rb} +1 -1
- data/examples/app_all_events/view_state.rb +42 -0
- data/examples/app_color_picker/README.md +94 -0
- data/examples/app_color_picker/app.rb +112 -0
- data/examples/app_color_picker/clipboard.rb +84 -0
- data/examples/app_color_picker/color.rb +191 -0
- data/examples/app_color_picker/copy_dialog.rb +170 -0
- data/examples/app_color_picker/harmony.rb +56 -0
- data/examples/app_color_picker/input.rb +142 -0
- data/examples/app_color_picker/palette.rb +80 -0
- data/examples/app_color_picker/scene.rb +201 -0
- data/examples/app_login_form/app.rb +108 -0
- data/examples/app_map_demo/app.rb +93 -0
- data/examples/app_table_select/app.rb +201 -0
- data/examples/verify_quickstart_dsl/app.rb +45 -0
- data/examples/verify_quickstart_layout/app.rb +69 -0
- data/examples/verify_quickstart_lifecycle/app.rb +48 -0
- data/examples/verify_readme_usage/app.rb +34 -0
- data/examples/widget_barchart_demo/app.rb +238 -0
- data/examples/widget_block_padding/app.rb +67 -0
- data/examples/widget_block_titles/app.rb +69 -0
- data/examples/widget_box_demo/app.rb +250 -0
- data/examples/widget_calendar_demo/app.rb +109 -0
- data/examples/widget_cell_demo/app.rb +104 -0
- data/examples/widget_chart_demo/app.rb +213 -0
- data/examples/widget_gauge_demo/app.rb +212 -0
- data/examples/widget_layout_split/app.rb +246 -0
- data/examples/widget_line_gauge_demo/app.rb +217 -0
- data/examples/widget_list_demo/app.rb +382 -0
- data/examples/widget_list_styles/app.rb +141 -0
- data/examples/widget_popup_demo/app.rb +104 -0
- data/examples/widget_ratatui_logo_demo/app.rb +103 -0
- data/examples/widget_ratatui_mascot_demo/app.rb +93 -0
- data/examples/widget_rect/app.rb +205 -0
- data/examples/widget_render/app.rb +184 -0
- data/examples/widget_rich_text/app.rb +137 -0
- data/examples/widget_scroll_text/app.rb +108 -0
- data/examples/widget_scrollbar_demo/app.rb +153 -0
- data/examples/widget_sparkline_demo/app.rb +274 -0
- data/examples/widget_style_colors/app.rb +102 -0
- data/examples/widget_table_flex/app.rb +95 -0
- data/examples/widget_tabs_demo/app.rb +167 -0
- data/ext/ratatui_ruby/Cargo.lock +889 -115
- data/ext/ratatui_ruby/Cargo.toml +4 -3
- data/ext/ratatui_ruby/clippy.toml +7 -0
- data/ext/ratatui_ruby/extconf.rb +7 -0
- data/ext/ratatui_ruby/src/events.rs +293 -219
- data/ext/ratatui_ruby/src/frame.rs +115 -0
- data/ext/ratatui_ruby/src/lib.rs +105 -24
- data/ext/ratatui_ruby/src/rendering.rs +94 -10
- data/ext/ratatui_ruby/src/style.rs +357 -93
- data/ext/ratatui_ruby/src/terminal.rs +121 -31
- data/ext/ratatui_ruby/src/text.rs +178 -0
- data/ext/ratatui_ruby/src/widgets/barchart.rs +99 -24
- data/ext/ratatui_ruby/src/widgets/block.rs +32 -3
- data/ext/ratatui_ruby/src/widgets/calendar.rs +45 -44
- data/ext/ratatui_ruby/src/widgets/canvas.rs +44 -9
- data/ext/ratatui_ruby/src/widgets/chart.rs +79 -27
- data/ext/ratatui_ruby/src/widgets/clear.rs +3 -1
- data/ext/ratatui_ruby/src/widgets/gauge.rs +11 -4
- data/ext/ratatui_ruby/src/widgets/layout.rs +223 -15
- data/ext/ratatui_ruby/src/widgets/line_gauge.rs +92 -0
- data/ext/ratatui_ruby/src/widgets/list.rs +114 -11
- data/ext/ratatui_ruby/src/widgets/mod.rs +3 -0
- data/ext/ratatui_ruby/src/widgets/overlay.rs +4 -2
- data/ext/ratatui_ruby/src/widgets/paragraph.rs +35 -13
- data/ext/ratatui_ruby/src/widgets/ratatui_logo.rs +40 -0
- data/ext/ratatui_ruby/src/widgets/ratatui_mascot.rs +51 -0
- data/ext/ratatui_ruby/src/widgets/scrollbar.rs +61 -7
- data/ext/ratatui_ruby/src/widgets/sparkline.rs +73 -6
- data/ext/ratatui_ruby/src/widgets/table.rs +177 -64
- data/ext/ratatui_ruby/src/widgets/tabs.rs +105 -5
- data/lib/ratatui_ruby/cell.rb +166 -0
- data/lib/ratatui_ruby/event/focus_gained.rb +49 -0
- data/lib/ratatui_ruby/event/focus_lost.rb +50 -0
- data/lib/ratatui_ruby/event/key.rb +211 -0
- data/lib/ratatui_ruby/event/mouse.rb +124 -0
- data/lib/ratatui_ruby/event/none.rb +43 -0
- data/lib/ratatui_ruby/event/paste.rb +71 -0
- data/lib/ratatui_ruby/event/resize.rb +80 -0
- data/lib/ratatui_ruby/event.rb +131 -0
- data/lib/ratatui_ruby/frame.rb +87 -0
- data/lib/ratatui_ruby/schema/bar_chart/bar.rb +45 -0
- data/lib/ratatui_ruby/schema/bar_chart/bar_group.rb +23 -0
- data/lib/ratatui_ruby/schema/bar_chart.rb +226 -17
- data/lib/ratatui_ruby/schema/block.rb +178 -11
- data/lib/ratatui_ruby/schema/calendar.rb +70 -14
- data/lib/ratatui_ruby/schema/canvas.rb +213 -46
- data/lib/ratatui_ruby/schema/center.rb +46 -8
- data/lib/ratatui_ruby/schema/chart.rb +134 -32
- data/lib/ratatui_ruby/schema/clear.rb +22 -53
- data/lib/ratatui_ruby/schema/constraint.rb +72 -12
- data/lib/ratatui_ruby/schema/cursor.rb +23 -5
- data/lib/ratatui_ruby/schema/draw.rb +53 -0
- data/lib/ratatui_ruby/schema/gauge.rb +56 -12
- data/lib/ratatui_ruby/schema/layout.rb +91 -9
- data/lib/ratatui_ruby/schema/line_gauge.rb +78 -0
- data/lib/ratatui_ruby/schema/list.rb +92 -16
- data/lib/ratatui_ruby/schema/overlay.rb +29 -3
- data/lib/ratatui_ruby/schema/paragraph.rb +82 -25
- data/lib/ratatui_ruby/schema/ratatui_logo.rb +29 -0
- data/lib/ratatui_ruby/schema/ratatui_mascot.rb +34 -0
- data/lib/ratatui_ruby/schema/rect.rb +59 -10
- data/lib/ratatui_ruby/schema/scrollbar.rb +127 -19
- data/lib/ratatui_ruby/schema/shape/label.rb +66 -0
- data/lib/ratatui_ruby/schema/sparkline.rb +120 -12
- data/lib/ratatui_ruby/schema/style.rb +39 -11
- data/lib/ratatui_ruby/schema/table.rb +109 -18
- data/lib/ratatui_ruby/schema/tabs.rb +71 -10
- data/lib/ratatui_ruby/schema/text.rb +90 -0
- data/lib/ratatui_ruby/session/autodoc.rb +417 -0
- data/lib/ratatui_ruby/session.rb +163 -0
- data/lib/ratatui_ruby/test_helper.rb +322 -13
- data/lib/ratatui_ruby/version.rb +1 -1
- data/lib/ratatui_ruby.rb +184 -38
- data/sig/examples/app_all_events/app.rbs +11 -0
- data/sig/examples/app_all_events/model/event_entry.rbs +16 -0
- data/sig/examples/app_all_events/model/events.rbs +15 -0
- data/sig/examples/app_all_events/model/timestamp.rbs +11 -0
- data/sig/examples/app_all_events/view/app_view.rbs +8 -0
- data/sig/examples/app_all_events/view/controls_view.rbs +6 -0
- data/sig/examples/app_all_events/view/counts_view.rbs +6 -0
- data/sig/examples/app_all_events/view/live_view.rbs +6 -0
- data/sig/examples/app_all_events/view/log_view.rbs +6 -0
- data/sig/examples/app_all_events/view.rbs +8 -0
- data/sig/examples/app_all_events/view_state.rbs +15 -0
- data/sig/examples/app_color_picker/app.rbs +12 -0
- data/sig/examples/app_login_form/app.rbs +11 -0
- data/sig/examples/app_map_demo/app.rbs +11 -0
- data/sig/examples/app_table_select/app.rbs +11 -0
- data/sig/examples/verify_quickstart_dsl/app.rbs +11 -0
- data/sig/examples/verify_quickstart_lifecycle/app.rbs +11 -0
- data/sig/examples/verify_readme_usage/app.rbs +11 -0
- data/sig/examples/widget_block_padding/app.rbs +11 -0
- data/sig/examples/widget_block_titles/app.rbs +11 -0
- data/sig/examples/widget_box_demo/app.rbs +11 -0
- data/sig/examples/widget_calendar_demo/app.rbs +11 -0
- data/sig/examples/widget_cell_demo/app.rbs +11 -0
- data/sig/examples/widget_chart_demo/app.rbs +11 -0
- data/sig/examples/widget_gauge_demo/app.rbs +11 -0
- data/sig/examples/widget_layout_split/app.rbs +10 -0
- data/sig/examples/widget_line_gauge_demo/app.rbs +11 -0
- data/sig/examples/widget_list_demo/app.rbs +12 -0
- data/sig/examples/widget_list_styles/app.rbs +11 -0
- data/sig/examples/widget_popup_demo/app.rbs +11 -0
- data/sig/examples/widget_ratatui_logo_demo/app.rbs +11 -0
- data/sig/examples/widget_ratatui_mascot_demo/app.rbs +11 -0
- data/sig/examples/widget_rect/app.rbs +12 -0
- data/sig/examples/widget_render/app.rbs +10 -0
- data/sig/examples/widget_rich_text/app.rbs +11 -0
- data/sig/examples/widget_scroll_text/app.rbs +11 -0
- data/sig/examples/widget_scrollbar_demo/app.rbs +11 -0
- data/sig/examples/widget_sparkline_demo/app.rbs +10 -0
- data/sig/examples/widget_style_colors/app.rbs +14 -0
- data/sig/examples/widget_table_flex/app.rbs +11 -0
- data/sig/ratatui_ruby/event.rbs +69 -0
- data/sig/ratatui_ruby/frame.rbs +9 -0
- data/sig/ratatui_ruby/ratatui_ruby.rbs +5 -3
- data/sig/ratatui_ruby/schema/bar_chart/bar.rbs +16 -0
- data/sig/ratatui_ruby/schema/bar_chart/bar_group.rbs +13 -0
- data/sig/ratatui_ruby/schema/bar_chart.rbs +20 -2
- data/sig/ratatui_ruby/schema/block.rbs +5 -4
- data/sig/ratatui_ruby/schema/calendar.rbs +6 -2
- data/sig/ratatui_ruby/schema/canvas.rbs +52 -39
- data/sig/ratatui_ruby/schema/center.rbs +3 -3
- data/sig/ratatui_ruby/schema/chart.rbs +8 -5
- data/sig/ratatui_ruby/schema/constraint.rbs +8 -5
- data/sig/ratatui_ruby/schema/cursor.rbs +1 -1
- data/sig/ratatui_ruby/schema/draw.rbs +27 -0
- data/sig/ratatui_ruby/schema/gauge.rbs +4 -2
- data/sig/ratatui_ruby/schema/layout.rbs +11 -1
- data/sig/ratatui_ruby/schema/line_gauge.rbs +16 -0
- data/sig/ratatui_ruby/schema/list.rbs +5 -1
- data/sig/ratatui_ruby/schema/paragraph.rbs +4 -1
- data/sig/ratatui_ruby/schema/ratatui_logo.rbs +8 -0
- data/sig/ratatui_ruby/{buffer.rbs → schema/ratatui_mascot.rbs} +4 -3
- data/sig/ratatui_ruby/schema/rect.rbs +2 -1
- data/sig/ratatui_ruby/schema/scrollbar.rbs +18 -2
- data/sig/ratatui_ruby/schema/sparkline.rbs +6 -2
- data/sig/ratatui_ruby/schema/table.rbs +8 -1
- data/sig/ratatui_ruby/schema/tabs.rbs +5 -1
- data/sig/ratatui_ruby/schema/text.rbs +22 -0
- data/sig/ratatui_ruby/session.rbs +94 -0
- data/tasks/autodoc/inventory.rb +61 -0
- data/tasks/autodoc/member.rb +56 -0
- data/tasks/autodoc/name.rb +19 -0
- data/tasks/autodoc/notice.rb +26 -0
- data/tasks/autodoc/rbs.rb +38 -0
- data/tasks/autodoc/rdoc.rb +45 -0
- data/tasks/autodoc.rake +47 -0
- data/tasks/bump/history.rb +2 -2
- data/tasks/doc.rake +600 -6
- data/tasks/example_viewer.html.erb +172 -0
- data/tasks/lint.rake +8 -4
- data/tasks/resources/build.yml.erb +13 -11
- data/tasks/resources/index.html.erb +6 -0
- data/tasks/sourcehut.rake +4 -4
- data/tasks/terminal_preview/app_screenshot.rb +33 -0
- data/tasks/terminal_preview/crash_report.rb +52 -0
- data/tasks/terminal_preview/example_app.rb +25 -0
- data/tasks/terminal_preview/launcher_script.rb +46 -0
- data/tasks/terminal_preview/preview_collection.rb +58 -0
- data/tasks/terminal_preview/preview_timing.rb +22 -0
- data/tasks/terminal_preview/safety_confirmation.rb +56 -0
- data/tasks/terminal_preview/saved_screenshot.rb +53 -0
- data/tasks/terminal_preview/system_appearance.rb +11 -0
- data/tasks/terminal_preview/terminal_window.rb +136 -0
- data/tasks/terminal_preview/window_id.rb +14 -0
- data/tasks/terminal_preview.rake +28 -0
- data/tasks/test.rake +2 -2
- data/tasks/website/index_page.rb +3 -3
- data/tasks/website/version.rb +10 -10
- data/tasks/website/version_menu.rb +10 -12
- data/tasks/website/versioned_documentation.rb +49 -17
- data/tasks/website/website.rb +6 -8
- data/tasks/website.rake +4 -4
- metadata +206 -54
- data/LICENSES/BSD-2-Clause.txt +0 -9
- data/doc/images/examples-analytics.rb.png +0 -0
- data/doc/images/examples-box_demo.rb.png +0 -0
- data/doc/images/examples-calendar_demo.rb.png +0 -0
- data/doc/images/examples-chart_demo.rb.png +0 -0
- data/doc/images/examples-custom_widget.rb.png +0 -0
- data/doc/images/examples-dashboard.rb.png +0 -0
- data/doc/images/examples-list_styles.rb.png +0 -0
- data/doc/images/examples-login_form.rb.png +0 -0
- data/doc/images/examples-map_demo.rb.png +0 -0
- data/doc/images/examples-mouse_events.rb.png +0 -0
- data/doc/images/examples-popup_demo.rb.gif +0 -0
- data/doc/images/examples-quickstart_lifecycle.rb.png +0 -0
- data/doc/images/examples-scroll_text.rb.png +0 -0
- data/doc/images/examples-scrollbar_demo.rb.png +0 -0
- data/doc/images/examples-stock_ticker.rb.png +0 -0
- data/doc/images/examples-system_monitor.rb.png +0 -0
- data/doc/images/examples-table_select.rb.png +0 -0
- data/examples/analytics.rb +0 -88
- data/examples/box_demo.rb +0 -71
- data/examples/calendar_demo.rb +0 -55
- data/examples/chart_demo.rb +0 -84
- data/examples/custom_widget.rb +0 -43
- data/examples/dashboard.rb +0 -72
- data/examples/list_styles.rb +0 -66
- data/examples/login_form.rb +0 -115
- data/examples/map_demo.rb +0 -58
- data/examples/mouse_events.rb +0 -95
- data/examples/popup_demo.rb +0 -105
- data/examples/quickstart_dsl.rb +0 -30
- data/examples/quickstart_lifecycle.rb +0 -40
- data/examples/readme_usage.rb +0 -21
- data/examples/scroll_text.rb +0 -74
- data/examples/scrollbar_demo.rb +0 -75
- data/examples/stock_ticker.rb +0 -93
- data/examples/system_monitor.rb +0 -94
- data/examples/table_select.rb +0 -70
- data/examples/test_analytics.rb +0 -65
- data/examples/test_box_demo.rb +0 -38
- data/examples/test_calendar_demo.rb +0 -66
- data/examples/test_dashboard.rb +0 -38
- data/examples/test_list_styles.rb +0 -61
- data/examples/test_login_form.rb +0 -63
- data/examples/test_map_demo.rb +0 -100
- data/examples/test_popup_demo.rb +0 -62
- data/examples/test_scroll_text.rb +0 -130
- data/examples/test_stock_ticker.rb +0 -39
- data/examples/test_system_monitor.rb +0 -40
- data/examples/test_table_select.rb +0 -37
- data/ext/ratatui_ruby/src/buffer.rs +0 -54
- data/lib/ratatui_ruby/dsl.rb +0 -64
|
@@ -5,9 +5,13 @@ module RatatuiRuby
|
|
|
5
5
|
class Calendar < Data
|
|
6
6
|
attr_reader year: Integer
|
|
7
7
|
attr_reader month: Integer
|
|
8
|
-
attr_reader
|
|
8
|
+
attr_reader events: Hash[untyped, Style]
|
|
9
|
+
attr_reader default_style: Style?
|
|
9
10
|
attr_reader header_style: Style?
|
|
10
11
|
attr_reader block: Block?
|
|
11
|
-
|
|
12
|
+
attr_reader show_weekdays_header: bool
|
|
13
|
+
attr_reader show_surrounding: Style?
|
|
14
|
+
attr_reader show_month_header: bool
|
|
15
|
+
def self.new: (year: Numeric, month: Numeric, ?events: Hash[untyped, Style], ?default_style: Style?, ?header_style: Style?, ?block: Block?, ?show_weekdays_header: bool, ?show_surrounding: Style?, ?show_month_header: bool) -> Calendar
|
|
12
16
|
end
|
|
13
17
|
end
|
|
@@ -2,61 +2,74 @@
|
|
|
2
2
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
3
|
|
|
4
4
|
module RatatuiRuby
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
module Shape
|
|
6
|
+
class Point < Data
|
|
7
|
+
attr_reader x: Float
|
|
8
|
+
attr_reader y: Float
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def self.new: (x: Numeric, y: Numeric) -> Point
|
|
11
|
+
| (Numeric, Numeric) -> Point
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
class Line < Data
|
|
15
|
+
attr_reader x1: Float
|
|
16
|
+
attr_reader y1: Float
|
|
17
|
+
attr_reader x2: Float
|
|
18
|
+
attr_reader y2: Float
|
|
19
|
+
attr_reader color: String | Symbol
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
def self.new: (x1: Numeric, y1: Numeric, x2: Numeric, y2: Numeric, color: String | Symbol) -> Line
|
|
22
|
+
| (Numeric, Numeric, Numeric, Numeric, String | Symbol) -> Line
|
|
23
|
+
end
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
class Rectangle < Data
|
|
26
|
+
attr_reader x: Float
|
|
27
|
+
attr_reader y: Float
|
|
28
|
+
attr_reader width: Float
|
|
29
|
+
attr_reader height: Float
|
|
30
|
+
attr_reader color: String | Symbol
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
def self.new: (x: Numeric, y: Numeric, width: Numeric, height: Numeric, color: String | Symbol) -> Rectangle
|
|
33
|
+
| (Numeric, Numeric, Numeric, Numeric, String | Symbol) -> Rectangle
|
|
34
|
+
end
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
class Circle < Data
|
|
37
|
+
attr_reader x: Float
|
|
38
|
+
attr_reader y: Float
|
|
39
|
+
attr_reader radius: Float
|
|
40
|
+
attr_reader color: String | Symbol
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
def self.new: (x: Numeric, y: Numeric, radius: Numeric, color: String | Symbol) -> Circle
|
|
43
|
+
| (Numeric, Numeric, Numeric, String | Symbol) -> Circle
|
|
44
|
+
end
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
class Map < Data
|
|
47
|
+
attr_reader color: String | Symbol
|
|
48
|
+
attr_reader resolution: Symbol
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
def self.new: (color: String | Symbol, resolution: Symbol) -> Map
|
|
51
|
+
| (String | Symbol, Symbol) -> Map
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class Label < Data
|
|
55
|
+
attr_reader x: Float
|
|
56
|
+
attr_reader y: Float
|
|
57
|
+
attr_reader text: String | Text::Line
|
|
58
|
+
attr_reader style: Style?
|
|
59
|
+
|
|
60
|
+
def self.new: (x: Numeric, y: Numeric, text: String | Text::Line, ?style: Style?) -> Label
|
|
61
|
+
end
|
|
51
62
|
end
|
|
52
63
|
|
|
53
64
|
class Canvas < Data
|
|
54
|
-
attr_reader shapes: Array[Line | Rectangle | Circle | Map]
|
|
65
|
+
attr_reader shapes: Array[Shape::Line | Shape::Rectangle | Shape::Circle | Shape::Map | Shape::Label]
|
|
55
66
|
attr_reader x_bounds: Array[Float]
|
|
56
67
|
attr_reader y_bounds: Array[Float]
|
|
57
68
|
attr_reader marker: Symbol
|
|
58
69
|
attr_reader block: Block?
|
|
59
70
|
|
|
60
|
-
|
|
71
|
+
attr_reader background_color: String | Symbol | nil
|
|
72
|
+
|
|
73
|
+
def self.new: (?shapes: Array[Shape::Line | Shape::Rectangle | Shape::Circle | Shape::Map | Shape::Label], ?x_bounds: Array[Numeric], ?y_bounds: Array[Numeric], ?marker: Symbol, ?block: Block?, ?background_color: String | Symbol | nil) -> Canvas
|
|
61
74
|
end
|
|
62
75
|
end
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
module RatatuiRuby
|
|
5
5
|
class Center < Data
|
|
6
6
|
attr_reader child: widget
|
|
7
|
-
attr_reader width_percent:
|
|
8
|
-
attr_reader height_percent:
|
|
9
|
-
def self.new: (child: widget, width_percent:
|
|
7
|
+
attr_reader width_percent: Float
|
|
8
|
+
attr_reader height_percent: Float
|
|
9
|
+
def self.new: (child: widget, ?width_percent: Numeric, ?height_percent: Numeric) -> Center
|
|
10
10
|
end
|
|
11
11
|
end
|
|
@@ -7,16 +7,17 @@ module RatatuiRuby
|
|
|
7
7
|
attr_reader bounds: [Float, Float]
|
|
8
8
|
attr_reader labels: Array[String]
|
|
9
9
|
attr_reader style: Style?
|
|
10
|
-
|
|
10
|
+
attr_reader labels_alignment: Symbol?
|
|
11
|
+
def self.new: (?title: String, ?bounds: [Numeric, Numeric], ?labels: Array[String], ?style: Style?, ?labels_alignment: Symbol?) -> Axis
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
class Dataset < Data
|
|
14
15
|
attr_reader name: String | Symbol
|
|
15
16
|
attr_reader data: Array[[Float, Float]]
|
|
16
|
-
attr_reader
|
|
17
|
+
attr_reader style: Style?
|
|
17
18
|
attr_reader marker: Symbol
|
|
18
19
|
attr_reader graph_type: Symbol
|
|
19
|
-
def self.new: (name: String | Symbol, data: Array[[
|
|
20
|
+
def self.new: (name: String | Symbol, data: Array[[Numeric, Numeric]], ?style: Style?, ?marker: Symbol, ?graph_type: Symbol) -> Dataset
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
class Chart < Data
|
|
@@ -25,7 +26,9 @@ module RatatuiRuby
|
|
|
25
26
|
attr_reader y_axis: Axis
|
|
26
27
|
attr_reader block: Block?
|
|
27
28
|
attr_reader style: Style?
|
|
28
|
-
|
|
29
|
+
attr_reader legend_position: Symbol?
|
|
30
|
+
attr_reader hidden_legend_constraints: Array[Constraint]
|
|
31
|
+
def self.new: (datasets: Array[Dataset], x_axis: Axis, y_axis: Axis, ?block: Block?, ?style: Style?, ?legend_position: Symbol?, ?hidden_legend_constraints: Array[Constraint]) -> Chart
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
class LineChart < Data
|
|
@@ -34,6 +37,6 @@ module RatatuiRuby
|
|
|
34
37
|
attr_reader y_labels: Array[String]
|
|
35
38
|
attr_reader y_bounds: [Float, Float]
|
|
36
39
|
attr_reader block: Block?
|
|
37
|
-
def self.new: (datasets: Array[Dataset], ?x_labels: Array[String], ?y_labels: Array[String], ?y_bounds: [
|
|
40
|
+
def self.new: (datasets: Array[Dataset], ?x_labels: Array[String], ?y_labels: Array[String], ?y_bounds: [Numeric, Numeric], ?block: Block?) -> LineChart
|
|
38
41
|
end
|
|
39
42
|
end
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
module RatatuiRuby
|
|
5
5
|
class Constraint < Data
|
|
6
6
|
attr_reader type: Symbol
|
|
7
|
-
attr_reader value: Integer
|
|
8
|
-
def self.length: (
|
|
9
|
-
def self.percentage: (
|
|
10
|
-
def self.min: (
|
|
11
|
-
def self.
|
|
7
|
+
attr_reader value: (Integer | Array[Integer])
|
|
8
|
+
def self.length: (Numeric) -> Constraint
|
|
9
|
+
def self.percentage: (Numeric) -> Constraint
|
|
10
|
+
def self.min: (Numeric) -> Constraint
|
|
11
|
+
def self.max: (Numeric) -> Constraint
|
|
12
|
+
def self.fill: (?Numeric) -> Constraint
|
|
13
|
+
def self.ratio: (Numeric, Numeric) -> Constraint
|
|
14
|
+
def self.new: (type: Symbol, value: (Integer | Array[Integer])) -> Constraint
|
|
12
15
|
end
|
|
13
16
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
|
|
5
|
+
module RatatuiRuby
|
|
6
|
+
module Draw
|
|
7
|
+
class StringCmd < Data
|
|
8
|
+
attr_reader x: Integer
|
|
9
|
+
attr_reader y: Integer
|
|
10
|
+
attr_reader string: String
|
|
11
|
+
attr_reader style: Style | Hash[Symbol, untyped]
|
|
12
|
+
|
|
13
|
+
def self.new: (x: Integer, y: Integer, string: String, style: Style | Hash[Symbol, untyped]) -> StringCmd
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class CellCmd < Data
|
|
17
|
+
attr_reader x: Integer
|
|
18
|
+
attr_reader y: Integer
|
|
19
|
+
attr_reader cell: Cell
|
|
20
|
+
|
|
21
|
+
def self.new: (x: Integer, y: Integer, cell: Cell) -> CellCmd
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.string: (Numeric x, Numeric y, String string, ?Style | Hash[Symbol, untyped] style) -> StringCmd
|
|
25
|
+
def self.cell: (Numeric x, Numeric y, Cell cell) -> CellCmd
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -5,9 +5,11 @@ module RatatuiRuby
|
|
|
5
5
|
class Gauge < Data
|
|
6
6
|
attr_reader ratio: Float
|
|
7
7
|
attr_reader label: String?
|
|
8
|
-
attr_reader style: Style
|
|
8
|
+
attr_reader style: Style?
|
|
9
|
+
attr_reader gauge_style: Style?
|
|
9
10
|
attr_reader block: Block?
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
attr_reader use_unicode: bool
|
|
13
|
+
def self.new: (?ratio: Numeric?, ?percent: Numeric?, ?label: String?, ?style: Style?, ?gauge_style: Style?, ?block: Block?, ?use_unicode: bool) -> Gauge
|
|
12
14
|
end
|
|
13
15
|
end
|
|
@@ -2,10 +2,20 @@
|
|
|
2
2
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
3
|
|
|
4
4
|
module RatatuiRuby
|
|
5
|
+
type flex_mode = :legacy | :start | :center | :end | :space_between | :space_around | :space_evenly
|
|
6
|
+
|
|
5
7
|
class Layout < Data
|
|
8
|
+
FLEX_MODES: Array[Symbol]
|
|
9
|
+
|
|
6
10
|
attr_reader direction: Symbol
|
|
7
11
|
attr_reader constraints: Array[Constraint]
|
|
8
12
|
attr_reader children: Array[widget]
|
|
9
|
-
|
|
13
|
+
attr_reader flex: flex_mode
|
|
14
|
+
def self.new: (?direction: Symbol, ?constraints: Array[Constraint], ?children: Array[widget], ?flex: flex_mode) -> Layout
|
|
15
|
+
def self.split: (Rect | Hash[Symbol, Integer] area, ?direction: Symbol, constraints: Array[Constraint], ?flex: flex_mode) -> Array[Rect]
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def self._split: (Rect, Symbol, Array[Constraint], Symbol) -> Array[Hash[Symbol, Integer]]
|
|
10
20
|
end
|
|
11
21
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
2
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
module RatatuiRuby
|
|
5
|
+
class LineGauge < Data
|
|
6
|
+
attr_reader ratio: Float
|
|
7
|
+
attr_reader label: String?
|
|
8
|
+
attr_reader filled_style: Style?
|
|
9
|
+
attr_reader unfilled_style: Style?
|
|
10
|
+
attr_reader block: Block?
|
|
11
|
+
attr_reader filled_symbol: String
|
|
12
|
+
attr_reader unfilled_symbol: String
|
|
13
|
+
|
|
14
|
+
def self.new: (?ratio: Numeric, ?label: String?, ?style: Style?, ?filled_style: Style?, ?unfilled_style: Style?, ?block: Block?, ?filled_symbol: String, ?unfilled_symbol: String) -> LineGauge
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -8,7 +8,11 @@ module RatatuiRuby
|
|
|
8
8
|
attr_reader style: Style?
|
|
9
9
|
attr_reader highlight_style: Style?
|
|
10
10
|
attr_reader highlight_symbol: String?
|
|
11
|
+
attr_reader repeat_highlight_symbol: bool
|
|
12
|
+
attr_reader highlight_spacing: Symbol
|
|
13
|
+
attr_reader direction: Symbol
|
|
14
|
+
attr_reader scroll_padding: Integer?
|
|
11
15
|
attr_reader block: Block?
|
|
12
|
-
def self.new: (?items: Array[String], ?selected_index:
|
|
16
|
+
def self.new: (?items: Array[String], ?selected_index: Numeric?, ?style: Style?, ?highlight_style: Style?, ?highlight_symbol: String?, ?repeat_highlight_symbol: bool, ?highlight_spacing: Symbol, ?direction: Symbol, ?scroll_padding: Numeric?, ?block: Block?) -> List
|
|
13
17
|
end
|
|
14
18
|
end
|
|
@@ -6,6 +6,9 @@ module RatatuiRuby
|
|
|
6
6
|
attr_reader text: String
|
|
7
7
|
attr_reader style: Style
|
|
8
8
|
attr_reader block: Block?
|
|
9
|
-
|
|
9
|
+
attr_reader wrap: bool
|
|
10
|
+
attr_reader alignment: Symbol
|
|
11
|
+
def initialize: (text: String, ?style: Style, ?block: Block?, ?wrap: bool, ?alignment: Symbol, ?scroll: [Numeric, Numeric]) -> void
|
|
12
|
+
def self.new: (text: String, ?style: Style?, ?fg: (String | Symbol)?, ?bg: (String | Symbol)?, ?block: Block?, ?wrap: bool, ?alignment: Symbol, ?scroll: [Numeric, Numeric]) -> Paragraph
|
|
10
13
|
end
|
|
11
14
|
end
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
5
|
|
|
6
6
|
module RatatuiRuby
|
|
7
|
-
class
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
class RatatuiMascot < Data
|
|
8
|
+
attr_reader block: Block?
|
|
9
|
+
|
|
10
|
+
def self.new: (?block: Block?) -> RatatuiMascot
|
|
10
11
|
end
|
|
11
12
|
end
|
|
@@ -9,6 +9,7 @@ module RatatuiRuby
|
|
|
9
9
|
attr_reader y: Integer
|
|
10
10
|
attr_reader width: Integer
|
|
11
11
|
attr_reader height: Integer
|
|
12
|
-
def self.new: (x:
|
|
12
|
+
def self.new: (?x: Numeric, ?y: Numeric, ?width: Numeric, ?height: Numeric) -> instance
|
|
13
|
+
def contains?: (Integer px, Integer py) -> bool
|
|
13
14
|
end
|
|
14
15
|
end
|
|
@@ -7,13 +7,29 @@ module RatatuiRuby
|
|
|
7
7
|
attr_reader position: Integer
|
|
8
8
|
attr_reader orientation: Symbol
|
|
9
9
|
attr_reader thumb_symbol: String
|
|
10
|
+
attr_reader thumb_style: Style?
|
|
11
|
+
attr_reader track_symbol: String?
|
|
12
|
+
attr_reader track_style: Style?
|
|
13
|
+
attr_reader begin_symbol: String?
|
|
14
|
+
attr_reader begin_style: Style?
|
|
15
|
+
attr_reader end_symbol: String?
|
|
16
|
+
attr_reader end_style: Style?
|
|
17
|
+
attr_reader style: Style?
|
|
10
18
|
attr_reader block: Block?
|
|
11
19
|
|
|
12
20
|
def self.new: (
|
|
13
|
-
content_length:
|
|
14
|
-
position:
|
|
21
|
+
content_length: Numeric,
|
|
22
|
+
position: Numeric,
|
|
15
23
|
?orientation: Symbol,
|
|
16
24
|
?thumb_symbol: String,
|
|
25
|
+
?thumb_style: Style?,
|
|
26
|
+
?track_symbol: String?,
|
|
27
|
+
?track_style: Style?,
|
|
28
|
+
?begin_symbol: String?,
|
|
29
|
+
?begin_style: Style?,
|
|
30
|
+
?end_symbol: String?,
|
|
31
|
+
?end_style: Style?,
|
|
32
|
+
?style: Style?,
|
|
17
33
|
?block: Block?
|
|
18
34
|
) -> Scrollbar
|
|
19
35
|
end
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
module RatatuiRuby
|
|
5
5
|
class Sparkline < Data
|
|
6
|
-
attr_reader data: Array[Integer]
|
|
6
|
+
attr_reader data: Array[Integer?]
|
|
7
7
|
attr_reader max: Integer?
|
|
8
8
|
attr_reader style: Style?
|
|
9
9
|
attr_reader block: Block?
|
|
10
|
-
|
|
10
|
+
attr_reader direction: (:left_to_right | :right_to_left)?
|
|
11
|
+
attr_reader absent_value_symbol: String?
|
|
12
|
+
attr_reader absent_value_style: Style?
|
|
13
|
+
attr_reader bar_set: Hash[Symbol, String]?
|
|
14
|
+
def self.new: (data: Array[Numeric?], ?max: Numeric?, ?style: Style?, ?block: Block?, ?direction: (:left_to_right | :right_to_left)?, ?absent_value_symbol: String?, ?absent_value_style: Style?, ?bar_set: Hash[Symbol, String]?) -> Sparkline
|
|
11
15
|
end
|
|
12
16
|
end
|
|
@@ -7,7 +7,14 @@ module RatatuiRuby
|
|
|
7
7
|
attr_reader rows: Array[Array[String | Paragraph | Style | _ToS]]
|
|
8
8
|
attr_reader widths: Array[Constraint]
|
|
9
9
|
attr_reader block: Block?
|
|
10
|
+
attr_reader footer: Array[String | Paragraph]?
|
|
11
|
+
attr_reader flex: Symbol
|
|
12
|
+
attr_reader style: (Style | Hash[Symbol, untyped])?
|
|
13
|
+
attr_reader column_spacing: Integer?
|
|
14
|
+
attr_reader highlight_spacing: Symbol
|
|
15
|
+
attr_reader column_highlight_style: Style?
|
|
16
|
+
attr_reader selected_column: Integer?
|
|
10
17
|
|
|
11
|
-
def self.new: (?header: Array[String | Paragraph]?, ?rows: Array[Array[String | Paragraph | Style | _ToS]], ?widths: Array[Constraint], ?block: Block?) -> Table
|
|
18
|
+
def self.new: (?header: Array[String | Paragraph]?, ?rows: Array[Array[String | Paragraph | Style | _ToS]], ?widths: Array[Constraint], ?highlight_style: Style?, ?highlight_symbol: String, ?highlight_spacing: Symbol, ?column_highlight_style: Style?, ?cell_highlight_style: Style?, ?selected_row: Numeric?, ?selected_column: Numeric?, ?block: Block?, ?footer: Array[String | Paragraph]?, ?flex: Symbol, ?style: (Style | Hash[Symbol, untyped])?, ?column_spacing: Numeric) -> Table
|
|
12
19
|
end
|
|
13
20
|
end
|
|
@@ -6,6 +6,10 @@ module RatatuiRuby
|
|
|
6
6
|
attr_reader titles: Array[String | _ToS]
|
|
7
7
|
attr_reader selected_index: Integer
|
|
8
8
|
attr_reader block: Block?
|
|
9
|
-
|
|
9
|
+
attr_reader divider: String?
|
|
10
|
+
attr_reader highlight_style: Style
|
|
11
|
+
attr_reader padding_left: Integer
|
|
12
|
+
attr_reader padding_right: Integer
|
|
13
|
+
def self.new: (?titles: Array[String | _ToS], ?selected_index: Numeric, ?block: Block?, ?divider: String?, ?highlight_style: Style?, ?style: Style?, ?padding_left: Numeric, ?padding_right: Numeric) -> Tabs
|
|
10
14
|
end
|
|
11
15
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
2
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
module RatatuiRuby
|
|
5
|
+
module Text
|
|
6
|
+
class Span < Data
|
|
7
|
+
attr_reader content: String
|
|
8
|
+
attr_reader style: Style?
|
|
9
|
+
|
|
10
|
+
def self.new: (content: String, ?style: Style?) -> Span
|
|
11
|
+
def self.styled: (String, ?Style?) -> Span
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class Line < Data
|
|
15
|
+
attr_reader spans: Array[Span]
|
|
16
|
+
attr_reader alignment: (:left | :center | :right)?
|
|
17
|
+
|
|
18
|
+
def self.new: (?spans: Array[Span], ?alignment: (:left | :center | :right)?) -> Line
|
|
19
|
+
def self.from_string: (String, ?alignment: (:left | :center | :right)?) -> Line
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
2
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
# !!! DO NOT EDIT THIS FILE BY HAND !!!
|
|
5
|
+
# This file is automatically generated by `rake autodoc:rbs:session`.
|
|
6
|
+
# Any changes will be overwritten.
|
|
7
|
+
|
|
8
|
+
module RatatuiRuby
|
|
9
|
+
class Session
|
|
10
|
+
def self.new: () -> Session
|
|
11
|
+
| () { (Session) -> void } -> void
|
|
12
|
+
|
|
13
|
+
def _paragraph_line_count: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
14
|
+
def _paragraph_line_width: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
15
|
+
def _tabs_width: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
16
|
+
def clear_events: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
17
|
+
def draw: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
18
|
+
def experimental_warnings: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
19
|
+
def experimental_warnings=: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
20
|
+
def get_buffer_content: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
21
|
+
def get_cell_at: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
22
|
+
def get_cursor_position: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
23
|
+
def init_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
24
|
+
def init_test_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
25
|
+
def inject_test_event: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
26
|
+
def poll_event: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
27
|
+
def resize_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
28
|
+
def restore_terminal: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
29
|
+
def run: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
30
|
+
def warn_experimental_feature: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
31
|
+
def axis: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
32
|
+
def bar_chart: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
33
|
+
def bar_chart_bar: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
34
|
+
def bar_chart_bar_group: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
35
|
+
def block: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
36
|
+
def calendar: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
37
|
+
def canvas: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
38
|
+
def cell: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
39
|
+
def cell_char: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
40
|
+
def cell_default: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
41
|
+
def cell_empty: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
42
|
+
def cell_symbol: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
43
|
+
def center: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
44
|
+
def chart: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
45
|
+
def clear: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
46
|
+
def constraint: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
47
|
+
def constraint_fill: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
48
|
+
def constraint_length: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
49
|
+
def constraint_max: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
50
|
+
def constraint_min: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
51
|
+
def constraint_percentage: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
52
|
+
def constraint_ratio: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
53
|
+
def cursor: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
54
|
+
def dataset: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
55
|
+
def draw_cell_cmd: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
56
|
+
def draw_string_cmd: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
57
|
+
def error: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
58
|
+
def event: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
59
|
+
def event_focus_gained: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
60
|
+
def event_focus_lost: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
61
|
+
def event_key: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
62
|
+
def event_mouse: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
63
|
+
def event_none: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
64
|
+
def event_paste: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
65
|
+
def event_resize: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
66
|
+
def frame: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
67
|
+
def gauge: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
68
|
+
def layout: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
69
|
+
def layout_split: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
70
|
+
def line_chart: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
71
|
+
def line_gauge: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
72
|
+
def list: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
73
|
+
def overlay: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
74
|
+
def paragraph: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
75
|
+
def paragraph_new: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
76
|
+
def ratatui_logo: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
77
|
+
def ratatui_mascot: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
78
|
+
def rect: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
79
|
+
def scrollbar: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
80
|
+
def shape_circle: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
81
|
+
def shape_label: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
82
|
+
def shape_line: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
83
|
+
def shape_map: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
84
|
+
def shape_point: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
85
|
+
def shape_rectangle: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
86
|
+
def sparkline: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
87
|
+
def style: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
88
|
+
def style_default: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
89
|
+
def table: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
90
|
+
def tabs: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
91
|
+
def text_line: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
92
|
+
def text_span: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
4
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
|
+
|
|
6
|
+
require_relative "name"
|
|
7
|
+
require_relative "member"
|
|
8
|
+
|
|
9
|
+
module Autodoc
|
|
10
|
+
class Inventory
|
|
11
|
+
include Enumerable
|
|
12
|
+
|
|
13
|
+
def each(&)
|
|
14
|
+
delegates.each(&)
|
|
15
|
+
factories.each(&)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def delegates
|
|
19
|
+
RatatuiRuby.singleton_methods(false).sort.map do |method_name|
|
|
20
|
+
Member::Delegate.new(name: method_name)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def factories
|
|
25
|
+
members = []
|
|
26
|
+
RatatuiRuby.constants.sort.each do |const_name|
|
|
27
|
+
next if const_name == :Buffer
|
|
28
|
+
|
|
29
|
+
const = RatatuiRuby.const_get(const_name)
|
|
30
|
+
next unless const.is_a?(Module)
|
|
31
|
+
|
|
32
|
+
if const.is_a?(Class)
|
|
33
|
+
snake_name = Name.new(const_name).snake
|
|
34
|
+
members << Member::Factory.new(name: snake_name, const_name:)
|
|
35
|
+
|
|
36
|
+
const.singleton_methods(false).sort.each do |class_method|
|
|
37
|
+
members << Member::Helper.new(
|
|
38
|
+
name: "#{snake_name}_#{class_method}",
|
|
39
|
+
class_method:,
|
|
40
|
+
const_name:
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
const.constants.sort.each do |child_name|
|
|
46
|
+
child = const.const_get(child_name)
|
|
47
|
+
next unless child.is_a?(Class)
|
|
48
|
+
|
|
49
|
+
parent_prefix = Name.new(const_name).snake
|
|
50
|
+
child_suffix = Name.new(child_name).snake
|
|
51
|
+
|
|
52
|
+
members << Member::Factory.new(
|
|
53
|
+
name: "#{parent_prefix}_#{child_suffix}",
|
|
54
|
+
const_name: "#{const_name}::#{child_name}"
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
members
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|