How to hint the output type based on the input type?

Lets start with a simple example:

type MakeFullRequestType = (inputUrl: string, userConfiguration: 'full') => boolean;
type MakeTextRequestType = (inputUrl: string, userConfiguration: 'text') => string;

type MakeRequestType =
  MakeFullRequestType |
  MakeTextRequestType;

const makeRequest: MakeRequestType = (url, config) => {
  if (config === 'full') return false;
  if (config === 'text') return 'test';

  throw new Error('test');
};

makeRequest('test', 'full');

This is already giving an error:

8: const makeRequest: MakeRequestType = (url, config) => {                                        ^ function. Could not decide which case to select
8: const makeRequest: MakeRequestType = (url, config) => {
                      ^ union type
15: makeRequest('test', 'full');
                        ^ string. Expected string literal `text`, got `full` instead
2: type MakeTextRequestType = (inputUrl: string, userConfiguration: 'text') => string;
                                                                    ^ string literal `text`

https://flow.org/try/#0C4TwDgpgBAsghgawgMQK4Bt0CUIEdUQDOwAKuNALxQAUAlgHZirACqATugFxTFsMDmAGiipCENgGEA9vQBmtfqjZxgtGdwDksjOg0BKKBQB8UAEZSp6CHHoBuAFChIsRBBIQAHsBz4ipcoY0DEysHNy8AsKi4tJyCkoqavSawJ7A+oYmEfT8Do4B8Eg+BMRkzhT2UC5IaJjFfmXQAD6V1W5p9aXkeQDGMsRQALauncDchRCjjYHUSujCfXH8BsZQAN6ttLI0i-L8hhRUWjoZbBDASvRQsnDoYg5VWzsyewdHqV6n55dQGqnEGgeUFawAAFmwpAB3KD0CDQgCibAhbGofz8+gcAF88sMingSsBUf90sJjpgMUA

I cannot figure out the syntax that'd allow me to dictate the output based on the input shape.

This is a more complete fragment of code showing what I am trying to achieve:

type UserConfigurationType = {
  +body?: string,
  +responseType?: 'full' | 'text'
};

type MakeFullRequestType = (inputUrl: string, userConfiguration: UserConfigurationType & {+responseType: 'full'}) => boolean;
type MakeTextRequestType = (inputUrl: string, userConfiguration: UserConfigurationType & {+responseType: 'text'}) => string;

type MakeRequestType =
  MakeFullRequestType |
  MakeTextRequestType;

const makeRequest: MakeRequestType = (url, config) => {
  if (config.responseType === 'full') return false;
  if (config.responseType === 'text') return 'test';

  throw new Error('test');
};

https://flow.org/try/#0C4TwDgpgBAqgzhATgYQPYDsBmBLA5gV0QENhsMAVcaAXigG8AoKKAagCNUATEAfgC4ocYImzpcAGiatEEOGAwJKkflADkmfABtNqqAB81wCAA9gug6oBWcDKoYBfANwMGoSFACyRANYQAYlqaAEoQAI74ssBKNFAAFKJg+MAwiJoCQiJi4lD4CCgYOATEpBgC8EhoWHiEJGTo0VAAZPQsMnIKENEC6oGq9gCUUNQAfFAcqJoQROjObtBevuQmwCHhkQ208eiJyanpwqISOXmVhTUl6GUnBdXFdQ3NdK2y8uiKVN1Gpn2DI4IHYmcrionh8EFWESEGykC38gQh6xBehhYKWpgRUKoQIAxgpgFAALZgjHAASwkkbOKETTZXFVXC-UaMZjYTBxOmFAB0bVe73c1AFag02lUgxkwEI6CgmCImgQzhZbNiHLw3JeHQ2gtUXzMYogEsQUu1kVUCqgUmAAAtEKgAO5QdAQe0AUUQNsQsWNQlFzicQA