-
Notifications
You must be signed in to change notification settings - Fork 0
/
trigger.lua
135 lines (104 loc) · 2.56 KB
/
trigger.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---@alias trigger.callback fun(matches: string[], line: Line)
---@class trigger
trigger = {}
---@class trigger.Options
---@field gag boolean
---@field raw boolean
---@field prompt boolean
---@field count number | nil
---@field enabled boolean
local Options = {}
---@param regex string
---@param options trigger.Options
---@param callback trigger.callback
---@return trigger.Trigger | nil
function trigger.add(regex, options, callback)
end
---@param id number
---@return trigger.Trigger | nil
function trigger.get(id)
end
---@param id number
---@return trigger.TriggerGroup
function trigger.get_group(id)
end
---@param id number
function trigger.remove(id)
end
function trigger.clear()
end
---@return trigger.TriggerGroup
function trigger.add_group()
end
---@class trigger.Trigger
---@field regex Regex
---@field callback trigger.callback
---@field gag boolean
---@field raw boolean
---@field prompt boolean
---@field count number | nil
---@field enabled boolean
---@field id number Do not change!
trigger.Trigger = {}
---@param regex string
---@param options trigger.Options
---@param callback trigger.callback
---@return trigger.Trigger
function trigger.Trigger.new(regex, options, callback)
end
---@param object table
---@return boolean
function trigger.Trigger.is_trigger(object)
end
function trigger.Trigger:enable()
end
function trigger.Trigger:disable()
end
---@param enabled boolean
function trigger.Trigger:set_enabled(enabled)
end
---@return boolean
function trigger.Trigger:is_enabled()
end
---@param line Line
function trigger.Trigger:check_line(line)
end
---@class trigger.TriggerGroup
---@field id number
---@field triggers trigger.Trigger[]
trigger.TriggerGroup = {}
---@param id number
---@return trigger.TriggerGroup
function trigger.TriggerGroup.new(id)
end
---@param regex_or_trigger string | trigger.Trigger
---@param options trigger.Options | nil
---@param callback trigger.callback | nil
---@return trigger.Trigger
function trigger.TriggerGroup:add(regex_or_trigger, options, callback)
end
---@param id number
---@return trigger.Trigger
function trigger.TriggerGroup:get(id)
end
---@return trigger.Trigger[]
function trigger.TriggerGroup:get_triggers()
end
---@param id number
function trigger.TriggerGroup:remove(id)
end
function trigger.TriggerGroup:clear()
end
function trigger.TriggerGroup:enable()
end
function trigger.TriggerGroup:disable()
end
---@param enabled boolean
function trigger.TriggerGroup:set_enabled(enabled)
end
---@return boolean
function trigger.TriggerGroup:is_enabled()
end
---@param line Line
function trigger.TriggerGroup:check_line(line)
end