diff options
Diffstat (limited to 'meta/template')
-rw-r--r-- | meta/template/basic.lua | 8 | ||||
-rw-r--r-- | meta/template/coroutine.lua | 4 | ||||
-rw-r--r-- | meta/template/debug.lua | 24 | ||||
-rw-r--r-- | meta/template/ffi.lua | 27 | ||||
-rw-r--r-- | meta/template/jit.lua | 6 | ||||
-rw-r--r-- | meta/template/string.lua | 2 |
6 files changed, 37 insertions, 34 deletions
diff --git a/meta/template/basic.lua b/meta/template/basic.lua index 262075c7..9b6210e1 100644 --- a/meta/template/basic.lua +++ b/meta/template/basic.lua @@ -56,7 +56,7 @@ _G = {} ---@version 5.1 ---#DES 'getfenv' ----@param f? integer|async fun() +---@param f? integer|async fun(...):... ---@return table ---@nodiscard function getfenv(f) end @@ -158,7 +158,7 @@ function pairs(t) end ---#if VERSION == 5.1 and not JIT then ---@param f function ---#else ----@param f async fun() +---@param f async fun(...):... ---#end ---@param arg1? any ---@return boolean success @@ -204,7 +204,7 @@ function select(index, ...) end ---@version 5.1 ---#DES 'setfenv' ----@param f async fun()|integer +---@param f async fun(...):...|integer ---@param table table ---@return function function setfenv(f, table) end @@ -273,7 +273,7 @@ function warn(message, ...) end function xpcall(f, err) end ---#else ---#DES 'xpcall>5.2' ----@param f async fun() +---@param f async fun(...):... ---@param msgh function ---@param arg1? any ---@return boolean success diff --git a/meta/template/coroutine.lua b/meta/template/coroutine.lua index 6ff5d6de..e807f357 100644 --- a/meta/template/coroutine.lua +++ b/meta/template/coroutine.lua @@ -5,7 +5,7 @@ coroutine = {} ---#DES 'coroutine.create' ----@param f async fun() +---@param f async fun(...):... ---@return thread ---@nodiscard function coroutine.create(f) end @@ -54,7 +54,7 @@ function coroutine.running() end function coroutine.status(co) end ---#DES 'coroutine.wrap' ----@param f async fun() +---@param f async fun(...):... ---@return fun(...):... ---@nodiscard function coroutine.wrap(f) end diff --git a/meta/template/debug.lua b/meta/template/debug.lua index 7cb417b2..48ba52d9 100644 --- a/meta/template/debug.lua +++ b/meta/template/debug.lua @@ -63,7 +63,7 @@ function debug.gethook(co) end ---#DES 'debug.getinfo' ---@overload fun(f: integer|function, what?: infowhat):debuginfo ---@param thread thread ----@param f integer|async fun() +---@param f integer|async fun(...):... ---@param what? infowhat ---@return debuginfo ---@nodiscard @@ -81,9 +81,9 @@ function debug.getinfo(thread, f, what) end function debug.getlocal(thread, level, index) end ---#else ---#DES 'debug.getlocal>5.2' ----@overload fun(f: integer|async fun(), index: integer):string, any +---@overload fun(f: integer|async fun(...):..., index: integer):string, any ---@param thread thread ----@param f integer|async fun() +---@param f integer|async fun(...):... ---@param index integer ---@return string name ---@return any value @@ -103,7 +103,7 @@ function debug.getmetatable(object) end function debug.getregistry() end ---#DES 'debug.getupvalue' ----@param f async fun() +---@param f async fun(...):... ---@param up integer ---@return string name ---@return any value @@ -146,11 +146,11 @@ function debug.setfenv(object, env) end ---|+'"l"' # ---#DESTAIL 'hookmask.l' ---#DES 'debug.sethook' ----@overload fun(hook: async fun(), mask: hookmask, count?: integer) ----@overload fun(thread: thread) ----@overload fun() +---@overload fun(hook: (async fun(...):...), mask: hookmask, count?: integer) +---@overload fun(thread: thread):... +---@overload fun(...):... ---@param thread thread ----@param hook async fun() +---@param hook async fun(...):... ---@param mask hookmask ---@param count? integer function debug.sethook(thread, hook, mask, count) end @@ -172,7 +172,7 @@ function debug.setlocal(thread, level, index, value) end function debug.setmetatable(value, meta) end ---#DES 'debug.setupvalue' ----@param f async fun() +---@param f async fun(...):... ---@param up integer ---@param value any ---@return string name @@ -204,7 +204,7 @@ function debug.traceback(thread, message, level) end ---@version >5.2, JIT ---#DES 'debug.upvalueid' ----@param f async fun() +---@param f async fun(...):... ---@param n integer ---@return lightuserdata id ---@nodiscard @@ -212,9 +212,9 @@ function debug.upvalueid(f, n) end ---@version >5.2, JIT ---#DES 'debug.upvaluejoin' ----@param f1 async fun() +---@param f1 async fun(...):... ---@param n1 integer ----@param f2 async fun() +---@param f2 async fun(...):... ---@param n2 integer function debug.upvaluejoin(f1, n1, f2, n2) end diff --git a/meta/template/ffi.lua b/meta/template/ffi.lua index 0d726c1e..2ca83dd5 100644 --- a/meta/template/ffi.lua +++ b/meta/template/ffi.lua @@ -2,13 +2,17 @@ ---@meta ---@class ffi.namespace*: table +---@field [string] function ----@class ffi.cdecl*: string ---@class ffi.ctype*: userdata +---@overload fun(init?: any, ...): ffi.cdata* +---@overload fun(nelem?: integer, init?: any, ...): ffi.cdata* local ctype + +---@class ffi.cdecl*: string ---@class ffi.cdata*: userdata ----@alias ffi.ct* ffi.cdecl*|ffi.ctype*|ffi.cdata* ----@class ffi.cb*: userdata +---@alias ffi.ct* ffi.ctype*|ffi.cdecl*|ffi.cdata* +---@class ffi.cb*: ffi.cdata* local cb ---@class ffi.VLA*: userdata ---@class ffi.VLS*: userdata @@ -20,8 +24,9 @@ local cb ---@field arch string local ffi = {} ----@param def string -function ffi.cdef(def) end +---@param def string +---@param params? any +function ffi.cdef(def, params, ...) end ---@param name string ---@param global? boolean @@ -29,6 +34,7 @@ function ffi.cdef(def) end ---@nodiscard function ffi.load(name, global) end +---@overload fun(ct: ffi.ct*, init: any, ...) ---@param ct ffi.ct* ---@param nelem? integer ---@param init? any @@ -36,19 +42,16 @@ function ffi.load(name, global) end ---@nodiscard function ffi.new(ct, nelem, init, ...) end ----@param nelem? integer ----@param init? any ----@return ffi.cdata* cdata -function ffi.ctype(nelem, init, ...) end - ----@param ct ffi.ct* +---@param ct ffi.ct* +---@param params? any ---@return ffi.ctype* ctype ---@nodiscard -function ffi.typeof(ct) end +function ffi.typeof(ct, params, ...) end ---@param ct ffi.ct* ---@param init any ---@return ffi.cdata* cdata +---@nodiscard function ffi.cast(ct, init) end ---@param ct ffi.ct* diff --git a/meta/template/jit.lua b/meta/template/jit.lua index c88377ed..d1684a04 100644 --- a/meta/template/jit.lua +++ b/meta/template/jit.lua @@ -9,17 +9,17 @@ ---@field arch string jit = {} ----@overload fun() +---@overload fun(...):... ---@param func function|boolean ---@param recursive? boolean function jit.on(func, recursive) end ----@overload fun() +---@overload fun(...):... ---@param func function|boolean ---@param recursive? boolean function jit.off(func, recursive) end ----@overload fun() +---@overload fun(...):... ---@overload fun(tr: number) ---@param func function|boolean ---@param recursive? boolean diff --git a/meta/template/string.lua b/meta/template/string.lua index e8016f76..c68e1117 100644 --- a/meta/template/string.lua +++ b/meta/template/string.lua @@ -20,7 +20,7 @@ function string.byte(s, i, j) end function string.char(byte, ...) end ---#DES 'string.dump' ----@param f async fun() +---@param f async fun(...):... ---@param strip? boolean ---@return string ---@nodiscard |