[LuaDoc] Fix several minor errors in the specification of API

This commit is contained in:
Celtic Minstrel 2024-02-04 13:38:29 -05:00
parent 2aa7d9357d
commit 5a51a309a4
4 changed files with 8 additions and 3 deletions

View file

@ -11,7 +11,7 @@ local _ = wesnoth.textdomain "wesnoth"
---@param elem_name string the full name of the element being deprecated (including the module), to be shown in the deprecation message
---@param replacement_name string the name of the element that will replace it (including the module), to be shown in the deprecation message
--- Can be nil if there is not replacement, though this should be an unlikely situation
---@param level '1'|'2'|'3'|'4' deprecation level (1-4)
---@param level 1|2|3|4 deprecation level (1-4)
---@param version string|nil the version at which the element may be removed (level 2 or 3 only)
--- Set to nil if deprecation level is 1 or 4
--- Will be shown in the deprecation message

View file

@ -90,7 +90,7 @@ end
---Randomize the order of an array
---@param t any[]
---@param random_func fun(a:number,b:number):number
---@param random_func? fun(a:number,b:number):number
function mathx.shuffle(t, random_func)
random_func = random_func or mathx.random
-- since tables are passed by reference, this is an in-place shuffle

View file

@ -62,6 +62,7 @@ end
---@param name? string Tag to search for.
---@param filter WML A WML filter to match against
---@return WML? #The WML table of the child tag
---@return integer? #The overall index of the child tag
function wml.find_child(cfg, name, filter)
ensure_config(cfg)
if filter == nil then

View file

@ -10,6 +10,10 @@ function wesnoth.kernel_type() end
function wesnoth.dofile(path, ...) end
---@class tstring : string
tstring = {}
tstring.format = string.format
tstring.vformat = stringx.vformat
---Constructs a textdomain, which can be called to create translatable strings.
---@param domain string The textdomain name
@ -119,7 +123,7 @@ function wesnoth.ms_since_init() end
---Output a deprecated message
---@param element_name string The name of the element being deprecated
---@param level '1'|'2'|'3'|'4' The deprecation level
---@param level 1|2|3|4 The deprecation level
---@param version string|nil The earliest version the element may be removed in
---@param detail_message string An additional message describing the deprecation and usually indicating a replacement
function wesnoth.deprecated_message(element_name, level, version, detail_message) end