From ef461f52607f2cb1e683b40e5d65f1eddd93a1e6 Mon Sep 17 00:00:00 2001 From: Richard Ward Date: Tue, 30 Dec 2025 12:36:03 +0000 Subject: [PATCH] update: packages,lua,webchat (7 files) --- packages/forum_forge/seed/scripts/flag_post.lua | 4 ++++ packages/forum_forge/seed/scripts/moderation.lua | 2 ++ packages/irc_webchat/seed/scripts/format_time.lua | 2 +- packages/irc_webchat/seed/scripts/handle_command.lua | 2 +- packages/irc_webchat/seed/scripts/user_join.lua | 2 +- packages/notification_center/seed/scripts/summary.lua | 6 ++++++ packages/notification_center/seed/scripts/toast.lua | 5 +++++ 7 files changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/forum_forge/seed/scripts/flag_post.lua b/packages/forum_forge/seed/scripts/flag_post.lua index bcebac2aa..0ef1e5e7a 100644 --- a/packages/forum_forge/seed/scripts/flag_post.lua +++ b/packages/forum_forge/seed/scripts/flag_post.lua @@ -1,3 +1,7 @@ +--- @class FlagResult Result of flagging a post +--- @field flagged boolean Whether the post was flagged +--- @field reasons string[] List of reasons for flagging + --- Flag a post for moderation --- Checks content length and banned terms ---@param post { content?: string } Post to check diff --git a/packages/forum_forge/seed/scripts/moderation.lua b/packages/forum_forge/seed/scripts/moderation.lua index c1fc84b6a..3087fb539 100644 --- a/packages/forum_forge/seed/scripts/moderation.lua +++ b/packages/forum_forge/seed/scripts/moderation.lua @@ -1,6 +1,8 @@ --- Moderation facade for forum_forge --- Re-exports single-function modules for backward compatibility +---@class ModerationModule Moderation functions module +---@field flag_post fun(post: { content?: string }): FlagResult Flag a post for moderation local M = {} M.flag_post = require("flag_post") diff --git a/packages/irc_webchat/seed/scripts/format_time.lua b/packages/irc_webchat/seed/scripts/format_time.lua index 9875b5692..53cdfd48d 100644 --- a/packages/irc_webchat/seed/scripts/format_time.lua +++ b/packages/irc_webchat/seed/scripts/format_time.lua @@ -1,6 +1,6 @@ ---@param timestamp number Unix timestamp in milliseconds ---@return string Formatted time string in HH:MM AM/PM format -function formatTime(timestamp) +local function formatTime(timestamp) local date = os.date("*t", timestamp / 1000) local hour = date.hour local ampm = "AM" diff --git a/packages/irc_webchat/seed/scripts/handle_command.lua b/packages/irc_webchat/seed/scripts/handle_command.lua index fb0a82666..d8663674a 100644 --- a/packages/irc_webchat/seed/scripts/handle_command.lua +++ b/packages/irc_webchat/seed/scripts/handle_command.lua @@ -12,7 +12,7 @@ ---@param username string Current username ---@param onlineUsers string[] List of online usernames ---@return IRCMessage Response message object -function handleCommand(command, channelId, username, onlineUsers) +local function handleCommand(command, channelId, username, onlineUsers) local parts = {} for part in string.gmatch(command, "%S+") do table.insert(parts, part) diff --git a/packages/irc_webchat/seed/scripts/user_join.lua b/packages/irc_webchat/seed/scripts/user_join.lua index 77ffe8a93..04282eb60 100644 --- a/packages/irc_webchat/seed/scripts/user_join.lua +++ b/packages/irc_webchat/seed/scripts/user_join.lua @@ -11,7 +11,7 @@ ---@param username string Username of the user joining ---@param userId string User identifier of the user joining ---@return JoinMessage Join notification message object -function userJoin(channelId, username, userId) +local function userJoin(channelId, username, userId) local joinMsg = { id = "msg_" .. tostring(os.time()) .. "_" .. math.random(1000, 9999), channelId = channelId, diff --git a/packages/notification_center/seed/scripts/summary.lua b/packages/notification_center/seed/scripts/summary.lua index 12235a910..62eb7d433 100644 --- a/packages/notification_center/seed/scripts/summary.lua +++ b/packages/notification_center/seed/scripts/summary.lua @@ -1,6 +1,12 @@ --- Notification summary facade --- Re-exports single-function modules for backward compatibility +---@class SummaryModule Notification summary functions +---@field calculateTotal fun(notifications: Notification[]): number Calculate total count +---@field getSeverityClass fun(severity: string): string Get CSS class for severity +---@field prepareSummary fun(notifications: Notification[]): SummaryData Prepare summary data +---@field severityClasses table Severity to CSS class mapping +---@field defaultItems Notification[] Default notification items local M = {} M.calculateTotal = require("calculate_total") diff --git a/packages/notification_center/seed/scripts/toast.lua b/packages/notification_center/seed/scripts/toast.lua index ed2c832e3..17b2752ae 100644 --- a/packages/notification_center/seed/scripts/toast.lua +++ b/packages/notification_center/seed/scripts/toast.lua @@ -1,6 +1,11 @@ --- Toast notification facade --- Re-exports single-function modules for backward compatibility +---@class ToastModule Toast notification functions +---@field success fun(message: string, options?: ToastOptions): ToastConfig Create success toast +---@field error fun(message: string, options?: ToastOptions): ToastConfig Create error toast +---@field warning fun(message: string, options?: ToastOptions): ToastConfig Create warning toast +---@field info fun(message: string, options?: ToastOptions): ToastConfig Create info toast local M = {} M.success = require("toast_success")