aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src/util/human/io.d.tl
blob: e4f64cd1eff5e6f75e62ede2682f42bc51e70afc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local record lib
	getchar : function (n : integer) : string
	getline : function () : string
	getpass : function () : string
	show_yesno : function (prompt : string) : boolean
	read_password : function () : string
	show_prompt : function (prompt : string) : boolean
	printf : function (fmt : string, ... : any)
	padleft : function (s : string, width : integer) : string
	padright : function (s : string, width : integer) : string

	-- {K:V} vs T ?
	record tablerow<K,V>
		width : integer | string -- generate an 1..100 % enum?
		title : string
		mapper : function (V, {K:V}) : string
		key : K
		enum alignments
			"left"
			"right"
		end
		align : alignments
	end
	type getrow = function<K,V> ({ K : V }) : string
	table : function<K,V> ({ tablerow<K,V> }, width : integer) : getrow<K,V>
end

return lib