$ luarocks install simpleclassLuaSimpleClass is a modern-style, purely Lua-based OOP library with concise syntax and deep compatibility with the static analysis features of `lua-language-server`.
- Concise DSL syntax: class “Cls” : extends “Base” : impl(Iface) { ... }
- Automatically generates static type annotations; when used with simpleclass.d.lua and the LuaLS plugin, it provides full type inference
- Supports single inheritance, interfaces, getter and setter properties, `super` calls, type checking, and more
- Pure Lua implementation, compatible with Lua 5.1+ and LuaJIT, with zero runtime dependencies
After installation, if you need static analysis support, please refer to the “类型推导” section in the README.
Versions
Dependencies
lua >= 5.1