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
| TypeScript | JVM | Notes |
|---|---|---|
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.
PromiseConstructor interface
interface PromiseConstructorConstructors
new<T>(executor: (resolve: (value: T) => void, reject: (reason: unknown) => void) => void): Promise<T>Generated when the website builds, from lib.tsn.d.ts.