mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-04 02:34:52 +00:00
feat: enhance type definitions and add new classes for various components in code editor and notification center
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user