Comparison

teal-src/util/stanza.d.tl @ 11432:113f3912c7cb

util: Add Teal interface definition files Enables writing code in Teal that is aware of the interfaces and function prototypes in these other utils. Could also be used to do type checks on Lua sources, but this tends to have a lot of noise.
author Kim Alvefur <zash@zash.se>
date Tue, 09 Mar 2021 14:36:46 +0100
child 11459:86904555bffc
comparison
equal deleted inserted replaced
11431:4874b54af344 11432:113f3912c7cb
1 local record lib
2
3 type children_iter = function ( stanza_t ) : stanza_t
4 type childtags_iter = function () : stanza_t
5 type maptags_cb = function ( stanza_t ) : stanza_t
6
7 record stanza_t
8 name : string
9 attr : { string : string }
10 { stanza_t | string }
11 tags : { stanza_t }
12
13 query : function ( stanza_t, string ) : stanza_t
14 body : function ( stanza_t, string, { string : string } ) : stanza_t
15 text_tag : function ( stanza_t, string, string, { string : string } ) : stanza_t
16 tag : function ( stanza_t, string, { string : string } ) : stanza_t
17 text : function ( stanza_t, string ) : stanza_t
18 up : function ( stanza_t ) : stanza_t
19 reset : function ( stanza_t ) : stanza_t
20 add_direct_child : function ( stanza_t, stanza_t )
21 add_child : function ( stanza_t, stanza_t )
22 remove_children : function ( stanza_t, string, string ) : stanza_t
23
24 get_child : function ( stanza_t, string, string ) : stanza_t
25 get_text : function ( stanza_t ) : string
26 get_child_text : function ( stanza_t, string, string ) : string
27 child_with_name : function ( stanza_t, string, string ) : stanza_t
28 child_with_ns : function ( stanza_t, string, string ) : stanza_t
29 children : function ( stanza_t ) : children_iter, stanza_t, number
30 childtags : function ( stanza_t, string, string ) : childtags_iter
31 maptags : function ( stanza_t, maptags_cb ) : stanza_t
32 find : function ( stanza_t, string ) : stanza_t | string
33
34 top_tag : function ( stanza_t ) : string
35 pretty_print : function ( stanza_t ) : string
36 pretty_top_tag : function ( stanza_t ) : string
37
38 get_error : function ( stanza_t ) : string, string, string, stanza_t
39 indent : function ( stanza_t, number, string ) : stanza_t
40 end
41
42 record serialized_stanza_t
43 name : string
44 attr : { string : string }
45 { serialized_stanza_t | string }
46 end
47
48 stanza : function ( string, { string : string } ) : stanza_t
49 is_stanza : function ( any ) : boolean
50 preserialize : function ( stanza_t ) : serialized_stanza_t
51 deserialize : function ( serialized_stanza_t ) : stanza_t
52 clone : function ( stanza_t, boolean ) : stanza_t
53 message : function ( { string : string }, string ) : stanza_t
54 iq : function ( { string : string } ) : stanza_t
55 reply : function ( stanza_t ) : stanza_t
56 error_reply : function ( stanza_t, string, string, string, string )
57 presence : function ( { string : string } ) : stanza_t
58 xml_escape : function ( string ) : string
59 end
60
61 return lib