Camille provides a syntax for typing controller actions and can generate TypeScript functions for calling them, so both ends can always receive JSON with expected type and structure.
GitHub - onyxblade/camille-tutorial This step by step tutorial might be good to start with.
Feedback is welcome!