What is the correct way to assign type from a functions return type?
async function getFood(){
const food = await {fruit: 'banana', qty: 3}
return food
}
/**
* made up syntax
* @type {returnOf getFood}
* */
let doesntWork;
/** @type {{fruit: string, qty: number}} */
let worksButNoInferring
let worksButRequiresCallingFunction = getFood()
As evidenced by VSCode, the return type is available. I just don't know how to get it without calling the function.
