aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src/module.d.tl
diff options
context:
space:
mode:
Diffstat (limited to 'teal-src/module.d.tl')
-rw-r--r--teal-src/module.d.tl23
1 files changed, 20 insertions, 3 deletions
diff --git a/teal-src/module.d.tl b/teal-src/module.d.tl
index 67b2437c..22038bc4 100644
--- a/teal-src/module.d.tl
+++ b/teal-src/module.d.tl
@@ -1,4 +1,4 @@
-local st = require"util.stanza"
+local st = require "prosody.util.stanza"
global record moduleapi
get_name : function (moduleapi) : string
@@ -34,8 +34,11 @@ global record moduleapi
get_option : config_getter<any>
get_option_scalar : config_getter<nil | boolean | number | string>
get_option_string : config_getter<string>
- get_option_number : config_getter<number>
+ get_option_number : function (moduleapi, string, number, number, number) : number
+ get_option_integer : function (moduleapi, string, integer, integer, integer) : integer
get_option_boolean : config_getter<boolean>
+ get_option_enum : function<A> (moduleapi, string, ... : A) : A
+ get_option_period : function (moduleapi, string|number, string|number, string|number, string|number) : number
record util_array
-- TODO import def
{ any }
@@ -62,7 +65,12 @@ global record moduleapi
send_iq : function (moduleapi, st.stanza_t, util_session, number)
broadcast : function (moduleapi, { string }, st.stanza_t, function)
type timer_callback = function (number, ... : any) : number
- add_timer : function (moduleapi, number, timer_callback, ... : any)
+ record timer_wrapper
+ stop : function (timer_wrapper)
+ disarm : function (timer_wrapper)
+ reschedule : function (timer_wrapper, number)
+ end
+ add_timer : function (moduleapi, number, timer_callback, ... : any) : timer_wrapper
get_directory : function (moduleapi) : string
enum file_mode
"r" "w" "a" "r+" "w+" "a+"
@@ -70,6 +78,7 @@ global record moduleapi
load_resource : function (moduleapi, string, file_mode) : FILE
enum store_type
"keyval"
+ "keyval+"
"map"
"archive"
end
@@ -121,12 +130,20 @@ global record moduleapi
path : string
resource_path : string
+ -- access control
+ may : function (moduleapi, string, table|string)
+ default_permission : function (string, string)
+ default_permissions : function (string, { string })
+
-- methods the module can add
load : function ()
add_host : function (moduleapi)
save : function () : any
restore : function (any)
unload : function ()
+
+ -- added by mod_http
+ http_url : function (moduleapi, string, string, string) : string
end
global module : moduleapi