diff options
Diffstat (limited to 'meta/template')
-rw-r--r-- | meta/template/basic.lua | 64 | ||||
-rw-r--r-- | meta/template/package.lua | 6 |
2 files changed, 51 insertions, 19 deletions
diff --git a/meta/template/basic.lua b/meta/template/basic.lua index b8b052fe..7819fb44 100644 --- a/meta/template/basic.lua +++ b/meta/template/basic.lua @@ -1,39 +1,46 @@ ---@meta +---#DES 'arg' ---@type table arg = {} +---#DES 'assert' ---@generic T ---@param v T ---@param message any ---@return T function assert(v, message) end ----@alias cgopt54 ----|>'"collect"' ----| '"stop"' ----| '"restart"' ----| '"count"' ----| '"step"' ----| '"incremental"' ----| '"generational"' ----| '"isrunning"' - ----@param opt cgopt54? +---@alias cgopt +---|>'"collect"' # ---#DES 'cgopt.collect' +---| '"stop"' # ---#DES 'cgopt.stop' +---| '"restart"' # ---#DES 'cgopt.restart' +---| '"count"' # ---#DES 'cgopt.count' +---| '"step"' # ---#DES 'cgopt.step' +---| '"incremental"' # ---#DES 'cgopt.incremental' +---| '"generational"' # ---#DES 'cgopt.generational' +---| '"isrunning"' # ---#DES 'cgopt.isrunning' + +---#DES 'collectgarbage' +---@param opt cgopt? ---@return any function collectgarbage(opt, ...) end +---#DES 'dofile' ---@param filename string? ---@return any function dofile(filename) end +---#DES 'error' ---@param message any ---@param level integer? function error(message, level) end +---#DES '_G' ---@class _G _G = {} +---#DES 'getfenv' ---#if VERSION >= 5.2 then ---@deprecated ---#end @@ -41,10 +48,12 @@ _G = {} ---@return table function getfenv(f) end +---#DES 'getmetatable' ---@param object any ---@return table metatable function getmetatable(object) end +---#DES 'ipairs' ---@param t table ---@return fun(t: table, i: integer?):integer, any iterator ---@return table t @@ -52,10 +61,11 @@ function getmetatable(object) end function ipairs(t) end ---@alias loadmode ----| '"b"'' ----| '"t"' ----|>'"bt"' +---| '"b"' # ---#DES 'loadmode.b' +---| '"t"' # ---#DES 'loadmode.t' +---|>'"bt"' # ---#DES 'loadmode.bt' +---#DES 'load' ---@param chunk string|function ---@param chunkname string? ---@param mode loadmode? @@ -64,6 +74,7 @@ function ipairs(t) end ---@return string error_message function load(chunk, chunkname, mode, env) end +---#DES 'loadfile' ---@param filename string? ---@param mode loadmode? ---@param env table? @@ -71,6 +82,7 @@ function load(chunk, chunkname, mode, env) end ---@return string error_message function loadfile(filename, mode, env) end +---#DES 'loadstring' ---#if VERSION >= 5.2 then ---@deprecated ---#end @@ -80,18 +92,21 @@ function loadfile(filename, mode, env) end ---@return string error_message function loadstring(text, chunkname) end +---#DES 'module' ---#if VERSION >= 5.2 then ---@deprecated ---#end ---@param name string function module(name, ...) end +---#DES 'next' ---@param table table ---@param index any? ---@return any key ---@return any value function next(table, index) end +---#DES 'paris' ---@param t table ---@return function next ---@return table @@ -100,6 +115,7 @@ function pairs(t) return next end +---#DES 'pcall' ---@param f function ---@param arg1 any? ---@return boolean success @@ -107,32 +123,39 @@ end ---@return ... function pcall(f, arg1, ...) end +---#DES 'print' function print(...) end +---#DES 'rawequal' ---@param v1 any ---@param v2 any ---@return boolean function rawequal(v1, v2) end +---#DES 'rawget' ---@param table table ---@param index any ---@return any function rawget(table, index) end +---#DES 'rawlen' ---@param v table|string ---@return integer len function rawlen(v) end +---#DES 'rawset' ---@param table table ---@param index any ---@param value any ---@return table function rawset(table, index, value) end +---#DES 'select' ---@param index integer|'"#"' ---@return any function select(index, ...) end +---#DES 'setfenv' ---#if VERSION >= 5.2 then ---@deprecated ---#end @@ -141,16 +164,19 @@ function select(index, ...) end ---@return function function setfenv(f, table) end +---#DES 'setmetatable' ---@param table table ---@param metatable table ---@return table function setmetatable(table, metatable) end +---#DES 'tonumber' ---@param e string|number ---@param base integer? ---@return number? function tonumber(e, base) end +---#DES 'tostring' ---@param v any ---@return string function tostring(v) end @@ -165,10 +191,12 @@ function tostring(v) end ---| '"thread"' ---| '"userdata"' +---#DES 'type' ---@param v any ---@return type type function type(v) end +---#DES '_VERSION' ---#if VERSION == 5.1 then _VERSION = 'Lua 5.1' ---#elseif VERSION == 5.2 then @@ -179,9 +207,11 @@ _VERSION = 'Lua 5.3' _VERSION = 'Lua 5.4' ---#end +---#DES 'warn' ---@param message string function warn(message, ...) end +---#DES 'xpcall' ---@param f function ---@param msgh function ---@param arg1 any? @@ -190,11 +220,7 @@ function warn(message, ...) end ---@return ... function xpcall(f, msgh, arg1, ...) end ----@param modname string ----@return any ----@return any loaderdata -function require(modname) end - +---#DES 'unpack' ---#if VERSION >= 5.2 then ---@deprecated ---#end diff --git a/meta/template/package.lua b/meta/template/package.lua index db9ec830..b87b6410 100644 --- a/meta/template/package.lua +++ b/meta/template/package.lua @@ -1,5 +1,11 @@ ---@meta +---#DES 'require' +---@param modname string +---@return any +---@return any loaderdata +function require(modname) end + ---@class package* ---@field conifg string ---@field cpath string |