@@ -63,6 +63,17 @@ function debug.gethook(thread) end
6363--- @field ntransfer integer
6464--- @field activelines table
6565
66+ --- @alias debuglib.InfoWhat
67+ --- |+ " n" # `name` 和 `namewhat`
68+ --- |+ " S" # `source`,`short_src`,`linedefined`,`lalinedefined`,和 `what`
69+ --- |+ " l" # `currentline`
70+ --- |+ " t" # `istailcall`
71+ --- |+ " u" # `nups`、`nparams` 和 `isvararg`
72+ --- |+ " f" # `func`
73+ --- |+ " r" # `ftransfer` 和 `ntransfer`
74+ --- |+ " L" # `activelines`
75+ --- | string
76+
6677---
6778--- Returns a table with information about a function. You can give the
6879--- function directly, or you can give a number as the value of `f`,
@@ -83,10 +94,10 @@ function debug.gethook(thread) end
8394--- with a name for the current function, if a reasonable name can be found,
8495--- and the expression `debug.getinfo(print)` returns a table with all available
8596--- information about the `print` function.
86- --- @overload fun ( f : int | function , what ?: string ): debuglib.DebugInfo
97+ --- @overload fun ( f : int | function , what ?: debuglib.InfoWhat ): debuglib.DebugInfo
8798--- @param thread thread
88- --- @param f function
89- --- @param what ? string
99+ --- @param f integer | function
100+ --- @param what ? debuglib.InfoWhat
90101--- @return debuglib.DebugInfo
91102--- @nodiscard
92103function debug .getinfo (thread , f , what ) end
@@ -146,10 +157,10 @@ function debug.getlocal(thread, lvl, index) end
146157---
147158--- Returns the metatable of the given `value` or **nil** if it does not have
148159--- a metatable.
149- --- @param value table
160+ --- @param object any
150161--- @return table ?
151162--- @nodiscard
152- function debug .getmetatable (value ) end
163+ function debug .getmetatable (object ) end
153164
154165---
155166--- Returns the registry table.
@@ -164,7 +175,7 @@ function debug.getregistry() end
164175---
165176--- Variable names starting with '(' (open parenthesis) represent variables with
166177--- no known names (variables from chunks saved without debug information).
167- --- @param f async fun ( ... ): any...
178+ --- @param f function
168179--- @param up integer
169180--- @return string name
170181--- @return any value
@@ -176,6 +187,7 @@ function debug.getupvalue(f, up) end
176187--- **false** if the userdata does not have that value.
177188--- @param u userdata
178189--- @param n integer
190+ --- @return any
179191--- @return boolean
180192function debug .getuservalue (u , n ) end
181193
@@ -304,9 +316,10 @@ function debug.traceback(thread, message, level) end
304316--- access a same external local variable) will return identical ids for those
305317--- upvalue indices.
306318--- @version > 5.2 , JIT
307- --- @param f fun (): integer
319+ --- @param f function
308320--- @param n integer
309- --- @return integer
321+ --- @return lightuserdata id
322+ --- @nodiscard
310323function debug .upvalueid (f , n ) end
311324
312325
0 commit comments