Add minor docs

This commit is contained in:
Seaotatop 2023-06-28 16:42:07 -05:00
parent 8400f7dd5f
commit 9f09a8c7a1
3 changed files with 12 additions and 3 deletions

View file

@ -99,6 +99,7 @@ function client.get_window(identifier)
local response = ReadMsg()
local props = response.RequestResponse.response.Window.window
---@type Window
local win = {
id = props.id,

View file

@ -11,8 +11,8 @@ pcall(require, "luarocks.loader")
-- Neovim users be like:
require("pinnacle").setup(function(pinnacle)
local input = pinnacle.input --Key and mouse binds
local client = pinnacle.client --Window management
local input = pinnacle.input -- Key and mouse binds
local client = pinnacle.client -- Window management
local process = pinnacle.process -- Process spawning
-- Every key supported by xkbcommon.

View file

@ -4,11 +4,19 @@
--
-- SPDX-License-Identifier: MPL-2.0
---@diagnostic disable: redefined-local
local process = {}
---Spawn a process with an optional callback for its stdout and stderr.
---
---`callback` has the following parameters:
--- - `stdout`: The process's stdout printed this line.
--- - `stderr`: The process's stderr printed this line.
--- - `exit_code`: The process exited with this code.
--- - `exit_msg`: The process exited with this message.
---@param command string|string[] The command as one whole string or a table of each of its arguments
---@param callback fun(stdout: string?, stderr: string?, exit_code: integer?, exit_msg: string?)? A callback to do something whenever the process's stdout or stderr print a line. Only one will be non-nil at a time.
---@param callback fun(stdout: string?, stderr: string?, exit_code: integer?, exit_msg: string?)? A callback to do something whenever the process's stdout or stderr print a line, or when the process exits.
function process.spawn(command, callback)
---@type integer|nil
local callback_id = nil