An effort to statically type xstate (more here), in kinda r&d stage right now. Everything is gonna change here all the time. enough of that time to get to work :P
UPDATE: See the list of all features here.
UPDATE 2: The work has been stalled long ago but you can try it using the txstate
package (doesn't have any runtime code, just for trying out the types).