---@meta
-- LuaLS type definitions for jjui Lua API
-- Code generated by cmd/genactions; DO NOT EDIT.

---@class jjui.revisions
---@field current fun(): string? Get the current selected revision's change ID
---@field checked fun(): string[] Get array of checked revision change IDs
---@field refresh fun(options?: {keep_selections?: boolean, selected_revision?: string}) Refresh revisions
---@field navigate fun(options?: {target?: "parent"|"child"|"children"|"working"|"working_copy"|"work", by?: integer, page?: boolean, to?: string, fallback?: string, ensureView?: boolean, allowStream?: boolean}) Navigate revisions

---@class jjui.revset
---@field current fun(): string Get current revset string
---@field default fun(): string Get default revset string

---@class jjui.context
---@field change_id fun(): string? Get selected item's change ID
---@field commit_id fun(): string? Get selected item's commit ID
---@field file fun(): string? Get selected file path
---@field operation_id fun(): string? Get selected operation ID
---@field checked_files fun(): string[] Get array of checked files
---@field checked_change_ids fun(): string[] Get array of checked change IDs
---@field checked_commit_ids fun(): string[] Get array of checked commit IDs


---Run a jj command asynchronously (yields, resumes after completion)
---@param ... string|string[] Command arguments for jj (variadic strings or a single table)
function jj_async(...) end

---Run a jj command interactively (takes over the terminal)
---@param ... string|string[] Command arguments for jj (variadic strings or a single table)
function jj_interactive(...) end

---Run a jj command synchronously and return its output
---@param ... string|string[] Command arguments for jj (variadic strings or a single table)
---@return string? output The command output (nil on error)
---@return string? error The error message (nil on success)
function jj(...) end

---Show a flash message in the status bar
---@param text_or_options string|{text: string, error?: boolean, sticky?: boolean} Message text or options table
function flash(text_or_options) end

---Change the active runtime theme
---@param name string Theme name
function set_theme(name) end

---Copy text to the system clipboard
---@param text string Text to copy
---@return boolean? ok True on success
---@return string? error The error message (nil on success)
function copy_to_clipboard(text) end

---Execute a shell command
---@param command string Shell command to execute
function exec_shell(command) end

---Split text into an array of lines
---@param text string Text to split
---@param keepEmpty? boolean Keep empty lines (default: false)
---@return string[] lines Array of lines
function split_lines(text, keepEmpty) end

---Show a choice dialog and wait for user selection (yields)
---@param ... string|string[]|{options?: string[]|string, title?: string, filter?: boolean, ordered?: boolean} Options as variadic strings, a single array, or an options table
---@return string|nil selected The selected option, or nil if cancelled
function choose(...) end

---Show a text input dialog and wait for user input (yields)
---@param options? {title?: string, prompt?: string} Input options
---@return string|nil value The entered text, or nil if cancelled
function input(options) end

---Yield and wait for the current view to close
---@return boolean applied True when the closed view was applied
function wait_close() end

---Yield and wait for revisions to be updated
function wait_refresh() end

---@class jjui.bookmarks
---@field apply fun()
---@field bookmark_delete fun()
---@field bookmark_forget fun()
---@field bookmark_move fun()
---@field bookmark_track fun()
---@field bookmark_untrack fun()
---@field cancel fun()
---@field cycle_remotes fun()
---@field cycle_remotes_back fun()
---@field filter fun()
---@field move_down fun()
---@field move_up fun()
---@field page_down fun()
---@field page_up fun()
---@field quit fun()
---@field close fun()

---@class jjui.choose
---@field apply fun()
---@field cancel fun()
---@field move_down fun()
---@field move_up fun()
---@field close fun()

---@class jjui.command_history
---@field close fun()
---@field delete_selected fun()
---@field move_down fun()
---@field move_up fun()

