update: packages,lua,webchat (7 files)

This commit is contained in:
Richard Ward
2025-12-30 12:36:03 +00:00
parent e6c9eef1b6
commit ef461f5260
7 changed files with 20 additions and 3 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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"

View File

@@ -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)

View File

@@ -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,

View File

@@ -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<string, string> Severity to CSS class mapping
---@field defaultItems Notification[] Default notification items
local M = {}
M.calculateTotal = require("calculate_total")

View File

@@ -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")