summaryrefslogtreecommitdiff
path: root/meta/template/basic.lua
diff options
context:
space:
mode:
Diffstat (limited to 'meta/template/basic.lua')
-rw-r--r--meta/template/basic.lua26
1 files changed, 23 insertions, 3 deletions
diff --git a/meta/template/basic.lua b/meta/template/basic.lua
index 5665dc59..b26d3959 100644
--- a/meta/template/basic.lua
+++ b/meta/template/basic.lua
@@ -55,13 +55,15 @@ _G = {}
---@version 5.1
---#DES 'getfenv'
----@param f? function
+---@param f? async fun()
---@return table
+---@nodiscard
function getfenv(f) end
---#DES 'getmetatable'
---@param object any
---@return table metatable
+---@nodiscard
function getmetatable(object) end
---#DES 'ipairs'
@@ -83,6 +85,7 @@ function ipairs(t) end
---@param chunkname? string
---@return function
---@return string error_message
+---@nodiscard
function load(func, chunkname) end
---#else
---#DES 'load>5.2'
@@ -92,6 +95,7 @@ function load(func, chunkname) end
---@param env? table
---@return function
---@return string error_message
+---@nodiscard
function load(chunk, chunkname, mode, env) end
---#end
@@ -100,6 +104,7 @@ function load(chunk, chunkname, mode, env) end
---@param filename? string
---@return function
---@return string error_message
+---@nodiscard
function loadfile(filename) end
---#else
---#DES 'loadfile'
@@ -108,6 +113,7 @@ function loadfile(filename) end
---@param env? table
---@return function
---@return string error_message
+---@nodiscard
function loadfile(filename, mode, env) end
---#end
@@ -117,6 +123,7 @@ function loadfile(filename, mode, env) end
---@param chunkname? string
---@return function
---@return string error_message
+---@nodiscard
function loadstring(text, chunkname) end
---@version 5.1
@@ -130,6 +137,7 @@ function module(name, ...) end
---@param index? K
---@return K
---@return V
+---@nodiscard
function next(table, index) end
---#DES 'pairs'
@@ -140,7 +148,11 @@ function next(table, index) end
function pairs(t) end
---#DES 'pcall'
+---#if VERSION == 5.1 and not JIT then
---@param f function
+---#else
+---@param f async fun()
+---#end
---@param arg1? any
---@return boolean success
---@return any result
@@ -154,17 +166,20 @@ function print(...) end
---@param v1 any
---@param v2 any
---@return boolean
+---@nodiscard
function rawequal(v1, v2) end
---#DES 'rawget'
---@param table table
---@param index any
---@return any
+---@nodiscard
function rawget(table, index) end
---#DES 'rawlen'
---@param v table|string
---@return integer len
+---@nodiscard
function rawlen(v) end
---#DES 'rawset'
@@ -177,11 +192,12 @@ function rawset(table, index, value) end
---#DES 'select'
---@param index integer|'"#"'
---@return any
+---@nodiscard
function select(index, ...) end
---@version 5.1
---#DES 'setfenv'
----@param f function|integer
+---@param f async fun()|integer
---@param table table
---@return function
function setfenv(f, table) end
@@ -196,11 +212,13 @@ function setmetatable(table, metatable) end
---@param e string|number
---@param base? integer
---@return number?
+---@nodiscard
function tonumber(e, base) end
---#DES 'tostring'
---@param v any
---@return string
+---@nodiscard
function tostring(v) end
---@alias type
@@ -216,6 +234,7 @@ function tostring(v) end
---#DES 'type'
---@param v any
---@return type type
+---@nodiscard
function type(v) end
---#DES '_VERSION'
@@ -244,7 +263,7 @@ function warn(message, ...) end
function xpcall(f, err) end
---#else
---#DES 'xpcall>5.2'
----@param f function
+---@param f async fun()
---@param msgh function
---@param arg1? any
---@return boolean success
@@ -258,4 +277,5 @@ function xpcall(f, msgh, arg1, ...) end
---@param list table
---@param i? integer
---@param j? integer
+---@nodiscard
function unpack(list, i, j) end