---@class jjui.diff
---@field half_page_down fun()
---@field half_page_up fun()
---@field left fun()
---@field move_bottom fun()
---@field move_top fun()
---@field page_down fun()
---@field page_up fun()
---@field right fun()
---@field scroll_down fun()
---@field scroll_up fun()
---@field show fun(value?: string|{content: string})
---@field toggle_wrap fun()

---@class jjui.file_search
---@field apply fun()
---@field cancel fun()
---@field edit fun()
---@field move_down fun()
---@field move_up fun()
---@field page_down fun()
---@field page_up fun()
---@field preview_half_page_down fun()
---@field preview_half_page_up fun()
---@field toggle fun()
---@field close fun()

---@class jjui.git
---@field apply fun()
---@field cancel fun()
---@field cycle_remotes fun()
---@field cycle_remotes_back fun()
---@field fetch fun()
---@field filter fun()
---@field move_down fun()
---@field move_up fun()
---@field page_down fun()
---@field page_up fun()
---@field push fun()
---@field quit fun()
---@field close fun()

---@class jjui.help
---@field apply fun()
---@field cancel fun()
---@field close fun()
---@field filter fun()
---@field move_bottom fun()
---@field move_top fun()
---@field page_down fun()
---@field page_up fun()
---@field scroll_down fun()
---@field scroll_up fun()

---@class jjui.input
---@field apply fun()
---@field cancel fun()
---@field close fun()

---@class jjui.oplog
---@field quick_search jjui.oplog.quick_search
---@field close fun()
---@field diff fun()
---@field move_down fun()
---@field move_up fun()
---@field page_down fun()
---@field page_up fun()
---@field quit fun()
---@field restore fun()
---@field revert fun()

---@class jjui.oplog.quick_search
---@field clear fun()
---@field next fun()
---@field prev fun()

---@class jjui.password
---@field apply fun()
---@field cancel fun()
---@field close fun()

---@class jjui.redo
---@field apply fun()
---@field cancel fun()
---@field next fun()
---@field prev fun()
---@field close fun()

---@class jjui.revisions
---@field abandon jjui.revisions.abandon
---@field absorb jjui.revisions.absorb
---@field ace_jump jjui.revisions.ace_jump
---@field details jjui.revisions.details
---@field diff_range jjui.revisions.diff_range
---@field duplicate jjui.revisions.duplicate
---@field evolog jjui.revisions.evolog
---@field inline_describe jjui.revisions.inline_describe
---@field new_between jjui.revisions.new_between
---@field quick_search jjui.revisions.quick_search
---@field rebase jjui.revisions.rebase
---@field revert jjui.revisions.revert
---@field set_bookmark jjui.revisions.set_bookmark
---@field set_parents jjui.revisions.set_parents
---@field squash jjui.revisions.squash
---@field target_picker jjui.revisions.target_picker
---@field ace_jump fun()
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field commit fun()
---@field describe fun()
---@field diff fun()
---@field diff_edit fun()
---@field edit fun()
---@field force_apply fun()
---@field force_edit fun()
---@field jump_to_children fun()
---@field jump_to_parent fun()
---@field jump_to_working_copy fun()
---@field move_down fun()
---@field move_up fun()
---@field new fun()
---@field open_abandon fun()
---@field open_absorb fun()
---@field open_details fun()
---@field open_diff_range fun()
---@field open_duplicate fun()
---@field open_evolog fun()
---@field open_inline_describe fun()
---@field open_new_between fun()
---@field open_rebase fun()
---@field open_revert fun()
---@field open_set_bookmark fun(args: {value?: string})
---@field open_set_parents fun()
---@field open_squash fun()
---@field page_down fun()
---@field page_up fun()
---@field refresh fun()
---@field split fun()
---@field split_parallel fun()
---@field toggle_select fun()
---@field close fun()

---@class jjui.revisions.abandon
---@field ace_jump fun()
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field force_apply fun()
---@field jump_to_working_copy fun()
---@field select_descendants fun()
---@field toggle_select fun()
---@field close fun()

