I would not recommend TypeScript for this type of context-switching. It either wouldn’t work, or be excruciatingly painful. In fact, TypeScript (and Flow) don’t work so well for functional programming.
For a statically typed FP experience, I’d recommend just using a proper statically typed FP language (e.g, PureScript, ClojureScript, Fable, Elm, Reason). You get better ergonomy and more idiomatic code than our little hacks. ☺