local var = tdfm.input.string.get("key", "fallback")
local var = tdfm.input.number.get("key", 1)
local var = tdfm.input.boolean.get("key", false)

local color = tdfm.color.hex("#FFFFFF")
local color = tdfm.color.hex("#FFF")
local color = tdfm.color.hex("FFFFFF")
local color = tdfm.color.hex("FFF")
local color = tdfm.color.rgb(255, 255, 255)
local color = tdfm.color.hsv(360, 100, 100)
local color = tdfm.color.hsb(360, 100, 100)
local color = tdfm.color.hsl(360, 100, 100)
-- every single function returns
-- { r:255, g:255, b:255 }

local dark = tdfm.color.hex("#000000")
local light = tdfm.color.hex("#ffffff")
local bg = tdfm.color.hex("#009900")
local on_color = tdfm.color.on(bg, dark, light)

local brighter = tdfm.color.brightess.add(10, color)
local darker = tdfm.color.brightness.add(-10, color)
local setted = tdfm.color.brightness.set(255, color)
local hueadd = tdfm.color.hue.add(10, color)
local hueset = tdfm.color.hue.set(360, color)
local saturationadd = tdfm.color.saturation.add(10, color)
local saturationset = tdfm.color.saturation.set(10, color)
local negarive = tdfm.color.negative(color)
local mono = tdfm.color.mono(color)

local colormix = tdfm.color.mix({ color, 50 }, { color, 60 })

local format = "{{R}} {{FR}} {UR} {{hr}} {{HR}} {{G}} {{HG}} {{B}} {{HB}} {{HEX}} {{hex}}"
local colorstring = tdfm.color.format(format, color)
-- "255 1.0 100 ff FF 255 FF 255 FF FFFFFF ffffff"

local shellout = tdfm.shell.exec("neofetch")
local noshellout = tdfm.shell.spawn("neofetch") -- forks process

local file_caption = tdfm.file.read("path")

local template = {
	opts = {
		caption = file_caption,
		output = "path",
	},
	replaces = {
		{ pattern = "regex", value = "value" },
		tdfm.replace("pattern", "value"),
	},
	callbacks = {
		before_parse = function() end,
		after_parse = function() end,
		before_paste = function() end,
		after_paste = function() end,
	},
}
local stemplate = tdfm.template({ caption = "string", output = "path" }, { tdfm.replate("key", "value") }, {
	before_parse = function() end,
	after_parse = function() end,
	before_paste = function() end,
	after_paste = function() end,
})

return {
	opts = {
		threads = 4, -- 4 templates processing at the same time
	},
	templates = {
		{ template },
		{ template, stemplate }, -- executed in turn
	},
	callbacks = {
		before = function() end,
		after = function() end,
	},
}