---@class jjui.revisions.absorb
---@field ace_jump fun()
---@field apply fun()
---@field cancel fun()
---@field jump_to_working_copy fun()
---@field select_descendants fun()
---@field toggle_select fun()
---@field close fun()

---@class jjui.revisions.ace_jump
---@field apply fun()
---@field cancel fun()
---@field close fun()

---@class jjui.revisions.details
---@field confirmation jjui.revisions.details.confirmation
---@field absorb fun()
---@field cancel fun()
---@field diff fun()
---@field move_down fun()
---@field move_up fun()
---@field page_down fun()
---@field page_up fun()
---@field quit fun()
---@field refresh fun()
---@field restore fun()
---@field revisions_changing_file fun()
---@field select_file fun(value?: string|{file: string})
---@field split fun()
---@field split_parallel fun()
---@field squash fun()
---@field toggle_select fun()
---@field close fun()

---@class jjui.revisions.details.confirmation
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field force_apply fun()
---@field next fun()
---@field prev fun()
---@field close fun()

---@class jjui.revisions.diff_range
---@field apply fun()
---@field cancel fun()
---@field swap fun()
---@field target_picker fun(args: {target: "to"|"from"})
---@field close fun()

---@class jjui.revisions.duplicate
---@field ace_jump fun()
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field force_apply fun()
---@field jump_to_working_copy fun()
---@field set_target fun(args: {target: "onto"|"after"|"before"|"insert"})
---@field target_picker fun()
---@field close fun()

---@class jjui.revisions.evolog
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field diff fun()
---@field move_down fun()
---@field move_up fun()
---@field page_down fun()
---@field page_up fun()
---@field quit fun()
---@field restore fun()
---@field close fun()

---@class jjui.revisions.inline_describe
---@field accept fun(args: {force?: boolean})
---@field cancel fun()
---@field editor fun()
---@field force_accept fun()
---@field new_line fun()
---@field close fun()

---@class jjui.revisions.new_between
---@field apply fun()
---@field cancel fun()
---@field toggle_insert_before fun()
---@field close fun()

---@class jjui.revisions.quick_search
---@field input jjui.revisions.quick_search.input
---@field clear fun()
---@field next fun()
---@field prev fun()

---@class jjui.revisions.quick_search.input
---@field apply fun()
---@field cancel fun()
---@field close fun()

---@class jjui.revisions.rebase
---@field ace_jump fun()
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field force_apply fun()
---@field jump_to_working_copy fun()
---@field set_source fun(args: {source: "revision"|"branch"|"source"})
---@field set_target fun(args: {target: "onto"|"after"|"before"|"insert"})
---@field skip_emptied fun()
---@field target_picker fun()
---@field close fun()

---@class jjui.revisions.revert
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field force_apply fun()
---@field set_target fun(args: {target: "onto"|"after"|"before"|"insert"})
---@field target_picker fun()
---@field close fun()

---@class jjui.revisions.set_bookmark
---@field apply fun()
---@field autocomplete fun()
---@field autocomplete_back fun()
---@field cancel fun()
---@field close fun()

---@class jjui.revisions.set_parents
---@field ace_jump fun()
---@field apply fun()
---@field cancel fun()
---@field jump_to_working_copy fun()
---@field toggle_select fun()
---@field close fun()

---@class jjui.revisions.squash
---@field ace_jump fun()
---@field apply fun(args: {force?: boolean})
---@field cancel fun()
---@field force_apply fun()
---@field interactive fun()
---@field jump_to_working_copy fun()
---@field keep_emptied fun()
---@field target_picker fun()
---@field use_destination_msg fun()
---@field close fun()

---@class jjui.revisions.target_picker
---@field apply fun(args: {force?: boolean})
---@field autocomplete fun()
---@field autocomplete_back fun()
---@field cancel fun()
---@field force_apply fun()
---@field move_down fun()
---@field move_up fun()
---@field close fun()

