update annotations

This commit is contained in:
2025-08-02 01:01:05 +03:00
parent 86d35a9ede
commit d23fd32e84

View File

@@ -4,46 +4,51 @@
---@alias AnyTable table<string, Any>
--- Global session module interface
---@class SessionIn
---@field params AnyTable Request parameters
---@class SessionOut
---@field result Any|string? Result payload (table or primitive)
---@field error { code: integer, message: string, data: Any }? Optional error info
---@class SessionModule
---@field in AnyTable Input context (read-only)
---@field in.params AnyTable Request parameters
---@field out AnyTable Output context (write results/errors)
---@field out.result Any|string? Result payload (table or primitive)
---@field out.error { code: integer, message: string }? Optional error info
---@field in SessionIn Input context (read-only)
---@field out SessionOut Output context (write results/errors)
--- Global log module interface
---@class LogModule
---@field info fun(msg: string) Log informational message
---@field debug fun(msg: string) Log debug message
---@field error fun(msg: string) Log error message
---@field warn fun(msg: string) Log warning message
---@field event fun(msg: string) Log event (generic)
---@field event_error fun(msg: string) Log event error
---@field event_warn fun(msg: string) Log event warning
---@field info fun(msg: string) Log informational message
---@field debug fun(msg: string) Log debug message
---@field error fun(msg: string) Log error message
---@field warn fun(msg: string) Log warning message
---@field event fun(msg: string) Log event (generic)
---@field event_error fun(msg: string) Log event error
---@field event_warn fun(msg: string) Log event warning
--- Global net module interface
---@class HttpResponse
---@field status integer HTTP status code
---@field status_text string HTTP status text
---@field body string Response body
---@field status integer HTTP status code
---@field status_text string HTTP status text
---@field body string Response body
---@field content_length integer Content length
---@field headers AnyTable Map of headers
---@field headers AnyTable Map of headers
---@class HttpModule
---@field get fun(log: boolean, url: string): HttpResponse, string? Perform GET
---@field post fun(log: boolean, url: string, content_type: string, payload: string): HttpResponse, string? Perform POST
---@field get fun(log: boolean, url: string): HttpResponse, string? Perform GET
---@field post fun(log: boolean, url: string, content_type: string, payload: string): HttpResponse, string? Perform POST
---@class NetModule
---@field http HttpModule HTTP client functions
---@field http HttpModule HTTP client functions
--- Global session variable
--- Global variables declaration
---@global
---@type SessionModule
_G.session = _G.session or {}
_G.session = session or {}
--- Global log variable
---@global
---@type LogModule
_G.log = _G.log or {}
_G.log = log or {}
--- Global net variable
---@global
---@type NetModule
_G.net = _G.net or {}
_G.net = net or {}