Lua type declarations for mpv scripting.
-
Global typed
mpobject -
Loading built in submodules with type information via
require- e.g.require('mp.msg') -
Function signatures for all built in functions
-
Documentation comments from mpv man pages
VSCode does not support Emmylua style type declarations out of the box, and requires one of the following extensions.
Lua - sumneko.lua - Marketplace - Github
/* mpv builds with 5.1, 5.2, or luajit */
"Lua.runtime.version": "Lua 5.1",
/* Declarations can also be placed in workspace subdirectory */
"Lua.workspace.library": {
".../path/to/mpv-lua-types/@types/": true
},
/* Recommended */
"Lua.completion.enable": true,
"Lua.signatureHelp.enable": true,
"Lua.hover.enable": true,EmmyLua - tangzx.emmylua - Marketplace - GitHub
/* Declarations can also be placed in workspace subdirectory */
"emmylua.source.roots": {
".../path/to/mpv-lua-types/@types/": true
},LuaPanda - stuartwang.luapanda - Marketplace - GitHub
/* Declarations can also be placed in workspace subdirectory */
"luaide-lite.apiFolders": [
".../path/to/mpv-types-lua/@types"
],
"luaide-lite.core": "emmy",luaide-lite - wellshsu.luaide-lite - Marketplace - GitHub
- Declaration files must be in subdirectory of workspace.
"lua_analyzer.codeLinting.luaVersion": "5.1",
"lua_analyzer.codeLinting.enable": true- Emmylua - Plugin Homepage - GitHub
Create a new Lua Zip Library and attach the the @types folder.
-
Create lua library file
-
Write documentation for
assdrawsubmodule