---@class jjui.revset
---@field apply fun()
---@field autocomplete fun()
---@field autocomplete_back fun()
---@field cancel fun()
---@field edit fun(args: {clear?: boolean})
---@field move_down fun()
---@field move_up fun()
---@field reset fun()
---@field set fun(value?: string|{value: string})
---@field close fun()

---@class jjui.status
---@field input jjui.status.input

---@class jjui.status.input
---@field apply fun()
---@field autocomplete fun()
---@field cancel fun()
---@field move_down fun()
---@field move_up fun()
---@field page_down fun()
---@field page_up fun()
---@field close fun()

---@class jjui.ui
---@field preview jjui.ui.preview
---@field cancel fun()
---@field change_theme fun(value?: string|{name: string})
---@field exec_jj fun()
---@field exec_shell fun()
---@field expand_status fun()
---@field file_search_toggle fun()
---@field open_bookmarks fun()
---@field open_command_history fun()
---@field open_git fun()
---@field open_help fun()
---@field open_oplog fun()
---@field open_redo fun()
---@field open_revset fun()
---@field open_undo fun()
---@field preview_expand fun()
---@field preview_half_page_down fun()
---@field preview_half_page_up fun()
---@field preview_scroll_down fun()
---@field preview_scroll_up fun()
---@field preview_shrink fun()
---@field preview_toggle fun()
---@field preview_toggle_bottom fun()
---@field quick_search fun()
---@field quit fun()
---@field suspend fun()
---@field close fun()

---@class jjui.ui.preview
---@field show fun(value?: string|{content: string})

---@class jjui.undo
---@field apply fun()
---@field cancel fun()
---@field next fun()
---@field prev fun()
---@field close fun()

---@class jjui
---@field revisions jjui.revisions
---@field revset jjui.revset
---@field context jjui.context
---@field bookmarks jjui.bookmarks
---@field choose jjui.choose
---@field command_history jjui.command_history
---@field diff jjui.diff
---@field file_search jjui.file_search
---@field git jjui.git
---@field help jjui.help
---@field input jjui.input
---@field oplog jjui.oplog
---@field password jjui.password
---@field redo jjui.redo
---@field status jjui.status
---@field ui jjui.ui
---@field undo jjui.undo
---@field builtin jjui.builtin
---@field jj_async fun(...: string|string[])
---@field jj_interactive fun(...: string|string[])
---@field jj fun(...: string|string[]): string?, string?
---@field flash fun(text_or_options: string|{text: string, error?: boolean, sticky?: boolean})
---@field set_theme fun(name: string)
---@field copy_to_clipboard fun(text: string): boolean?, string?
---@field exec_shell fun(command: string)
---@field split_lines fun(text: string, keepEmpty?: boolean): string[]
---@field choose fun(...: string|string[]|{options?: string[]|string, title?: string, filter?: boolean, ordered?: boolean}): string|nil
---@field input fun(options?: {title?: string, prompt?: string}): string|nil
---@field wait_close fun(): boolean
---@field wait_refresh fun()

---@class jjui.builtin
---@field bookmarks jjui.bookmarks
---@field choose jjui.choose
---@field command_history jjui.command_history
---@field diff jjui.diff
---@field file_search jjui.file_search
---@field git jjui.git
---@field help jjui.help
---@field input jjui.input
---@field oplog jjui.oplog
---@field password jjui.password
---@field redo jjui.redo
---@field revisions jjui.revisions
---@field revset jjui.revset
---@field status jjui.status
---@field ui jjui.ui
---@field undo jjui.undo

---@type jjui
jjui = {}

---@type jjui.revisions
revisions = {}

---@type jjui.revset
revset = {}

---@type jjui.context
context = {}

---@type jjui.diff
diff = {}

---@type jjui.ui
ui = {}

