Update component docs

This commit is contained in:
Insality
2020-03-21 21:37:32 +03:00
parent b33efd692f
commit ca78b10794
20 changed files with 603 additions and 334 deletions

View File

@@ -1,6 +1,14 @@
--- Component to handle back key (android, backspace)
-- @module druid.back_handler
--- Component events
-- @table Events
-- @tfield druid_event on_back On back handler callback
--- Component fields
-- @table Fields
-- @tfield any params Params to click callbacks
local Event = require("druid.event")
local const = require("druid.const")
local component = require("druid.component")
@@ -10,11 +18,9 @@ local M = component.create("back_handler", { const.ON_INPUT })
--- Component init function
-- @function back_handler:init
-- @tparam table self Component instance
-- @tparam callback callback On back button
-- @tparam[opt] params Callback argument
function M.init(self, callback, params)
self.callback = callback
self.params = params
self.on_back = Event(callback)