Software /
code /
prosody
Annotate
teal-src/util/serialization.d.tl @ 12673:2d330edf8bf2
CHANGES: Add role auth
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 22 Aug 2022 13:03:10 +0100 |
parent | 12616:6b70d1af1fe3 |
rev | line source |
---|---|
12616
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local record _M |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 enum preset |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 "debug" |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 "oneline" |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 "compact" |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 end |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 type fallback = function (any, string) : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 record config |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 preset : preset |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 fallback : fallback |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 fatal : boolean |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 keywords : { string : boolean } |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 indentwith : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 itemstart : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 itemsep : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 itemlast : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 tstart : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 tend : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 kstart : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 kend : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 equals : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 unquoted : boolean | string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 hex : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 freeze : boolean |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 maxdepth : integer |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 multirefs : boolean |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 table_pairs : function |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 end |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 type serializer = function (any) : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 new : function (config|preset) : serializer |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 serialize : function (any, config|preset) : string |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 end |
6b70d1af1fe3
util.serialization: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 return _M |