Software /
code /
prosody
Annotate
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 |
rev | line source |
---|---|
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local record lib |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 type children_iter = function ( stanza_t ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 type childtags_iter = function () : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 type maptags_cb = function ( stanza_t ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 record stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 name : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 attr : { string : string } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 { stanza_t | string } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 tags : { stanza_t } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 query : function ( stanza_t, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 body : function ( stanza_t, string, { string : string } ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 text_tag : function ( stanza_t, string, string, { string : string } ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 tag : function ( stanza_t, string, { string : string } ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 text : function ( stanza_t, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 up : function ( stanza_t ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 reset : function ( stanza_t ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 add_direct_child : function ( stanza_t, stanza_t ) |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 add_child : function ( stanza_t, stanza_t ) |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 remove_children : function ( stanza_t, string, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 get_child : function ( stanza_t, string, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 get_text : function ( stanza_t ) : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 get_child_text : function ( stanza_t, string, string ) : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 child_with_name : function ( stanza_t, string, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 child_with_ns : function ( stanza_t, string, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 children : function ( stanza_t ) : children_iter, stanza_t, number |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 childtags : function ( stanza_t, string, string ) : childtags_iter |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 maptags : function ( stanza_t, maptags_cb ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 find : function ( stanza_t, string ) : stanza_t | string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 top_tag : function ( stanza_t ) : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 pretty_print : function ( stanza_t ) : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 pretty_top_tag : function ( stanza_t ) : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
37 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
38 get_error : function ( stanza_t ) : string, string, string, stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 indent : function ( stanza_t, number, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 record serialized_stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 name : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 attr : { string : string } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 { serialized_stanza_t | string } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 stanza : function ( string, { string : string } ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 is_stanza : function ( any ) : boolean |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 preserialize : function ( stanza_t ) : serialized_stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 deserialize : function ( serialized_stanza_t ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 clone : function ( stanza_t, boolean ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 message : function ( { string : string }, string ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 iq : function ( { string : string } ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
55 reply : function ( stanza_t ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
56 error_reply : function ( stanza_t, string, string, string, string ) |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
57 presence : function ( { string : string } ) : stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
58 xml_escape : function ( string ) : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
59 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
60 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
61 return lib |