diff --git a/exp_commands/module/commands/authorities.lua b/exp_commands/module/commands/authorities.lua index db82a6ce..0001b16d 100644 --- a/exp_commands/module/commands/authorities.lua +++ b/exp_commands/module/commands/authorities.lua @@ -10,7 +10,7 @@ The default permission authorities controlled by the flags: admin_only, system_o local Storage = require("modules/exp_util/storage") -local Commands = require("modules/exp_commands") --- @class Commands +local Commands = require("modules/exp_commands") --- @class (partial) Commands local add, allow, deny = Commands.add_permission_authority, Commands.status.success, Commands.status.unauthorised local authorities = {} diff --git a/exp_commands/module/commands/rcon.lua b/exp_commands/module/commands/rcon.lua index 1e1d2ec5..cedab49e 100644 --- a/exp_commands/module/commands/rcon.lua +++ b/exp_commands/module/commands/rcon.lua @@ -12,7 +12,7 @@ local ExpUtil = require("modules/exp_util") local Async = require("modules/exp_util/async") local Storage = require("modules/exp_util/storage") -local Commands = require("modules/exp_commands") --- @class Commands +local Commands = require("modules/exp_commands") --- @class (partial) Commands local rcon_env = {} --- @type table local rcon_static = {} --- @type table diff --git a/exp_commands/module/commands/types.lua b/exp_commands/module/commands/types.lua index 11511b4f..0cef9b84 100644 --- a/exp_commands/module/commands/types.lua +++ b/exp_commands/module/commands/types.lua @@ -25,7 +25,7 @@ local Commands = require("modules/exp_commands") local add, parse = Commands.add_data_type, Commands.parse_input local valid, invalid = Commands.status.success, Commands.status.invalid_input -local types = {} --- @class Commands.types +local types = {} --- @class (partial) Commands.types --- A boolean value where true is one of: yes, y, true, 1 types.boolean = diff --git a/exp_commands/module/module_exports.lua b/exp_commands/module/module_exports.lua index 93a5c626..564312b0 100644 --- a/exp_commands/module/module_exports.lua +++ b/exp_commands/module/module_exports.lua @@ -61,7 +61,7 @@ local Search = require("modules/exp_commands/search") --- @type LuaPlayer? local _print_player ---- @class Commands +--- @class (partial) Commands local Commands = { color = ExpUtil.color, format_rich_text_color = ExpUtil.format_rich_text_color, @@ -84,7 +84,7 @@ local Commands = { --- Contains the different status values a command can return Commands.status = {} ---- @class Commands.types: table +--- @class (partial) Commands.types: table --- Stores all input parsers and validators for different data types Commands.types = {} diff --git a/exp_gui/module/control.lua b/exp_gui/module/control.lua index e6c7989a..6fdd5727 100644 --- a/exp_gui/module/control.lua +++ b/exp_gui/module/control.lua @@ -16,7 +16,7 @@ Storage.register(player_elements, function(tbl) player_elements = tbl end) ---- @class Gui +--- @class (partial) Gui local Gui = { define = ExpElement.new, from_argument = ExpElement.from_argument, diff --git a/exp_gui/module/elements.lua b/exp_gui/module/elements.lua index f8df5853..368e9f4e 100644 --- a/exp_gui/module/elements.lua +++ b/exp_gui/module/elements.lua @@ -1,4 +1,4 @@ ---- @class Gui +--- @class (partial) Gui local Gui = require("modules/exp_gui") --- @class Gui.elements diff --git a/exp_gui/module/styles.lua b/exp_gui/module/styles.lua index ca04a907..b459d1c9 100644 --- a/exp_gui/module/styles.lua +++ b/exp_gui/module/styles.lua @@ -1,4 +1,4 @@ ---- @class Gui +--- @class (partial) Gui local Gui = require("modules/exp_gui") --- @class Gui.styles diff --git a/exp_gui/module/toolbar.lua b/exp_gui/module/toolbar.lua index 401d9bd6..22a478af 100644 --- a/exp_gui/module/toolbar.lua +++ b/exp_gui/module/toolbar.lua @@ -1,5 +1,5 @@ ---- @class Gui +--- @class (partial) Gui local Gui = require("modules/exp_gui") local ExpElement = require("modules/exp_gui/prototype") local mod_gui = require("mod-gui") diff --git a/exp_scenario/module/commands/_types.lua b/exp_scenario/module/commands/_types.lua index 0acfeb82..f23ff943 100644 --- a/exp_scenario/module/commands/_types.lua +++ b/exp_scenario/module/commands/_types.lua @@ -18,7 +18,7 @@ local valid, invalid = Commands.status.success, Commands.status.invalid_input local Roles = require("modules.exp_legacy.expcore.roles") local highest_role = Roles.get_player_highest_role -local types = {} --- @class Commands.types +local types = {} --- @class (partial) Commands.types --- A role defined by exp roles types.role = add("role", Commands.types.key_of(Roles.config.roles)) diff --git a/exp_scenario/module/commands/reports.lua b/exp_scenario/module/commands/reports.lua index e0f845aa..6aebce38 100644 --- a/exp_scenario/module/commands/reports.lua +++ b/exp_scenario/module/commands/reports.lua @@ -11,7 +11,10 @@ local player_has_flag = Roles.player_has_flag local Reports = require("modules.exp_legacy.modules.control.reports") --- @dep modules.control.reports ---- @type Commands.InputParser +--- @param input string +--- @param player LuaPlayer +--- @return Commands.Status +--- @return LuaPlayer | LocalisedString local function reportable_player(input, player) local success, status, result = parse_input(input, player, Commands.types.player) if not success then return status, result end diff --git a/exp_scenario/module/commands/search.lua b/exp_scenario/module/commands/search.lua index 13bc03b8..1251420a 100644 --- a/exp_scenario/module/commands/search.lua +++ b/exp_scenario/module/commands/search.lua @@ -10,7 +10,10 @@ local format_player_name = Commands.format_player_name_locale local format_number = require("util").format_number --- A player who is of a lower role than the executing player ---- @type Commands.InputParser +--- @param input string +--- @param player LuaPlayer +--- @return Commands.Status +--- @return LuaItemPrototype | LocalisedString local function parse_item(input, player) -- First Case - internal name is given -- Second Case - rich text is given @@ -146,7 +149,8 @@ Commands.new("search-online", { "exp-commands_search.description-online" }) end) --- Return the amount of an item a player has ---- @type SortFunction +--- @param data SearchResult +--- @return number local function sort_by_count(data) return data.count end diff --git a/exp_scenario/module/commands/trains.lua b/exp_scenario/module/commands/trains.lua index ee8885a5..eb3a3144 100644 --- a/exp_scenario/module/commands/trains.lua +++ b/exp_scenario/module/commands/trains.lua @@ -10,7 +10,7 @@ local format_number = require("util").format_number local commands = {} --- Set all trains to automatic ---- @class ExpCommand_Artillery.commands.artillery: ExpCommand +--- @class ExpCommand_Trains.commands.set_trains_to_automatic: ExpCommand --- @overload fun(player: LuaPlayer, surface: LuaSurface?, force: LuaForce?) commands.set_trains_to_automatic = Commands.new("set-trains-to-automatic", { "exp-commands_trains.description" }) :optional("surface", { "exp-commands_trains.arg-surface" }, Commands.types.surface) diff --git a/exp_scenario/module/control/discord_alerts.lua b/exp_scenario/module/control/discord_alerts.lua index 38978e1c..5fc894f1 100644 --- a/exp_scenario/module/control/discord_alerts.lua +++ b/exp_scenario/module/control/discord_alerts.lua @@ -39,7 +39,7 @@ local function get_player_name(event) end --- Convert a colour value into hex ---- @param color Color.0 +--- @param color Color.struct --- @return string local function to_hex(color) local hex_digits = "0123456789ABCDEF" @@ -53,7 +53,7 @@ local function to_hex(color) end --- Emit the requires json to file for the given event arguments ---- @param opts { title: string?, color: (Color.0 | string)?, description: string?, tick: number?, fields: { name: string, value: string, inline: boolean? }[] } +--- @param opts { title: string?, color: (Color.struct | string)?, description: string?, tick: number?, fields: { name: string, value: string, inline: boolean? }[] } local function emit_event(opts) local admins_online = 0 local players_online = 0 diff --git a/exp_scenario/module/control/spawn_area.lua b/exp_scenario/module/control/spawn_area.lua index e4c7213e..4810585c 100644 --- a/exp_scenario/module/control/spawn_area.lua +++ b/exp_scenario/module/control/spawn_area.lua @@ -7,7 +7,7 @@ local config = require("modules.exp_legacy.config.spawn_area") --- Apply an offset to a LuaPosition --- @param position MapPosition --- @param offset MapPosition ---- @return MapPosition.0 +--- @return MapPosition.struct local function apply_offset(position, offset) return { x = (position.x or position[1]) + (offset.x or offset[1]), diff --git a/exp_scenario/module/gui/elements.lua b/exp_scenario/module/gui/elements.lua index 66cfc99d..151bdfef 100644 --- a/exp_scenario/module/gui/elements.lua +++ b/exp_scenario/module/gui/elements.lua @@ -25,8 +25,7 @@ Elements.online_player_dropdown = Gui.define("player_dropdown") } --[[ @as any ]] --- To help with caching and avoid context changes the player list from the previous update is remembered ---- @type (string?)[] -do local _player_names = {} +do local _player_names = {} --- @type (string?)[] --- Updates the player name list after a join or leave --- @return (string?)[] function Elements.online_player_dropdown._update_player_names() diff --git a/exp_scenario/module/gui/player_bonus.lua b/exp_scenario/module/gui/player_bonus.lua index 7c5fd84b..e5c9ff8a 100644 --- a/exp_scenario/module/gui/player_bonus.lua +++ b/exp_scenario/module/gui/player_bonus.lua @@ -47,8 +47,7 @@ Elements.bonus_used = Gui.define("player_bonus/bonus_used") :element_data(0) --[[ @as any ]] --- Value is cached to save perf ---- @type table -do local _points_limit = {} +do local _points_limit = {} --- @type table --- Clear the cache for points limit --- @param player LuaPlayer function Elements.bonus_used._clear_points_limit_cache(player) diff --git a/exp_scenario/module/gui/science_production.lua b/exp_scenario/module/gui/science_production.lua index 0224a253..f3ceb24a 100644 --- a/exp_scenario/module/gui/science_production.lua +++ b/exp_scenario/module/gui/science_production.lua @@ -326,8 +326,7 @@ function Elements.science_table.refresh_row(science_table, row_data) Elements.production_label.refresh(row.used, row_data.used) end ---- @type table -do local _row_data = {} +do local _row_data = {} --- @type table --- Refresh the production tables for all online players function Elements.science_table.refresh_online() -- Refresh the row data for online forces @@ -416,8 +415,7 @@ function Elements.eta_label.refresh(eta_label) eta_label.tooltip = display_data.tooltip end ---- @type Elements.eta_label.display_data -do local _display_data = {} +do local _display_data = {} --- @type Elements.eta_label.display_data --- Refresh the eta label for all online players function Elements.eta_label.refresh_online() -- Refresh the row data for online forces @@ -477,8 +475,7 @@ local _fp_one_hour = defines.flow_precision_index.one_hour --- @field ten_minutes ExpGui_ScienceProduction._item_data --- @field one_hour ExpGui_ScienceProduction._item_data ---- @type table -do local _production_data = {} +do local _production_data = {} --- @type table --- Get the production stats for a force --- @param flow_stats any diff --git a/exp_util/module/async.lua b/exp_util/module/async.lua index 9afaa377..4056969c 100644 --- a/exp_util/module/async.lua +++ b/exp_util/module/async.lua @@ -261,7 +261,6 @@ local empty_table = setmetatable({}, { --- Default status, will raise on_function_complete --- @param ... any The return value of the async call --- @return Async.Status, any[] ---- @type Async.Status function Async.status.complete(...) if ... == nil then return Async.status.complete, empty_table @@ -272,7 +271,6 @@ end --- Will queue the function to be called again on the next tick using the new arguments --- @param ... any The arguments to call the function with --- @return Async.Status, any[] ---- @type Async.Status function Async.status.continue(...) if ... == nil then return Async.status.continue, empty_table @@ -284,7 +282,6 @@ end --- @param ticks number The number of ticks to delay for --- @param ... any The arguments to call the function with --- @return Async.Status, number, any[] ---- @type Async.Status function Async.status.delay(ticks, ...) ExpUtil.assert_argument_type(ticks, "number", 1, "ticks") assert(ticks > 0, "Ticks must be a positive number")