An async function returns a promise even when its body returns an immediate value. Annotating that contract makes consumers await the correct shape.
Worked example
const load = async (id: number): Promise<{ id: number; ready: boolean }> => ({
id,
ready: true,
});
console.log(await load(3));Result
{ id: 3, ready: true }Implementation notes
A promise of an optional result differs from an optional promise. Choose the shape that makes absence easiest for the caller to handle.
Try it yourself
Change one return branch and inspect the resulting type error.
Open the TypeScript example →Editorial date October 21, 2025 · Published December 6, 2026