Syntax

TypeScript Typed Async Function Syntax

In TypeScript, typed async function: types the result of an async function — async function load(): Promise<User[]> { ... }

Quick Answer

Syntax
async function load(): Promise<User[]> { ... }
TypeScriptSyntax

Typed Async Function

Code example
async function load(): Promise<User[]> { ... }

Types the result of an async function.

Learn More

How to typed async function in TypeScript

  1. Open your TypeScript file or editor.
  2. Copy the example, then replace its sample names and values for your code.

TypeScript Typed Async Function Syntax

Use async function load(): Promise<User[]> { ... }.

Related Syntax References

Frequently asked questions

What is the TypeScript syntax for typed async function?

Use this pattern: async function load(): Promise<User[]> { ... }

Can I copy this TypeScript code example?

Yes. Use Copy code and adapt the example to your program.

Is this TypeScript syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify