summaryrefslogtreecommitdiff
path: root/meta/hl.meta.lua
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-05-03 15:41:44 +0100
committerGitHub <noreply@github.com>2026-05-03 15:41:44 +0100
commit21fa9b2ee27227c964fdeb8090d98255edb89bec (patch)
tree2027ff3bea1c2a9ac55fd8287aaf67526bb9526b /meta/hl.meta.lua
parentc0933bffcf0394f7701ab134f6c308eaa9584bee (diff)
config/lua: fix dispatcher shapes to not be callable (#14268)
this would only lead to abuse, explicitly forbid it
Diffstat (limited to 'meta/hl.meta.lua')
-rw-r--r--meta/hl.meta.lua103
1 files changed, 53 insertions, 50 deletions
diff --git a/meta/hl.meta.lua b/meta/hl.meta.lua
index e0fd096a..a1365563 100644
--- a/meta/hl.meta.lua
+++ b/meta/hl.meta.lua
@@ -378,6 +378,9 @@
---@alias HL.CssGap integer|{top?:integer, right?:integer, bottom?:integer, left?:integer}
---@alias HL.Gradient string|{colors:string[], angle?:number}
+---@class HL.Dispatcher
+local __HL_Dispatcher = {}
+
---@class HL.Vec2
---@field x number
---@field y number
@@ -739,12 +742,12 @@ local __HL_Workspace = {}
---@class HL.API
---@field animation fun(...): any
----@field bind fun(keys: string, dispatcher: function, opts?: HL.BindOptions): HL.Keybind
+---@field bind fun(keys: string, dispatcher: HL.Dispatcher|function, opts?: HL.BindOptions): HL.Keybind
---@field config fun(config: table): nil
---@field curve fun(...): any
---@field define_submap fun(name: string, reset_or_fn: string|function, fn?: function): nil
---@field device fun(spec: HL.DeviceSpec): nil
----@field dispatch fun(...): any
+---@field dispatch fun(dispatcher: HL.Dispatcher|function): any
---@field env fun(...): any
---@field exec_cmd fun(cmd: string, rules?: table<string, string|number|boolean>): nil
---@field gesture fun(spec: HL.GestureSpec): nil
@@ -783,21 +786,21 @@ local __HL_Workspace = {}
local __HL_API = {}
---@class HL.DspNamespace
----@field dpms fun(...): any
----@field event fun(...): any
----@field exec_cmd fun(...): any
----@field exec_raw fun(...): any
----@field exit fun(...): any
----@field focus fun(...): any
----@field force_idle fun(...): any
----@field force_renderer_reload fun(...): any
----@field global fun(...): any
----@field layout fun(...): any
----@field no_op fun(...): any
----@field pass fun(...): any
----@field send_key_state fun(...): any
----@field send_shortcut fun(...): any
----@field submap fun(...): any
+---@field dpms fun(...): HL.Dispatcher
+---@field event fun(...): HL.Dispatcher
+---@field exec_cmd fun(...): HL.Dispatcher
+---@field exec_raw fun(...): HL.Dispatcher
+---@field exit fun(...): HL.Dispatcher
+---@field focus fun(...): HL.Dispatcher
+---@field force_idle fun(...): HL.Dispatcher
+---@field force_renderer_reload fun(...): HL.Dispatcher
+---@field global fun(...): HL.Dispatcher
+---@field layout fun(...): HL.Dispatcher
+---@field no_op fun(...): HL.Dispatcher
+---@field pass fun(...): HL.Dispatcher
+---@field send_key_state fun(...): HL.Dispatcher
+---@field send_shortcut fun(...): HL.Dispatcher
+---@field submap fun(...): HL.Dispatcher
---@field cursor HL.DspCursorNamespace
---@field group HL.DspGroupNamespace
---@field window HL.DspWindowNamespace
@@ -805,48 +808,48 @@ local __HL_API = {}
local __HL_DspNamespace = {}
---@class HL.DspCursorNamespace
----@field move fun(...): any
----@field move_to_corner fun(...): any
+---@field move fun(...): HL.Dispatcher
+---@field move_to_corner fun(...): HL.Dispatcher
local __HL_DspCursorNamespace = {}
---@class HL.DspGroupNamespace
----@field active fun(...): any
----@field lock fun(...): any
----@field lock_active fun(...): any
----@field move_window fun(...): any
----@field next fun(...): any
----@field prev fun(...): any
----@field toggle fun(...): any
+---@field active fun(...): HL.Dispatcher
+---@field lock fun(...): HL.Dispatcher
+---@field lock_active fun(...): HL.Dispatcher
+---@field move_window fun(...): HL.Dispatcher
+---@field next fun(...): HL.Dispatcher
+---@field prev fun(...): HL.Dispatcher
+---@field toggle fun(...): HL.Dispatcher
local __HL_DspGroupNamespace = {}
---@class HL.DspWindowNamespace
----@field alter_zorder fun(...): any
----@field bring_to_top fun(...): any
----@field center fun(...): any
----@field close fun(...): any
----@field cycle_next fun(...): any
----@field deny_from_group fun(...): any
----@field drag fun(...): any
----@field float fun(...): any
----@field fullscreen fun(...): any
----@field fullscreen_state fun(...): any
----@field kill fun(...): any
----@field move fun(...): any
----@field pin fun(...): any
----@field pseudo fun(...): any
----@field resize fun(...): any
----@field set_prop fun(...): any
----@field signal fun(...): any
----@field swap fun(...): any
----@field tag fun(...): any
----@field toggle_swallow fun(...): any
+---@field alter_zorder fun(...): HL.Dispatcher
+---@field bring_to_top fun(...): HL.Dispatcher
+---@field center fun(...): HL.Dispatcher
+---@field close fun(...): HL.Dispatcher
+---@field cycle_next fun(...): HL.Dispatcher
+---@field deny_from_group fun(...): HL.Dispatcher
+---@field drag fun(...): HL.Dispatcher
+---@field float fun(...): HL.Dispatcher
+---@field fullscreen fun(...): HL.Dispatcher
+---@field fullscreen_state fun(...): HL.Dispatcher
+---@field kill fun(...): HL.Dispatcher
+---@field move fun(...): HL.Dispatcher
+---@field pin fun(...): HL.Dispatcher
+---@field pseudo fun(...): HL.Dispatcher
+---@field resize fun(...): HL.Dispatcher
+---@field set_prop fun(...): HL.Dispatcher
+---@field signal fun(...): HL.Dispatcher
+---@field swap fun(...): HL.Dispatcher
+---@field tag fun(...): HL.Dispatcher
+---@field toggle_swallow fun(...): HL.Dispatcher
local __HL_DspWindowNamespace = {}
---@class HL.DspWorkspaceNamespace
----@field move fun(...): any
----@field rename fun(...): any
----@field swap_monitors fun(...): any
----@field toggle_special fun(...): any
+---@field move fun(...): HL.Dispatcher
+---@field rename fun(...): HL.Dispatcher
+---@field swap_monitors fun(...): HL.Dispatcher
+---@field toggle_special fun(...): HL.Dispatcher
local __HL_DspWorkspaceNamespace = {}
---@class HL.NotificationNamespace