-
Notifications
You must be signed in to change notification settings - Fork 12
/
notifier.lua
35 lines (28 loc) · 1.31 KB
/
notifier.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---The abstract base class for notifiers. At a minimum each concrete implementation needs to provide
---the methods `self:tick()`, `self:start()`, `self:done()`, and `self:stop()`.
---Optionally they can also provide `self:hide()` and `self:show()` methods.
---See `pomo.DefaultNotifier` for an example.
---@class pomo.Notifier
local Notifier = {}
---Called periodically (e.g. every second) while the timer is active.
---@param time_left number
Notifier.tick = function(self, time_left) ---@diagnostic disable-line: unused-local
error "not implemented"
end
---Called when the timer starts.
Notifier.start = function(self) ---@diagnostic disable-line: unused-local
error "not implemented"
end
---Called when the timer finishes.
Notifier.done = function(self) ---@diagnostic disable-line: unused-local
error "not implemented"
end
---Called when the timer is stopped before finishing.
Notifier.stop = function(self) ---@diagnostic disable-line: unused-local
error "not implemented"
end
---Called to hide the timer's progress. Should have the opposite affect as `show()`.
Notifier.hide = function(self) end ---@diagnostic disable-line: unused-local
---Called to show the timer's progress. Should have the opposite affect as `hide()`.
Notifier.show = function(self) end ---@diagnostic disable-line: unused-local
return Notifier