util.serialization: Add Teal type specification
authorKim Alvefur <zash@zash.se>
Wed, 01 Dec 2021 15:05:06 +0100
changeset 12620 6b70d1af1fe3
parent 12619 b2047b82ec85
child 12621 36d77cc56ecb
util.serialization: Add Teal type specification
teal-src/util/serialization.d.tl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/teal-src/util/serialization.d.tl	Wed Dec 01 15:05:06 2021 +0100
@@ -0,0 +1,33 @@
+local record _M
+	enum preset
+		"debug"
+		"oneline"
+		"compact"
+	end
+	type fallback = function (any, string) : string
+	record config
+		preset : preset
+		fallback :  fallback
+		fatal : boolean
+		keywords : { string : boolean }
+		indentwith : string
+		itemstart : string
+		itemsep : string
+		itemlast : string
+		tstart : string
+		tend : string
+		kstart : string
+		kend : string
+		equals : string
+		unquoted : boolean | string
+		hex : string
+		freeze : boolean
+		maxdepth : integer
+		multirefs : boolean
+		table_pairs : function
+	end
+	type serializer = function (any) : string
+	new : function (config|preset) : serializer
+	serialize : function (any, config|preset) : string
+end
+return _M