diff options
| author | ryukamish <[email protected]> | 2026-04-11 16:06:45 +0530 |
|---|---|---|
| committer | ryukamish <[email protected]> | 2026-04-11 16:06:45 +0530 |
| commit | 607891801fbf2051a0c9062d15a445dd238c1e1b (patch) | |
| tree | 33b8cfba2355b498addea05e385b06d46cced30f /mpv/scripts/file-browser/modules/defs/parser.lua | |
| parent | 6fbde2906e3bb2d4d1df23f6374d8a6a0aef870f (diff) | |
add: mako and mpv configs
Diffstat (limited to 'mpv/scripts/file-browser/modules/defs/parser.lua')
| -rw-r--r-- | mpv/scripts/file-browser/modules/defs/parser.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mpv/scripts/file-browser/modules/defs/parser.lua b/mpv/scripts/file-browser/modules/defs/parser.lua new file mode 100644 index 0000000..d196bf2 --- /dev/null +++ b/mpv/scripts/file-browser/modules/defs/parser.lua @@ -0,0 +1,41 @@ +---@meta _ + +---A ParserConfig object returned by addons +---@class (partial) ParserConfig: ParserAPI +---@field priority number? +---@field api_version string The minimum API version the string requires. +---@field version string? The minimum API version the string requires. @deprecated. +--- +---@field can_parse (async fun(self: Parser, directory: string, parse_state: ParseState): boolean)? +---@field parse (async fun(self: Parser, directory: string, parse_state: ParseState): List?, Opts?)? +---@field setup fun(self: Parser)? +--- +---@field name string? +---@field keybind_name string? +---@field keybinds KeybindList? + + +---The parser object used by file-browser once the parsers have been loaded and initialised. +---@class Parser: ParserAPI, ParserConfig +---@field name string +---@field priority number +---@field api_version string +---@field can_parse async fun(self: Parser, directory: string, parse_state: ParseState): boolean +---@field parse async fun(self: Parser, directory: string, parse_state: ParseState): List?, Opts? + + +---@alias ParseStateSource 'browser'|'loadlist'|'script-message'|'addon'|string +---@alias ParseProperties table<string,any> + +---The Parse State object passed to the can_parse and parse methods +---@class ParseStateFields +---@field source ParseStateSource +---@field directory string +---@field already_deferred boolean? +---@field properties ParseProperties + +---@class ParseState: ParseStateFields, ParseStateAPI + +---@class ParseStateTemplate +---@field source ParseStateSource? +---@field properties ParseProperties? |
