2023-06-26 21:19:02 -05:00
|
|
|
-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
-- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
-- file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
--
|
|
|
|
-- SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-06-26 21:05:29 -05:00
|
|
|
---@meta _
|
|
|
|
|
|
|
|
---@class _Msg
|
2023-07-11 11:59:38 -05:00
|
|
|
---@field SetKeybind { key: Keys, modifiers: Modifier[], callback_id: integer }
|
2023-06-26 21:05:29 -05:00
|
|
|
---@field SetMousebind { button: integer }
|
2023-07-02 10:26:07 -05:00
|
|
|
--Windows
|
2023-07-18 15:12:23 -05:00
|
|
|
---@field CloseWindow { window_id: integer }
|
|
|
|
---@field ToggleFloating { window_id: integer }
|
2023-07-18 21:10:43 -05:00
|
|
|
---@field SetWindowSize { window_id: integer, width: integer?, height: integer? }
|
2023-07-02 10:26:07 -05:00
|
|
|
---@field MoveWindowToTag { window_id: integer, tag_id: string }
|
|
|
|
---@field ToggleTagOnWindow { window_id: integer, tag_id: string }
|
|
|
|
--
|
2023-06-26 21:05:29 -05:00
|
|
|
---@field Spawn { command: string[], callback_id: integer? }
|
|
|
|
---@field Request Request
|
2023-06-30 21:34:07 -05:00
|
|
|
--Tags
|
2023-07-11 16:10:31 -05:00
|
|
|
---@field ToggleTag { output_name: string, tag_name: string }
|
|
|
|
---@field SwitchToTag { output_name: string, tag_name: string }
|
2023-07-18 15:12:23 -05:00
|
|
|
---@field AddTags { output_name: string, tag_names: string[] }
|
|
|
|
---@field RemoveTags { output_name: string, tag_names: string[] }
|
2023-07-12 18:50:41 -05:00
|
|
|
---@field SetLayout { output_name: string, tag_name: string, layout: Layout }
|
2023-07-11 11:59:38 -05:00
|
|
|
--Outputs
|
|
|
|
---@field ConnectForAllOutputs { callback_id: integer }
|
2023-06-26 21:05:29 -05:00
|
|
|
|
|
|
|
---@alias Msg _Msg | "Quit"
|
|
|
|
|
2023-07-11 11:59:38 -05:00
|
|
|
--------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
---@class _Request
|
|
|
|
--Windows
|
2023-07-19 20:11:15 -05:00
|
|
|
---@field GetWindowProps { window_id: WindowId }
|
2023-07-11 11:59:38 -05:00
|
|
|
--Outputs
|
2023-07-19 18:55:22 -05:00
|
|
|
---@field GetOutputProps { output_name: string }
|
|
|
|
--Tags
|
2023-07-18 15:12:23 -05:00
|
|
|
---@field GetTagsByOutput { output_name: string }
|
2023-07-19 18:55:22 -05:00
|
|
|
---@field GetTagsByName { tag_name: string }
|
|
|
|
---@field GetTagOutput { tag_id: TagId }
|
2023-07-18 15:12:23 -05:00
|
|
|
---@field GetTagActive { tag_id: TagId }
|
|
|
|
---@field GetTagName { tag_id: TagId }
|
2023-07-11 11:59:38 -05:00
|
|
|
|
2023-07-19 20:11:15 -05:00
|
|
|
---@alias Request _Request | "GetWindows" | "GetOutputs"
|
2023-06-26 21:05:29 -05:00
|
|
|
|
|
|
|
---@class IncomingMsg
|
|
|
|
---@field CallCallback { callback_id: integer, args: Args }
|
2023-07-11 11:59:38 -05:00
|
|
|
---@field RequestResponse { response: RequestResponse }
|
2023-06-26 21:05:29 -05:00
|
|
|
|
|
|
|
---@class Args
|
|
|
|
---@field Spawn { stdout: string?, stderr: string?, exit_code: integer?, exit_msg: string? }
|
2023-07-11 11:59:38 -05:00
|
|
|
---@field ConnectForAllOutputs { output_name: string }
|
2023-06-26 21:05:29 -05:00
|
|
|
|
2023-07-18 15:12:23 -05:00
|
|
|
---@alias WindowId integer
|
|
|
|
---@alias TagId integer
|
|
|
|
---@alias OutputName string
|
|
|
|
|
2023-06-26 21:05:29 -05:00
|
|
|
---@class RequestResponse
|
2023-07-18 21:10:43 -05:00
|
|
|
--Windows
|
2023-07-18 15:12:23 -05:00
|
|
|
---@field Window { window_id: WindowId|nil }
|
|
|
|
---@field Windows { window_ids: WindowId[] }
|
2023-07-19 20:11:15 -05:00
|
|
|
---@field WindowProps { size: integer[]?, loc: integer[]?, class: string?, title: string?, floating: boolean?, focused: boolean? }
|
2023-07-18 21:10:43 -05:00
|
|
|
--Outputs
|
|
|
|
---@field Output { output_name: OutputName? }
|
2023-07-18 15:12:23 -05:00
|
|
|
---@field Outputs { output_names: OutputName[] }
|
2023-07-19 18:55:22 -05:00
|
|
|
---@field OutputProps { make: string?, model: string?, loc: integer[]?, res: integer[]?, refresh_rate: integer?, physical_size: integer[]?, focused: boolean? }
|
2023-07-18 21:10:43 -05:00
|
|
|
--Tags
|
2023-07-18 15:12:23 -05:00
|
|
|
---@field Tags { tag_ids: TagId[] }
|
2023-07-19 18:55:22 -05:00
|
|
|
---@field TagActive { active: boolean? }
|
|
|
|
---@field TagName { name: string? }
|