I would like to use the return type of a function to type an item on an interface like so:
const returnsPromise = async (): Promise<string> => {
return Promise.resolve('I want the string type and not a Promise')
}
interface Myinterface {
message: ReturnType<typeof returnsPromise>
}
However, message is of type Promise instead of string. Can one get the type a promise ought to resolve with?