Let say I have this function:

```
let getData = () => {
    return {
        name: 'John',
        age: 2,
        isAsian: true
    }
}

```

How do I say (if even possible) that a variable's type is the return type of `getData`, **without** affecting it to `getData`?

For example, I'm looking for something like:

```
var data: getData

```

Of course this does not work, as the type would be the function and not the return value of the function. (**Edit**: Actually it would just give the error: `Cannot find name 'getData'`)

`var data = getData()` would work; the type of `data` would be inferred to `{name: string, age: number, isAsian: boolean}`, but this is not a solution for me.

There is a discussion here that might be related to my issue: [Obtaining the return type of a function](https://stackoverflow.com/questions/36015691/obtaining-the-return-type-of-a-function)

However, it does not seem to be the solution I'm looking for. First I can't use Typescript 2.8 yet (I'm using angular and the CLI won't let me). I think that the alternative, just like the main solution of this SO question is not useful to me, because I'm looking to use the return type of my function dynamically.