diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f5df541..2242145 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,6 @@ * @justinsgithub -/lua/types/serde/init.lua @DrKJeff16 -/lua/types/plugin/init.lua @DrKJeff16 -/lua/types/url/init.lua @DrKJeff16 +/lua/types/wezterm/serde.lua @DrKJeff16 +/lua/types/wezterm/plugin.lua @DrKJeff16 +/lua/types/wezterm/url.lua @DrKJeff16 /.github/CODEOWNERS @DrKJeff16 /.github/workflows/stylua.yml @DrKJeff16 diff --git a/lua/types/config/init.lua b/lua/types/config.lua similarity index 80% rename from lua/types/config/init.lua rename to lua/types/config.lua index 529b4ed..a197bce 100644 --- a/lua/types/config/init.lua +++ b/lua/types/config.lua @@ -86,7 +86,7 @@ ---@field widtht? "Cover"|"Contain"|number|string ---@alias NewlineCanon ----|bool +---|boolean ---|"None" ---|"LineFeed" ---|"CarriageReturn" @@ -128,24 +128,24 @@ -- -- This can be used to produce a translucent window effect rather than -- a crystal clear transparent window effect ----@field kde_window_background_blur? bool +---@field kde_window_background_blur? boolean -- The baseline font to use ---@field font? FontAttributes|FontFamilyAttributes ----@field dpi_by_screen? { [string]: f64 } +---@field dpi_by_screen? { [string]: number } -- The color palette ---@field colors? Palette ---@field launcher_alphabet? string ----@field switch_to_last_active_tab_when_closing_tab? bool +---@field switch_to_last_active_tab_when_closing_tab? boolean ---@field window_frame? WindowFrameConfig ----@field char_select_font_size? f64 ----@field char_select_fg_color? RgbaColor ----@field char_select_bg_color? RgbaColor ----@field command_palette_font_size? f64 ----@field command_palette_fg_color? RgbaColor ----@field command_palette_bg_color? RgbaColor ----@field pane_select_font_size? f64 ----@field pane_select_fg_color? RgbaColor ----@field pane_select_bg_color? RgbaColor +---@field char_select_font_size? number +---@field char_select_fg_color? string +---@field char_select_bg_color? string +---@field command_palette_font_size? number +---@field command_palette_fg_color? string +---@field command_palette_bg_color? string +---@field pane_select_font_size? number +---@field pane_select_fg_color? string +---@field pane_select_bg_color? string ---@field tab_bar_style? TabBarStyle ---@field resolved_palette? Palette ---@field color_scheme? string @@ -153,7 +153,7 @@ -- by the colors setting. ---@field color_schemes? { [string]: Palette } -- Named color schemes ----@field scrollback_lines? usize +---@field scrollback_lines? number -- How many lines of scrollback you want to retain ---@field default_prog? string[] -- If no `prog` is specified on the command line, use this @@ -168,46 +168,46 @@ -- is the command to run and the rest of the elements are passed -- as the positional arguments to that command. ---@field default_gui_startup_args? string[] ----@field default_cwd? PathBuf +---@field default_cwd? string -- Specifies the default current working directory if none is specified -- through configuration or OSC 7 (see docs for `default_cwd` for more -- info!) ---@field exit_behavior? ExitBehavior ---@field exit_behavior_messaging? ExitBehaviorMessaging ----@field clean_exit_codes? u32[] ----@field detect_password_input? bool +---@field clean_exit_codes? integer[] +---@field detect_password_input? boolean ---@field set_environment_variables? {[string]: string} -- Specifies a map of environment variables that should be set -- when spawning commands in the local domain. -- This is not used when working with remote domains. ----@field initial_rows? u16 +---@field initial_rows? integer -- Specifies the height of a new window, expressed in character cells. ----@field enable_kitty_graphics? bool ----@field enable_kitty_keyboard? bool ----@field enable_title_reporting? bool +---@field enable_kitty_graphics? boolean +---@field enable_kitty_keyboard? boolean +---@field enable_title_reporting? boolean -- Whether the terminal should respond to requests to read the -- title string. -- Disabled by default for security concerns with shells that might -- otherwise attempt to execute the response. -- ----@field initial_cols? u16 +---@field initial_cols? integer -- Specifies the width of a new window, expressed in character cells ---@field hyperlink_rules? HyperlinkRule[] ---@field term? string -- What to set the TERM variable to ---@field font_locator? FontLocatorSelection ----@field font_rasterizer? FontRasterizerSelection +---@field font_rasterizer? "FreeType" ---@field font_shaper? FontShaperSelection ---@field display_pixel_geometry? DisplayPixelGeometry ---@field freetype_load_target? FreeTypeLoadTarget ---@field freetype_render_target? FreeTypeLoadTarget ---@field freetype_load_flags? FreeTypeLoadFlags ----@field freetype_interpreter_version? u32 +---@field freetype_interpreter_version? integer -- Selects the freetype interpret version to use. -- Likely values are 35, 38 and 40 which have different -- characteristics with respective to subpixel hinting. -- See https://freetype.org/freetype2/docs/subpixel-hinting.html ----@field freetype_pcf_long_family_names? bool +---@field freetype_pcf_long_family_names? boolean ---@field harfbuzz_features? HarfbuzzFeatures[] -- Specify the features to enable when using harfbuzz for font shaping. -- There is some light documentation here: @@ -243,7 +243,7 @@ -- Whether to select the higher powered discrete GPU when -- the system has a choice of integrated or discrete. -- Defaults to low power. ----@field webgpu_force_fallback_adapter? bool +---@field webgpu_force_fallback_adapter? boolean ---@field webgpu_preferred_adapter? GpuInfo ---@field wsl_domains? WslDomain[] ---@field exec_domains? ExecDomain[] @@ -257,18 +257,18 @@ -- each of the endpoints that we'll listen for connections ---@field tls_clients? TlsDomainClient[] -- The set of tls domains that we can connect to as a client ----@field ratelimit_mux_line_prefetches_per_second? u32 +---@field ratelimit_mux_line_prefetches_per_second? integer -- Constrains the rate at which the multiplexer client will -- speculatively fetch line data. -- This helps to avoid saturating the link between the client -- and server if the server is dumping a large amount of output -- to the client. ----@field mux_output_parser_buffer_size? usize +---@field mux_output_parser_buffer_size? number -- The buffer size used by parse_buffered_data in the mux module. -- This should not be too large, otherwise the processing cost -- of applying a batch of actions to the terminal will be too -- high and the user experience will be laggy and less responsive. ----@field mux_output_parser_coalesce_delay_ms? u64 +---@field mux_output_parser_coalesce_delay_ms? integer -- How many ms to delay after reading a chunk of output -- in order to try to coalesce fragmented writes into -- a single bigger chunk of output and reduce the chances @@ -277,69 +277,69 @@ ---@field keys? Key[] ---@field key_tables? {[string]: Key[]} ---@field bypass_mouse_reporting_modifiers? Modifiers ----@field debug_key_events? bool ----@field normalize_output_to_unicode_nfc? bool ----@field disable_default_key_bindings? bool +---@field debug_key_events? boolean +---@field normalize_output_to_unicode_nfc? boolean +---@field disable_default_key_bindings? boolean ---@field leader? LeaderKey ----@field disable_default_quick_select_patterns? bool +---@field disable_default_quick_select_patterns? boolean ---@field quick_select_patterns? string[] ---@field quick_select_alphabet? string ---@field mouse_bindings? MouseBindingBase[] ----@field disable_default_mouse_bindings? bool +---@field disable_default_mouse_bindings? boolean ---@field daemon_options? DaemonOptions ----@field send_composed_key_when_left_alt_is_pressed? bool ----@field send_composed_key_when_right_alt_is_pressed? bool +---@field send_composed_key_when_left_alt_is_pressed? boolean +---@field send_composed_key_when_right_alt_is_pressed? boolean ---@field macos_forward_to_ime_modifier_mask? Modifiers ----@field treat_left_ctrlalt_as_altgr? bool ----@field swap_backspace_and_delete? bool +---@field treat_left_ctrlalt_as_altgr? boolean +---@field swap_backspace_and_delete? boolean -- If true, the `Backspace` and `Delete` keys generate `Delete` and `Backspace` -- keypresses, respectively, rather than their normal keycodes. -- On macOS the default for this is true because its Backspace key -- is labeled as Delete and things are backwards. ----@field enable_tab_bar? bool +---@field enable_tab_bar? boolean -- If true, display the tab bar UI at the top of the window. -- The tab bar shows the titles of the tabs and which is the -- active tab. Clicking on a tab activates it. ----@field use_fancy_tab_bar? bool ----@field tab_bar_at_bottom? bool ----@field mouse_wheel_scrolls_tabs? bool ----@field show_tab_index_in_tab_bar? bool +---@field use_fancy_tab_bar? boolean +---@field tab_bar_at_bottom? boolean +---@field mouse_wheel_scrolls_tabs? boolean +---@field show_tab_index_in_tab_bar? boolean -- If true, tab bar titles are prefixed with the tab index ----@field show_tabs_in_tab_bar? bool ----@field show_new_tab_button_in_tab_bar? bool ----@field tab_and_split_indices_are_zero_based? bool +---@field show_tabs_in_tab_bar? boolean +---@field show_new_tab_button_in_tab_bar? boolean +---@field tab_and_split_indices_are_zero_based? boolean -- If true, show_tab_index_in_tab_bar uses a zero-based index. -- The default is false and the tab shows a one-based index. ----@field tab_max_width? usize +---@field tab_max_width? number -- Specifies the maximum width that a tab can have in the -- tab bar. Defaults to 16 glyphs in width. ----@field hide_tab_bar_if_only_one_tab? bool +---@field hide_tab_bar_if_only_one_tab? boolean -- If true, hide the tab bar if the window only has a single tab. ----@field enable_scroll_bar? bool ----@field min_scroll_bar_height? Dimension ----@field enable_wayland? bool +---@field enable_scroll_bar? boolean +---@field min_scroll_bar_height? string|number +---@field enable_wayland? boolean -- If false, do not try to use a Wayland protocol connection -- when starting the gui frontend, and instead use X11. -- This option is only considered on X11/Wayland systems and -- has no effect on macOS or Windows. -- The default is true. ----@field enable_zwlr_output_manager? bool +---@field enable_zwlr_output_manager? boolean -- driver updates without breaking and losing your work. -- Whether to prefer EGL over other GL implementations. -- EGL on Windows has jankier resize behavior than WGL (which -- is used if EGL is unavailable), but EGL survives graphics ----@field prefer_egl? bool +---@field prefer_egl? boolean -- If set to `true`, launching a new instance of wezterm will prefer to spawn -- a new tab when it is able to connect to your already-running GUI instance. -- Otherwise, it will spawn a new window. -- -- The default value for this option is `false` ----@field prefer_to_spawn_tabs? bool ----@field custom_block_glyphs? bool ----@field anti_alias_custom_block_glyphs? bool +---@field prefer_to_spawn_tabs? boolean +---@field custom_block_glyphs? boolean +---@field anti_alias_custom_block_glyphs? boolean ---@field window_padding? WindowPadding -- Controls the amount of padding to use around the terminal cell area ----@field window_background_image? PathBuf +---@field window_background_image? string -- Specifies the path to a background image attachment file. -- The file can be any image format that the rust `image` -- crate is able to identify and load. @@ -351,12 +351,12 @@ ---@field window_background_image_hsb? HsbTransform ---@field foreground_text_hsb? HsbTransform ---@field background? BackgroundLayer[] ----@field macos_window_background_blur? i64 +---@field macos_window_background_blur? integer -- Only works on MacOS ---@field win32_system_backdrop? SystemBackdrop -- Only works on Windows ----@field win32_acrylic_accent_color? RgbaColor ----@field window_background_opacity? f32 +---@field win32_acrylic_accent_color? string +---@field window_background_opacity? number -- Specifies the alpha value to use when rendering the background -- of the window. The background is taken either from the -- window_background_image, or if there is none, the background @@ -397,8 +397,8 @@ -- A subtle dimming effect can be achieved by setting: -- inactive_pane_saturation 0.9 -- inactive_pane_brightness 0.8 ----@field text_background_opacity? f32 ----@field cursor_blink_rate? u64 +---@field text_background_opacity? number +---@field cursor_blink_rate? integer -- Specifies how often a blinking cursor transitions between visible -- and invisible, expressed in milliseconds. -- Setting this to 0 disables blinking. @@ -407,8 +407,8 @@ -- least the interval specified with some degree of slop. ---@field cursor_blink_ease_in? EasingFunction ---@field cursor_blink_ease_out? EasingFunction ----@field animation_fps? u8 ----@field force_reverse_video_cursor? bool +---@field animation_fps? integer +---@field force_reverse_video_cursor? boolean ---@field default_cursor_style? DefaultCursorStyle -- Specifies the default cursor style. various escape sequences -- can override the default style in different situations (eg: @@ -418,7 +418,7 @@ -- Acceptable values are `SteadyBlock`, `BlinkingBlock` -- `SteadyUnderline`, `BlinkingUnderline`, `SteadyBar` -- and `BlinkingBar`. ----@field text_blink_rate? u64 +---@field text_blink_rate? integer -- Specifies how often blinking text (normal speed) transitions -- between visible and invisible, expressed in milliseconds. -- Setting this to 0 disables slow text blinking. Note that this @@ -427,7 +427,7 @@ -- interval specified with some degree of slop. ---@field text_blink_ease_in? EasingFunction ---@field text_blink_ease_out? EasingFunction ----@field text_blink_rate_rapid? u64 +---@field text_blink_rate_rapid? integer -- Specifies how often blinking text (rapid speed) transitions -- between visible and invisible, expressed in milliseconds. -- Setting this to 0 disables rapid text blinking. Note that this @@ -436,91 +436,90 @@ -- interval specified with some degree of slop. ---@field text_blink_rapid_ease_in? EasingFunction ---@field text_blink_rapid_ease_out? EasingFunction ----@field hide_mouse_cursor_when_typing? bool +---@field hide_mouse_cursor_when_typing? boolean -- If true, the mouse cursor will be hidden while typing. -- This option is true by default. ----@field periodic_stat_logging? u64 +---@field periodic_stat_logging? integer -- If non-zero, specifies the period (in seconds) at which various -- statistics are logged. Note that there is a minimum period of -- 10 seconds. ----@field scroll_to_bottom_on_input? bool +---@field scroll_to_bottom_on_input? boolean -- If false, do not scroll to the bottom of the terminal when -- you send input to the terminal. -- The default is to scroll to the bottom when you send input -- to the terminal. ----@field use_ime? bool +---@field use_ime? boolean ---@field xim_im_name? string ---@field ime_preedit_rendering? ImePreeditRendering ----@field use_dead_keys? bool +---@field use_dead_keys? boolean ---@field launch_menu? SpawnCommand[] ----@field use_box_model_render? bool ----@field automatically_reload_config? bool +---@field use_box_model_render? boolean +---@field automatically_reload_config? boolean -- When true, watch the config file and reload it automatically -- when it is detected as changing. ----@field check_for_updates? bool ----@field show_update_window? bool ----@field check_for_updates_interval_seconds? u64 +---@field check_for_updates? boolean +---@field show_update_window? boolean +---@field check_for_updates_interval_seconds? integer -- When set to true, use the CSI-U encoding scheme as described -- in http://www.leonerd.org.uk/hacks/fixterms/ -- This is off by default because @wez and @jsgf find the shift-space -- mapping annoying in vim :-p ----@field enable_csi_u_key_encoding? bool +---@field enable_csi_u_key_encoding? boolean ---@field window_close_confirmation? WindowCloseConfirmation ----@field native_macos_fullscreen_mode? bool +---@field native_macos_fullscreen_mode? boolean ---@field selection_word_boundary? string ---@field enq_answerback? string ----@field adjust_window_size_when_changing_font_size? bool +---@field adjust_window_size_when_changing_font_size? boolean ---@field tiling_desktop_environments? string[] ----@field use_resize_increments? bool ----@field alternate_buffer_wheel_scroll_speed? u8 ----@field status_update_interval? u64 ----@field experimental_pixel_positioning? bool +---@field use_resize_increments? boolean +---@field alternate_buffer_wheel_scroll_speed? integer +---@field status_update_interval? integer +---@field experimental_pixel_positioning? boolean ---@field skip_close_confirmation_for_processes_named? string[] ----@field quit_when_all_windows_are_closed? bool ----@field warn_about_missing_glyphs? bool ----@field sort_fallback_fonts_by_coverage? bool ----@field search_font_dirs_for_fallback? bool ----@field use_cap_height_to_scale_fallback_fonts? bool ----@field swallow_mouse_click_on_pane_focus? bool ----@field swallow_mouse_click_on_window_focus? bool ----@field pane_focus_follows_mouse? bool ----@field unzoom_on_switch_pane? bool ----@field max_fps? u8 ----@field shape_cache_size? usize ----@field line_state_cache_size? usize ----@field line_quad_cache_size? usize ----@field line_to_ele_shape_cache_size? usize ----@field glyph_cache_image_cache_size? usize +---@field quit_when_all_windows_are_closed? boolean +---@field warn_about_missing_glyphs? boolean +---@field sort_fallback_fonts_by_coverage? boolean +---@field search_font_dirs_for_fallback? boolean +---@field use_cap_height_to_scale_fallback_fonts? boolean +---@field swallow_mouse_click_on_pane_focus? boolean +---@field swallow_mouse_click_on_window_focus? boolean +---@field pane_focus_follows_mouse? boolean +---@field unzoom_on_switch_pane? boolean +---@field max_fps? integer +---@field shape_cache_size? number +---@field line_state_cache_size? number +---@field line_quad_cache_size? number +---@field line_to_ele_shape_cache_size? number +---@field glyph_cache_image_cache_size? number ---@field visual_bell? VisualBell ---@field audible_bell? "Disabled"|"SystemBeep" ---@field canonicalize_pasted_newlines? NewlineCanon ----@field unicode_version? u8 ----@field treat_east_asian_ambiguous_width_as_wide? bool ----@field allow_download_protocols? bool ----@field allow_win32_input_mode? bool +---@field unicode_version? integer +---@field treat_east_asian_ambiguous_width_as_wide? boolean +---@field allow_download_protocols? boolean +---@field allow_win32_input_mode? boolean ---@field default_domain? string ---@field default_mux_server_domain? string ---@field default_workspace? string ---@field xcursor_theme? string ----@field xcursor_size? u32 +---@field xcursor_size? integer ---@field key_map_preference? KeyMapPreference ---@field quote_dropped_files? DroppedFileQuoting ---@field ui_key_cap_rendering? UIKeyCapRendering ----@field palette_max_key_assigments_for_action? usize ----@field ulimit_nofile? u64 ----@field ulimit_nproc? u64 +---@field palette_max_key_assigments_for_action? number +---@field ulimit_nofile? integer +---@field ulimit_nproc? integer -- The font size, measured in points ---@field font_size? number -- must be greater than 0 ---@field line_height? number --- default = "default_one_point_oh_f64" ---@field cell_width? any -- specified by underline_thickness ----@field cursor_thickess? Dimension +---@field cursor_thickess? string|number -- specified by font ----@field underline_thickness? Dimension ----@field underline_position? Dimension ----@field strikethrough_position? Dimension +---@field underline_thickness? string|number +---@field underline_position? string|number +---@field strikethrough_position? string|number ---@field allow_square_glyphs_to_overflow_width? "Allow"|"Never"|"WhenFollowedBySpace" -- Configures whether the window has a title bar and/or resizable border. -- @@ -551,7 +550,7 @@ -- default is MacOsNative no Mac, Windows on all others ---@field integrated_title_button_style? IntegratedTitleButtonStyle ---@field integrated_title_button_color? "Auto"|AnsiColor ----@field log_unknown_escape_sequences? bool +---@field log_unknown_escape_sequences? boolean -- The DPI to assume -- Override the detected DPI (dots per inch) for the display. -- This can be useful if the detected DPI is inaccurate and the text appears either blurry or too small (especially if you are using a 4K display on X11 or Wayland). diff --git a/lua/types/init.lua b/lua/types/init.lua index 48d8d6e..f1ff40c 100644 --- a/lua/types/init.lua +++ b/lua/types/init.lua @@ -6,9 +6,6 @@ ---@module "types.objects" ---@module "types.wezterm" --- Alias to help identify types that should actually be any ----@alias ANY any - ---@alias FormatItem.UnderlineStyle ---|"None" ---|"Single" @@ -25,13 +22,10 @@ ---@alias FormatItemAttribute ---|{ Underline: FormatItem.UnderlineStyle } ---|{ Intensity: FormatItem.Intensity } ----|{ Italic: bool } - --- Reset all attributes to default ----@alias FormatItemReset "ResetAttributes" +---|{ Italic: boolean } ---@alias FormatItem ----|FormatItemReset +---|"ResetAttributes" ---|{ Attribute: FormatItemAttribute } ---|{ Foreground: ColorSpec } ---|{ Background: ColorSpec } @@ -66,9 +60,6 @@ ---|"LowPower" ---|"HighPerformance" --- Only Option ----@alias FontRasterizerSelection "FreeType" - ---@alias FontShaperSelection ---|"Allsorts" very preliminary support ---|"Harfbuzz" default @@ -95,47 +86,16 @@ ---|"Full" ---|"Unknown" --- 32-bit floating point number ----@alias f32 number --- 64-bit floating point number ----@alias f64 number - --- 8-bit unsigned integer ----@alias u8 integer --- 16-bit unsigned integer ----@alias u16 integer --- 32-bit unsigned integer ----@alias u32 integer --- 64-bit unsigned integer ----@alias u64 integer - --- 64-bit signed integer ----@alias i64 integer - ----@alias Duration u64 - ----@alias usize number - ----@alias Regex string - ----@alias RgbColor string --- ----@alias RgbaColor string - ----@alias bool boolean - ---@alias BoldBrightening ---|"No" ---|"BrightAndBold" ---|"BrightOnly" --- TODO: describe ---@alias ExitBehavior ---|"Close" ---|"CloseOnCleanExit" ---|"Hold" --- TODO: describe ---@alias ExitBehaviorMessaging ---|"Verbose" ---|"Brief" @@ -205,31 +165,6 @@ ---|string -- Add other valid combinations if needed --- A value expressed in points, where 72 points == 1 inch ----@alias Points string - --- A value expressed in raw pixels ----@alias Pixels string|number - --- A value expressed in terms of a fraction of the maximum --- value in the same direction. --- For example, left padding of 10% depends on --- the pixel width of that element. --- The value is 1.0 == 100%. --- It is possible to express e.g. 2.0 for 200% ----@alias Percent string - --- A value expressed in terms of a fraction of the cell --- size computed from the configured font size. --- 1.0 == the cell size ----@alias Cells string - ----@alias Dimension ----|Points ----|Pixels ----|Percent ----|Cells - ---@alias TabBarIntensity ---|"Normal" ---|"Half" @@ -296,12 +231,12 @@ -- Specify whether you want the text to be italic for this tab. -- -- The default is `false` ----@field italic? bool +---@field italic? boolean -- Specify whether you want the text to be rendered with strikethrough (true) -- or not for this tab. -- -- The default is `false` ----@field strikethrough? bool +---@field strikethrough? boolean ---@class TabBarColors -- The text color to use when the attributes are reset to default @@ -327,11 +262,7 @@ -- moves over the new tab button ---@field new_tab_hover TabBarColor ----@alias AC "AnsiColor" - ----@alias CO "Color" - ----@alias ColorSpec table|table +---@alias ColorSpec table<"AnsiColor", AnsiColor>|table<"Color", string> ---@class Palette -- The text color to use when the attributes are reset to default @@ -529,8 +460,8 @@ ---@field stretch? FontStretch -- Whether the font should be an italic variant ---@field style? FontStyle ----@field is_fallback? bool ----@field is_synthetic? bool +---@field is_fallback? boolean +---@field is_synthetic? boolean ---@field scale? number -- `FontAttributes`-like class but with font family specified @@ -544,30 +475,30 @@ -- you can combine the flags like `"NO_HINTING|MONOCHROME"` -- **(you probably wouldn't want to do this)** ---@field freetype_load_flags? FreeTypeLoadFlags ----@field assume_emoji_presentation? bool +---@field assume_emoji_presentation? boolean ---@class Fonts ---@field fonts FontAttributes[] ---@class WindowFrameConfig ----@field inactive_titlebar_bg? RgbColor ----@field active_titlebar_bg? RgbColor ----@field inactive_titlebar_fg? RgbColor ----@field active_titlebar_fg? RgbColor ----@field inactive_titlebar_border_bottom? RgbColor ----@field active_titlebar_border_bottom? RgbColor ----@field button_fg? RgbColor ----@field button_bg? RgbColor ----@field button_hover_fg? RgbColor ----@field button_hover_bg? RgbColor ----@field border_left_width? Dimension ----@field border_right_width? Dimension ----@field border_top_height? Dimension ----@field border_bottom_height? Dimension ----@field border_left_color? RgbaColor ----@field border_right_color? RgbaColor ----@field border_top_color? RgbaColor ----@field border_bottom_color? RgbaColor +---@field inactive_titlebar_bg? string +---@field active_titlebar_bg? string +---@field inactive_titlebar_fg? string +---@field active_titlebar_fg? string +---@field inactive_titlebar_border_bottom? string +---@field active_titlebar_border_bottom? string +---@field button_fg? string +---@field button_bg? string +---@field button_hover_fg? string +---@field button_hover_bg? string +---@field border_left_width? string|number +---@field border_right_width? string|number +---@field border_top_height? string|number +---@field border_bottom_height? string|number +---@field border_left_color? string +---@field border_right_color? string +---@field border_top_color? string +---@field border_bottom_color? string ---@class TabBarStyle ---@field new_tab? string @@ -580,9 +511,9 @@ ---@field window_close_hover? string ---@class HyperlinkRule ----@field regex? Regex +---@field regex? string ---@field format? string ----@field highlight? usize +---@field highlight? number ---@class SerialDomain -- The name of this specific domain. @@ -597,7 +528,7 @@ -- Set the baud rate. -- -- The default is `9600` baud ----@field baud usize|9600 +---@field baud number|9600 ---@class GpuInfo ---@field name string @@ -605,8 +536,8 @@ ---@field backend string ---@field driver string ---@field driver_info string ----@field vendor u32 ----@field device u32 +---@field vendor integer +---@field device integer ---@class UnixDomain -- The name of this specific domain. @@ -614,12 +545,12 @@ ---@field name string -- The path to the socket. -- If unspecified, a resonable default value will be computed ----@field socket_path PathBuf +---@field socket_path string -- If `true`, connect to this domain automatically at startup ----@field connect_automatically bool +---@field connect_automatically boolean -- If `true`, do not attempt to start this server if we try and fail to -- connect to it. ----@field no_serve_automatically bool +---@field no_serve_automatically boolean -- If we decide that we need to start the server, the command to run -- to set that up. -- @@ -644,20 +575,20 @@ -- This is not recommended on a multi-user system, -- but is useful, for example, when running the server inside a WSL container -- but with the socket on the host NTFS volume ----@field skip_permissions_check bool ----@field read_timeout Duration +---@field skip_permissions_check boolean +---@field read_timeout integer -- Don"t use `default_local_echo_threshold_ms()` here to disable -- the predictive echo for UNIX domains by default ----@field write_timeout Duration +---@field write_timeout integer -- Show time since last response when waiting for a response. -- -- Recommended to look at this: -- `https://wezfurlong.org/wezterm/config/lua/pane/get_metadata.html#since_last_response_ms` ----@field local_echo_threshold_ms u64 ----@field overlay_lag_indicator bool +---@field local_echo_threshold_ms integer +---@field overlay_lag_indicator boolean ---@class LeaderKey: KeyNoAction ----@field timeout_milliseconds? u64 +---@field timeout_milliseconds? integer ---@class HyperLinkRule -- The regular expression to match @@ -761,7 +692,7 @@ -- Only the first `"format-tab-title"` event will be executed; -- it doesn't make sense to define multiple instances of the event -- with `multiple wezterm.on("format-tab-title", ...)` calls ----@alias Event.FormatTabTitle fun(event: FormatTabTitle, callback: fun(tab: MuxTab, tabs: MuxTab[], panes: Pane[], config: Config, hover: bool, max_width: number): string|FormatItem) +---@alias Event.FormatTabTitle fun(event: FormatTabTitle, callback: fun(tab: MuxTab, tabs: MuxTab[], panes: Pane[], config: Config, hover: boolean, max_width: number): string|FormatItem) -- The parameters to the event are: -- @@ -1094,8 +1025,8 @@ ---@class MouseBindingBase ---@field event MouseEvent ---@field action Action ----@field mouse_reporting? bool ----@field alt_screen? bool|"Any" +---@field mouse_reporting? boolean +---@field alt_screen? boolean|"Any" ---@class MouseBinding: MouseBindingBase ---@field mods string diff --git a/lua/types/objects/color.lua b/lua/types/objects/color.lua index 8f46757..2b3acdc 100644 --- a/lua/types/objects/color.lua +++ b/lua/types/objects/color.lua @@ -76,7 +76,7 @@ ---@field square fun(self: Color): a: Color, b: Color, c: Color -- Returns a tuple of the internal `SRGBA` colors expressed -- as unsigned 8-bit integers in the range `0-255` ----@field srgb_u8 fun(self: Color): r: u8, g: u8, b: u8, alpha: u8 +---@field srgb_u8 fun(self: Color): r: integer, g: integer, b: integer, alpha: integer -- Returns the other two colors that form a triad. -- The other colors are at +/- 120 degrees in the `HSL` color wheel ---@field triad fun(self: Color): a: Color, b: Color diff --git a/lua/types/objects/local-process-info.lua b/lua/types/objects/local-process-info.lua index 142f668..caa25a7 100644 --- a/lua/types/objects/local-process-info.lua +++ b/lua/types/objects/local-process-info.lua @@ -17,16 +17,16 @@ -- Represents a process running on the local machine ---@class LocalProcessInfo -- The process identifier (`PID`) ----@field pid u32 +---@field pid integer -- The parent process identifier ----@field ppid u32 +---@field ppid integer -- A short name for the process. -- -- Due to platform limitations, this may be inaccurate and/or truncated; -- you should look at the `executable` or `argv` fields instead of this one ---@field name string -- the full path to the executable image for the process (may be empty) ----@field executable PathBuf|"" +---@field executable string|"" -- A table holding the argument array for the process ---@field argv string[]|table -- The current working directory for the process (may be empty) @@ -49,4 +49,4 @@ ---@field status LocalProcessStatus -- A table keyed by child process id and whose values are themselves -- `LocalProcessInfo` objects that describe the child processes ----@field children table +---@field children table diff --git a/lua/types/objects/mux-tab.lua b/lua/types/objects/mux-tab.lua index 9679784..aea0cb6 100644 --- a/lua/types/objects/mux-tab.lua +++ b/lua/types/objects/mux-tab.lua @@ -49,7 +49,7 @@ -- - Setting the zoom state to `false` un-zooms the pane if it was zoomed -- -- Returns the prior zoom state ----@field set_zoomed fun(self: MuxTab, state: bool): bool +---@field set_zoomed fun(self: MuxTab, state: boolean): boolean -- Returns the tab id ---@field tab_id fun(self: MuxTab): number -- Returns the MuxWindow object that contains this tab diff --git a/lua/types/objects/mux-window.lua b/lua/types/objects/mux-window.lua index f3f5d85..13e5cbc 100644 --- a/lua/types/objects/mux-window.lua +++ b/lua/types/objects/mux-window.lua @@ -4,7 +4,7 @@ -- The 0-based tab index ---@field index integer -- A `boolean` indicating whether this is the active tab within the window ----@field is_active bool +---@field is_active boolean -- The `MuxTab` object ---@field tab MuxTab diff --git a/lua/types/objects/pane-information.lua b/lua/types/objects/pane-information.lua index 84a5ea0..6a92e4e 100644 --- a/lua/types/objects/pane-information.lua +++ b/lua/types/objects/pane-information.lua @@ -12,9 +12,9 @@ -- The logical position of the pane within its containing layout ---@field pane_index number -- is `true` if the pane is the active pane within its containing tab ----@field is_active bool +---@field is_active boolean -- Is `true` if the pane is in the zoomed state ----@field is_zoomed bool +---@field is_zoomed boolean -- The cell `x` coordinate of the left edge of the pane ---@field left number -- The cell `y` coordinate of the top edge of the pane diff --git a/lua/types/objects/pane.lua b/lua/types/objects/pane.lua index 5337a56..dcbbf14 100644 --- a/lua/types/objects/pane.lua +++ b/lua/types/objects/pane.lua @@ -8,19 +8,19 @@ ---@class SpawnSplit: SpawnTab ---@field direction? SplitDirection ----@field top_level? bool +---@field top_level? boolean ---@field size? number ---@class PaneMetadata -- A boolean value that is populated only for local panes. -- It is set to `true` if it appears as though the local PTY is configured -- for password entry (local echo disabled, canonical input mode enabled) ----@field password_input bool +---@field password_input boolean -- A boolean value that is populated only for multiplexer client panes. -- It is set to `true` if wezterm is waiting for a response from the multiplexer server. -- -- This can be used in conjunction with `since_last_response_ms` ----@field is_tardy bool +---@field is_tardy boolean -- An integer value that is populated only for multiplexer client panes. -- It is set to the number of elapsed milliseconds since the most recent -- response from the multiplexer server @@ -289,7 +289,7 @@ -- -- See also `PaneInformation.has_unseen_output` for an example -- using equivalent information to color tabs based on this state ----@field has_unseen_output fun(self: Pane): bool +---@field has_unseen_output fun(self: Pane): boolean -- Sends text, which may include escape sequences, -- to the output side of the current pane. -- @@ -308,7 +308,7 @@ -- (like `vim` or `less`) to do whatever they want on the screen -- without fear of destroying the user's scrollback. -- Those programs emit escape codes to return to the normal screen when they exit ----@field is_alt_screen_active fun(self: Pane): bool +---@field is_alt_screen_active fun(self: Pane): boolean -- Creates a new tab in the window that contains pane, and moves pane into that tab. -- -- Returns a tuple of the newly created `MuxTab` and `MuxWindow` objects containing it diff --git a/lua/types/objects/tab-information.lua b/lua/types/objects/tab-information.lua index 33e0924..c1affa0 100644 --- a/lua/types/objects/tab-information.lua +++ b/lua/types/objects/tab-information.lua @@ -9,8 +9,8 @@ ---@class TabInformation ---@field tab_id integer ---@field tab_index integer ----@field is_active bool ----@field is_last_active bool +---@field is_active boolean +---@field is_last_active boolean ---@field active_pane PaneInformation -- The ID of the window that contains this tab ---@field window_id integer diff --git a/lua/types/objects/time.lua b/lua/types/objects/time.lua index d056df6..cd8b535 100644 --- a/lua/types/objects/time.lua +++ b/lua/types/objects/time.lua @@ -4,7 +4,7 @@ ---@field rise Time|nil ---@field progression number ---@field set Time|nil ----@field up bool +---@field up boolean -- Represents a date and time that is tracked internally as UTC. -- diff --git a/lua/types/objects/tls-domain-client.lua b/lua/types/objects/tls-domain-client.lua index 29458e4..b0cb500 100644 --- a/lua/types/objects/tls-domain-client.lua +++ b/lua/types/objects/tls-domain-client.lua @@ -8,18 +8,18 @@ -- The value is "user@host:port", just like "wezterm ssh" accepts. ---@field remote_address string -- identifies the host:port pair of the remote server. ----@field pem_private_key PathBuf +---@field pem_private_key string -- the path to an x509 PEM encoded private key file ----@field pem_cert PathBuf +---@field pem_cert string -- the path to an x509 PEM encoded certificate file ----@field pem_ca PathBuf +---@field pem_ca string -- the path to an x509 PEM encoded CA chain file ----@field pem_root_certs PathBuf[] +---@field pem_root_certs string[] -- A set of paths to load additional CA certificates. -- Each entry can be either the path to a directory or to a PEM encoded -- CA file. If an entry is a directory, then its contents will be -- loaded as CA certs and added to the trust store. ----@field accept_invalid_hostnames bool +---@field accept_invalid_hostnames boolean -- explicitly control whether the client checks that the certificate -- presented by the server matches the hostname portion of -- `remote_address`. The default is true. This option is made @@ -31,15 +31,15 @@ -- field in the certificate presented by the server. This defaults to -- the hostname portion of the `remote_address` configuration and you -- should not normally need to override this value. ----@field connect_automatically bool +---@field connect_automatically boolean -- If true, connect to this domain automatically at startup ----@field read_timeout Duration ----@field write_timeout Duration ----@field local_echo_threshold_ms u64 +---@field read_timeout integer +---@field write_timeout integer +---@field local_echo_threshold_ms integer -- The path to the wezterm binary on the remote host ---@field remote_wezterm_path string -- Show time since last response when waiting for a response. -- It is recommended to use -- -- instead. ----@field overlay_lag_indicator bool +---@field overlay_lag_indicator boolean diff --git a/lua/types/objects/tls-domain-server.lua b/lua/types/objects/tls-domain-server.lua index 50c0f1f..daea338 100644 --- a/lua/types/objects/tls-domain-server.lua +++ b/lua/types/objects/tls-domain-server.lua @@ -2,13 +2,13 @@ ---@field bind_address string -- The address:port combination on which the server will listen -- for client connections ----@field pem_private_key PathBuf +---@field pem_private_key string -- the path to an x509 PEM encoded private key file ----@field pem_cert PathBuf +---@field pem_cert string -- the path to an x509 PEM encoded certificate file ----@field pem_ca PathBuf +---@field pem_ca string -- the path to an x509 PEM encoded CA chain file ----@field pem_root_certs PathBuf[] +---@field pem_root_certs string[] -- A set of paths to load additional CA certificates. -- Each entry can be either the path to a directory -- or to a PEM encoded CA file. If an entry is a directory diff --git a/lua/types/objects/window.lua b/lua/types/objects/window.lua index 0549a94..f4e49c3 100644 --- a/lua/types/objects/window.lua +++ b/lua/types/objects/window.lua @@ -10,7 +10,7 @@ ---@field pixel_width number ---@field pixel_height number ---@field dpi number ----@field is_full_screen bool +---@field is_full_screen boolean ---@class WindowKeyboardMods ---@field mods string @@ -78,7 +78,7 @@ ---@field get_selection_text_for_pane fun(self: Window): string -- Returns `true` if the window has focus. -- The `"update-status"` event is fired when the focus state changes ----@field is_focused fun(self: Window): bool +---@field is_focused fun(self: Window): boolean -- Returns two values; the keyboard modifiers and the key status leds. -- Both values are exposed to Lua as strings with `|`-delimited strings -- representing the various modifier keys and keyboard LED states: @@ -91,7 +91,7 @@ -- NOTE: macOS doesn't have a num lock concept ---@field keyboard_modifiers fun(self: Window): WindowKeyboardMods -- Returns true if the Leader Key is active in the window, or false otherwise ----@field leader_is_active fun(self: Window): bool +---@field leader_is_active fun(self: Window): boolean -- Puts the window into the maximized state. -- Use `window:restore()` to return to the normal/non-maximized state ---@field maximize fun(self: Window) diff --git a/lua/types/objects/wsl-domain.lua b/lua/types/objects/wsl-domain.lua index 3f26c8b..993aa69 100644 --- a/lua/types/objects/wsl-domain.lua +++ b/lua/types/objects/wsl-domain.lua @@ -4,5 +4,5 @@ ---@field name string ---@field distribution string ---@field username string ----@field default_cwd PathBuf +---@field default_cwd string ---@field default_prog string[] diff --git a/lua/types/wezterm/color/init.lua b/lua/types/wezterm/color.lua similarity index 100% rename from lua/types/wezterm/color/init.lua rename to lua/types/wezterm/color.lua diff --git a/lua/types/wezterm/gui/init.lua b/lua/types/wezterm/gui.lua similarity index 100% rename from lua/types/wezterm/gui/init.lua rename to lua/types/wezterm/gui.lua diff --git a/lua/types/wezterm/init.lua b/lua/types/wezterm/init.lua index a577177..11c840f 100644 --- a/lua/types/wezterm/init.lua +++ b/lua/types/wezterm/init.lua @@ -1,7 +1,5 @@ ---@meta ---TODO: specify "any" types where possible - ---@module 'types.wezterm.color' ---@module 'types.wezterm.gui' ---@module 'types.wezterm.mux' @@ -12,8 +10,6 @@ ---@module 'types.wezterm.time' ---@module 'types.wezterm.url' ----@alias PathBuf string - ---@class Wezterm: ExecDomain -- Provides global, in-process, in-memory, data storage for JSON-like variables -- that persists across config reloads. diff --git a/lua/types/wezterm/mux/init.lua b/lua/types/wezterm/mux.lua similarity index 100% rename from lua/types/wezterm/mux/init.lua rename to lua/types/wezterm/mux.lua diff --git a/lua/types/wezterm/nerdfonts/init.lua b/lua/types/wezterm/nerdfonts.lua similarity index 100% rename from lua/types/wezterm/nerdfonts/init.lua rename to lua/types/wezterm/nerdfonts.lua diff --git a/lua/types/wezterm/plugin/init.lua b/lua/types/wezterm/plugin.lua similarity index 100% rename from lua/types/wezterm/plugin/init.lua rename to lua/types/wezterm/plugin.lua diff --git a/lua/types/wezterm/procinfo/init.lua b/lua/types/wezterm/procinfo.lua similarity index 100% rename from lua/types/wezterm/procinfo/init.lua rename to lua/types/wezterm/procinfo.lua diff --git a/lua/types/wezterm/serde/init.lua b/lua/types/wezterm/serde.lua similarity index 100% rename from lua/types/wezterm/serde/init.lua rename to lua/types/wezterm/serde.lua diff --git a/lua/types/wezterm/time/init.lua b/lua/types/wezterm/time.lua similarity index 100% rename from lua/types/wezterm/time/init.lua rename to lua/types/wezterm/time.lua diff --git a/lua/types/wezterm/url/init.lua b/lua/types/wezterm/url.lua similarity index 100% rename from lua/types/wezterm/url/init.lua rename to lua/types/wezterm/url.lua