This commit is contained in:
Insality
2025-03-14 01:06:20 +02:00
parent 1aa96d8dbc
commit 11aeb377c2
5 changed files with 242 additions and 31 deletions

View File

@@ -5,27 +5,6 @@ local druid_instance = require("druid.system.druid_instance")
local default_style = require("druid.styles.default.style")
--- Use empty function to save a bit of memory
local EMPTY_FUNCTION = function(_, message, context) end
---@type druid.logger
local empty_logger = {
trace = EMPTY_FUNCTION,
debug = EMPTY_FUNCTION,
info = EMPTY_FUNCTION,
warn = EMPTY_FUNCTION,
error = EMPTY_FUNCTION,
}
---@type druid.logger
local logger = {
trace = EMPTY_FUNCTION,
debug = EMPTY_FUNCTION,
info = EMPTY_FUNCTION,
warn = EMPTY_FUNCTION,
error = EMPTY_FUNCTION,
}
---Entry point for Druid UI Framework.
---Create a new Druid instance and adjust the Druid settings here.
@@ -45,13 +24,6 @@ function M.new(context, style)
end
---Set the logger for the Druid instance.
---@param logger_instance druid.logger The logger
function M:set_logger(logger_instance)
self.logger = logger_instance or empty_logger
end
---Register a new external Druid component.
---Register component just makes the druid:new_{name} function.
---For example, if you register a component called "my_component", you can create it using druid:new_my_component(...).