feat: Added type alias for setup and schedule types

This commit is contained in:
2025-10-22 03:59:40 +02:00
parent 9546585440
commit 8a3143a3ea
3 changed files with 47 additions and 9 deletions

View File

@@ -13,10 +13,14 @@ local FulfillmentConfig
---@field mqtt MqttConfig
local Config
---@alias SetupFunction fun(mqtt_client: AsyncClient): Module | DeviceInterface[] | nil
---@alias Schedule table<string, fun() | fun()[]>
---@class Module
---@field setup (fun(mqtt_client: AsyncClient): Module | DeviceInterface[] | nil)?
---@field setup (SetupFunction)?
---@field devices (DeviceInterface)[]?
---@field schedule table<string, fun() | fun()[]>?
---@field schedule Schedule?
---@field [number] (Module)[]?
local Module