Software /
code /
prosody
Annotate
teal-src/util/dataforms.d.tl @ 12627:b8ce0f61855b
util.signal: Fix name conflict in Teal interface declaration
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 10 Aug 2022 15:12:00 +0200 |
parent | 12615:b2047b82ec85 |
rev | line source |
---|---|
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local stanza_t = require "util.stanza".stanza_t |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
3 local record lib |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
4 record dataform |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
5 title : string |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
6 instructions : string |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
7 |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
8 record form_field |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
10 enum field_type |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
11 "boolean" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
12 "fixed" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
13 "hidden" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
14 "jid-multi" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
15 "jid-single" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
16 "list-multi" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
17 "list-single" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
18 "text-multi" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
19 "text-private" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
20 "text-single" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
21 end |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
23 type : field_type |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
24 var : string -- protocol name |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
25 name : string -- internal name |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
27 label : string |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
28 desc : string |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
30 datatype : string |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
31 range_min : number |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
32 range_max : number |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
34 value : any -- depends on field_type |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
35 options : table |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
36 end |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
37 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
38 { form_field } |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
40 enum form_type |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
41 "form" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
42 "submit" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
43 "cancel" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
44 "result" |
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
45 end |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
47 form : function ( dataform, { string : any }, form_type ) : stanza_t |
12615
b2047b82ec85
util.dataforms: Add missing :data() to Teal definition
Kim Alvefur <zash@zash.se>
parents:
12614
diff
changeset
|
48 data : function ( dataform, stanza_t ) : { string : any } |
12614
d498e7e7853a
util.dataforms: Restructure Teal definition file
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
49 end |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 new : function ( dataform ) : dataform |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 return lib |