Skip to content

Commit 9f50645

Browse files
committed
chore(output) add functions to type
1 parent 9ae0755 commit 9f50645

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

lua/opencode/ui/output.lua

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,29 @@ Output.__index = Output
66
---@class Output
77
---@field lines table<number, string>
88
---@field metadata table<number, OutputMetadata>
9-
---@field extmarks table<number, OutputExtmark> -- Stores extmarks for each line
10-
---@field actions table<number, OutputAction[]> -- Stores contextual actions for each line range
9+
---@field extmarks table<number, OutputExtmark>
10+
---@field actions OutputAction[]
11+
---@field add_line fun(self: Output, line: string, fit?: boolean): number
12+
---@field get_line fun(self: Output, idx: number): string?
13+
---@field get_metadata fun(self: Output, idx: number): OutputMetadata?
14+
---@field get_nearest_metadata fun(self: Output, idx: number, predicate?: function, direction?: string): OutputMetadata|nil
15+
---@field get_all_metadata fun(self: Output): OutputMetadata[]
16+
---@field get_previous_snapshot fun(self: Output, line: number): string?
17+
---@field get_next_snapshot fun(self: Output, line: number): string?
18+
---@field get_first_snapshot fun(self: Output): string?
19+
---@field get_last_snapshot fun(self: Output): string?
20+
---@field merge_line fun(self: Output, idx: number, text: string)
21+
---@field add_lines fun(self: Output, lines: string[], prefix?: string)
22+
---@field add_empty_line fun(self: Output): number?
23+
---@field add_metadata fun(self: Output, metadata: OutputMetadata): number?
24+
---@field clear fun(self: Output)
25+
---@field get_line_count fun(self: Output): number
26+
---@field get_lines fun(self: Output): string[]
27+
---@field add_extmark fun(self: Output, idx: number, extmark: OutputExtmark|fun(): OutputExtmark)
28+
---@field get_extmarks fun(self: Output): table<number, table[]>
29+
---@field add_actions fun(self: Output, actions: OutputAction[])
30+
---@field add_action fun(self: Output, action: OutputAction)
31+
---@field get_actions_for_line fun(self: Output, line: number): OutputAction[]?
1132
---@return self Output
1233
function Output.new()
1334
local self = setmetatable({}, Output)

0 commit comments

Comments
 (0)