From 3ead9b4f4fb04c067b49dbaaf1f24325b9d33c0c Mon Sep 17 00:00:00 2001 From: Aaron Dill Date: Fri, 9 Aug 2024 03:07:45 -0500 Subject: [PATCH] chore: fix GSubprocess types --- util/lgi/Gio/GSubprocess.lua | 10 +++++----- util/lgi/init.lua | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/util/lgi/Gio/GSubprocess.lua b/util/lgi/Gio/GSubprocess.lua index ce71b036..2f30ece9 100644 --- a/util/lgi/Gio/GSubprocess.lua +++ b/util/lgi/Gio/GSubprocess.lua @@ -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 @@ -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) ---@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) ---@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 diff --git a/util/lgi/init.lua b/util/lgi/init.lua index d164b80f..538e9b57 100644 --- a/util/lgi/init.lua +++ b/util/lgi/init.lua @@ -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. @@ -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