You can implement a type-aware map, reduce, filter, etc. if you use point free semantics with higher kinded types:
https://code.lol/post/programming/higher-kinded-types/
I have to admit it's a bit heavy, but this is totally representible in today's Typescript if I understand your ask correctly. It would be great if it was a more obvious / automatic inference, though.