Skip to Content
API reference

Promise

The eventual result of an asynchronous operation. An async TypeScript function returns a promise, and Java or Kotlin receives the same object.

Asyncstandard library

Type mapping

TypeScriptJVMNotes
Promise<T>typescriptnative.Promise<T>The same object on both sides.
Promise<void>Promise<Void>A void result appears as Void in Java.

Promise interface

interface Promise<T>

The shared typescriptnative.Promise runtime. Reactions run on its ordered queue.

Methods

then<R>(fulfilled: (value: T) => R | Promise<R>): Promise<R>
catch(rejected: (reason: unknown) => T | Promise<T>): Promise<T>
finally(cleanup: () => void | Promise<void>): Promise<T>

PromiseConstructor interface

interface PromiseConstructor

Constructors

new<T>(executor: (resolve: (value: T) => void, reject: (reason: unknown) => void) => void): Promise<T>

Static methods

resolve(): Promise<void>
resolve<T>(value: T | Promise<T>): Promise<T>
reject<T = never>(reason: unknown): Promise<T>

Generated when the website builds, from lib.tsn.d.ts.

Language

Remembered on every API page

On this page