Update API docs

This commit is contained in:
Ottatop 2023-09-09 20:52:52 -05:00
parent 465e66067d
commit 9d73151ca9
3 changed files with 18 additions and 0 deletions

View file

@ -1,7 +1,11 @@
-- SPDX-License-Identifier: GPL-3.0-or-later
---Input management.
---
---This module provides utilities to set keybinds.
---@class InputModule
local input_module = {
--- A table with every key provided by xkbcommon.
keys = require("keys"),
}

View file

@ -2,6 +2,9 @@
---@diagnostic disable: redefined-local
---Process management.
---
---This module provides utilities to spawn processes and capture their output.
---@class ProcessModule
local process_module = {}

View file

@ -468,6 +468,17 @@ end
---Given an array of layouts, this will create two functions; one will cycle forward the layout
---for the provided tag, and one will cycle backward.
---
--- ### Example
---```lua
---local layout_cycler = tag.layout_cycler({ "Dwindle", "Spiral", "MasterStack" })
---
---layout_cycler.next() -- Go to the next layout on the first tag of the focused output
---layout_cycler.prev() -- Go to the previous layout on the first tag of the focused output
---
---layout_cycler.next("DP-1") -- Do the above but on "DP-1" instead
---layout_cycler.prev(output.get_by_name("DP-1")) -- With an output object
---```
---@param layouts Layout[] The available layouts.
---@return LayoutCycler layout_cycler A table with the functions `next` and `prev`, which will cycle layouts for the given tag.
function tag_module.layout_cycler(layouts)