Skip to content

disco0/mpv-types-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpv-types-lua

Lua type declarations for mpv scripting.

FEATURES

  • Global typed mp object

  • 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

INSTALLATION

Visual Studio Code

Extension Configurations

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

Intellij

Required Extensions

Installation

Create a new Lua Zip Library and attach the the @types folder.

TODO

About

Lua type declarations for mpv scripting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages