Current section

Files

Jump to
etch src etch@command.erl
Raw

src/etch@command.erl

-module(etch@command).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/etch/command.gleam").
-export_type([command/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" This module provides commads to be queued and flushed.\n"
" ```gleam\n"
" import stdout.{Queue, queue, flush}\n"
"\n"
" let q = Queue([])\n"
" queue(q, [\n"
" EnterRaw,\n"
" EnterAlternativeScreen,\n"
" HideCursor,\n"
" Println(\"Hello from Etch\"),\n"
" ])\n"
" flush(q)\n"
" ```\n"
).
-type command() :: {print, binary()} |
{print_reset, binary()} |
{println, binary()} |
{println_reset, binary()} |
{move_up, integer()} |
{move_down, integer()} |
{move_left, integer()} |
{move_right, integer()} |
{move_to_next_line, integer()} |
{move_to_previous_line, integer()} |
{move_to_column, integer()} |
{move_to_row, integer()} |
{move_to, integer(), integer()} |
save_position |
restore_position |
show_cursor |
hide_cursor |
{set_cursor_style, etch@cursor:cursor_style()} |
{scroll_up, integer()} |
{scroll_down, integer()} |
{clear, etch@terminal:clear_type()} |
{set_size, integer(), integer()} |
{set_title, binary()} |
disable_line_wrap |
enable_line_wrap |
enter_raw |
enter_alternate_screen |
leave_alternate_screen |
enable_mouse_capture |
disable_mouse_capture |
{push_keyboard_enhancement_flags,
list(etch@event:keyboard_enhancement_flag())} |
pop_keyboard_enhancement_flags |
enable_focus_change |
disable_focus_change |
{set_foreground_color, etch@style:color()} |
{set_background_color, etch@style:color()} |
{set_foreground_and_background_colors,
etch@style:color(),
etch@style:color()} |
{set_style, etch@style:style()} |
reset_style |
reset_color |
reset_foreground |
reset_background |
{set_attributes, list(etch@style:attribute())} |
reset_attributes.