Open
Description
-
assess if serde typescript-definitions crates is suitablethe type must be determined before compilation so it can't generate n-number of possible types in a union type ❌ - be06a6d generate Typescript
interface
and uniontype
for State -
investigate if serde typescript-definitions can generateit can generate type of plain object ✔️interface
(or atleast plain objecttype
can be treated asinterface
in XState) - try to generate typescript declaration from JSON using json_typegen_shared
json_typegen
results
{
"states": {
"set": {
"on": {
"TOGGLE": "reset",
"RESET": "reset",
"OFF": "set"
}
},
"reset": {
"on": {
"TOGGLE": "set",
"SET": "set",
"DATA": "set"
}
}
}
}
json_typegen above.json -O typescript --name MachineConfig > below.ts
interface MachineConfig {
states: States;
}
interface States {
set: Set;
reset: Reset;
}
interface Set {
on: On;
}
interface On {
TOGGLE: string;
RESET: string;
OFF: string;
}
interface Reset {
on: On2;
}
interface On2 {
TOGGLE: string;
SET: string;
DATA: string;
}