Aug 12, 2026 TypeScript Won't Let You Make That Call: Encoding Protocol State in the Type System How to use phantom types and `this` parameters to turn illegal protocol transitions into compile-time errors instead of runtime bugs. session-typestypescriptprotocol-statetype-systems