How to make one generic type closely dependent on another in TypeScript?
You can use a generic type and inference. If your requirements allow this, it could be easier than extending each type from base interface. This solution puts all your links in one place, so it has its own drawbacks, but it seems ok to me if you can't change original types:
type Return<T> =
T extends BarParam ? BarReturn :
T extends FooParam ? FooReturn :
never;
You can see it in action Playground