Skip to content

Commit

Permalink
chore: fix GSubprocess types
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondill committed Aug 9, 2024
1 parent 7634c87 commit 3ead9b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions util/lgi/Gio/GSubprocess.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---@meta
---@diagnostic disable: duplicate-doc-field This is used for overloading. Note: It's not perfect because the return types will not be narrowed.
---@diagnostic disable: duplicate-doc-field
---Note that none of the type definitions in this file are complete. If a field is missing, add it and report it.

-- Note that the default for stdin is to redirect from /dev/null. For stdout
Expand All @@ -23,15 +23,15 @@
---@class GSubprocess
---If stdin is given, the subprocess must have been created with "STDIN_PIPE".
---@field communicate fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable): stdout: GBytes?, stderr: GBytes?
---@field communicate fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable): nil, GError
---@field communicate fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable): false, GError
---@field communicate_async fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable, callback: GAsyncReadyCallback<GSubprocess>)
---@field communicate_finish fun(self: GSubprocess, result: GAsyncResult): stdout: GBytes?, stderr: GBytes?
---@field communicate_finish fun(self: GSubprocess, result: GAsyncResult): nil, GError
---@field communicate_finish fun(self: GSubprocess, result: GAsyncResult): false, GError
---@field communicate_utf8 fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable): stdout: GBytes?, stderr: GBytes?
---@field communicate_utf8 fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable): nil, GError
---@field communicate_utf8 fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable): false, GError
---@field communicate_utf8_async fun(self: GSubprocess, stdin?: GBytes, cancellable?: GCancellable, callback: GAsyncReadyCallback<GSubprocess>)
---@field communicate_utf8_finish fun(self: GSubprocess, result: GAsyncResult): stdout: GBytes?, stderr: GBytes?
---@field communicate_utf8_finish fun(self: GSubprocess, result: GAsyncResult): nil, GError
---@field communicate_utf8_finish fun(self: GSubprocess, result: GAsyncResult): false, GError
---@field force_exit fun(self: GSubprocess) On Unix, this function sends SIGKILL.
---It is an error to call this function before g_subprocess_wait() and unless g_subprocess_get_if_exited() returned TRUE.
---@field get_exit_status fun(self: GSubprocess): integer
Expand Down
3 changes: 2 additions & 1 deletion util/lgi/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---@meta

---@diagnostic disable: duplicate-doc-field This is used for overloading. Note: It's not perfect because the return types will not be narrowed.
---Note that none of the type definitions in this file are complete.
---If a field is missing, add it and report it.

Expand All @@ -24,8 +23,10 @@
---@field message string
---@field domain string
---@field code string
---@diagnostic disable: duplicate-doc-field
---@field matches fun(self: GError, other: GError): boolean
---@field matches fun(self: GError, domain: LGI.Error.domain, code: LGI.Error.code): boolean
---@diagnostic enable: duplicate-doc-field

---@class GErrorStatic
---@field new fun(domain: LGI.Error.domain, code: LGI.Error.code, message: string): GError
Expand Down

0 comments on commit 3ead9b4

Please sign in to comment.