Software /
code /
prosody
Comparison
teal-src/util/human/io.d.tl @ 12613:a27870dcaf24
util.human.io: Add Teal interface definition
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 10 Nov 2021 15:12:03 +0100 |
comparison
equal
deleted
inserted
replaced
12612:588b1d175838 | 12613:a27870dcaf24 |
---|---|
1 local record lib | |
2 getchar : function (n : integer) : string | |
3 getline : function () : string | |
4 getpass : function () : string | |
5 show_yesno : function (prompt : string) : boolean | |
6 read_password : function () : string | |
7 show_prompt : function (prompt : string) : boolean | |
8 printf : function (fmt : string, ... : any) | |
9 padleft : function (s : string, width : integer) : string | |
10 padright : function (s : string, width : integer) : string | |
11 | |
12 -- {K:V} vs T ? | |
13 record tablerow<K,V> | |
14 width : integer | string -- generate an 1..100 % enum? | |
15 title : string | |
16 mapper : function (V, {K:V}) : string | |
17 key : K | |
18 enum alignments | |
19 "left" | |
20 "right" | |
21 end | |
22 align : alignments | |
23 end | |
24 type getrow = function<K,V> ({ K : V }) : string | |
25 table : function<K,V> ({ tablerow<K,V> }, width : integer) : getrow<K,V> | |
26 end | |
27 | |
28 return lib |