Update annotations: back_handler and blocker

This commit is contained in:
Insality
2020-10-11 23:25:23 +03:00
parent 62cca31b28
commit 5ff6b69dd4
18 changed files with 57 additions and 34 deletions

View File

@@ -1,13 +1,14 @@
--- Component to handle back key (android, backspace)
-- @module druid.back_handler
-- @module BackHandler
-- @within BaseComponent
-- @alias druid.back_handler
--- Component events
-- @table Events
-- @tfield druid_event on_back On back handler callback
--- On back handler callback(self, params)
-- @tfield druid_event on_back
--- Params to back callback
-- @tfield any params
--- Component fields
-- @table Fields
-- @tfield any params Params to click callbacks
local Event = require("druid.event")
local const = require("druid.const")
@@ -17,21 +18,20 @@ local BackHandler = component.create("back_handler", { const.ON_INPUT })
--- Component init function
-- @function back_handler:init
-- @tparam BackHandler self
-- @tparam callback callback On back button
-- @tparam[opt] params Callback argument
function BackHandler:init(callback, params)
-- @tparam[opt] any params Callback argument
function BackHandler.init(self, callback, params)
self.params = params
self.on_back = Event(callback)
end
--- Input handler for component
-- @function back_handler:on_input
-- @tparam BackHandler self
-- @tparam string action_id on_input action id
-- @tparam table action on_input action
function BackHandler:on_input(action_id, action)
function BackHandler.on_input(self, action_id, action)
if not action[const.RELEASED] then
return false
end