syndicate_utils/src/schema/rofi.nim

19 lines
435 B
Nim
Raw Permalink Normal View History

2023-10-26 16:20:26 +00:00
import
preserves, std/tables
type
Environment* = Table[Symbol, string]
Select* {.preservesRecord: "rofi-select".} = object
`option`*: string
`environment`*: Environment
Options* {.preservesRecord: "rofi-options".} = object
`options`*: seq[string]
proc `$`*(x: Environment | Select | Options): string =
2023-12-25 23:11:54 +00:00
`$`(toPreserves(x))
2023-10-26 16:20:26 +00:00
proc encode*(x: Environment | Select | Options): seq[byte] =
2023-12-25 23:11:54 +00:00
encode(toPreserves(x))