feat: enhance type definitions and add new classes for various components in code editor and notification center

This commit is contained in:
2025-12-30 10:21:46 +00:00
parent bf1401fe34
commit dc0336bb9e
10 changed files with 174 additions and 0 deletions
+27
View File
@@ -1,6 +1,28 @@
-- Lua Editor utilities
---@class LuaEditor
local M = {}
---@class EditorOptions
---@field read_only? boolean
---@class UIComponent
---@field type string
---@field props? table
---@field children? table
---@class ValidationResult
---@field valid boolean
---@field errors table
---@class SandboxAction
---@field action string
---@field sandbox boolean
---@field context table
---@param value? string
---@param options? EditorOptions
---@return UIComponent
function M.render(value, options)
return {
type = "code_editor",
@@ -14,6 +36,8 @@ function M.render(value, options)
}
end
---@param lua_code string
---@return ValidationResult
function M.validate(lua_code)
-- Lua syntax validation placeholder
return {
@@ -22,6 +46,9 @@ function M.validate(lua_code)
}
end
---@param lua_code string
---@param context? table
---@return SandboxAction
function M.run_sandbox(lua_code, context)
return {
action = "execute",