-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keybinds.lua: add type annotations for all functions
The typing for these keybinds is a bit of a mess, and really should be simplified, but that is something that can be done after this PR is merged. The static typing done here will enable a refactor in the future.
- Loading branch information
1 parent
e70a3a3
commit 4a24709
Showing
2 changed files
with
94 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
---@meta KeybindDefs | ||
---@meta _ | ||
|
||
---@class Keybind | ||
---@class KeybindFlags | ||
---@field repeatable boolean? | ||
---@field scalable boolean? | ||
---@field complex boolean? | ||
|
||
|
||
---@class KeybindCommandTable | ||
|
||
|
||
---@class Keybind | ||
---@field key string | ||
---@field command KeybindCommand | ||
---@field api_version string? | ||
--- | ||
---@field name string? | ||
---@field condition string? | ||
---@field flags KeybindFlags? | ||
---@field filter ('file'|'dir')? | ||
---@field parser string? | ||
---@field multiselect boolean? | ||
---@field multi-type ('repeat'|'concat')? | ||
---@field delay number? | ||
---@field concat-string string? | ||
---@field passthrough boolean? | ||
--- | ||
---@field prev_key Keybind? The keybind that was previously set to the same key. | ||
---@field codes Set<string>? Any substituation codes used by the command table. | ||
---@field condition_codes Set<string>? Any substitution codes used by the condition string. | ||
---@field addon boolean? Whether the keybind was created by an addon. | ||
|
||
|
||
---@alias KeybindCommand function|KeybindCommandTable[] | ||
---@alias KeybindTuple [string,string,table|function,KeybindFlags?] | ||
---@alias KeybindList (Keybind|KeybindTuple)[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters