Type that allows either a value or a Promise of that value.
Used for functions that may return either synchronously or asynchronously.
Type Parameters
T
The type of the value
Example
// Example function returning either sync or async value asyncfunctiongetData():Awaitable<string> { return Math.random() >0.5 ?"immediate value" :Promise.resolve("async value"); }
Type that allows either a value or a Promise of that value. Used for functions that may return either synchronously or asynchronously.