Promise

To return a new promise, do

new Promise<T>((resolve) => {...});

The promise will take a function, which has a resolve function, once resolve(): void is called, the promise will return

The API also has reject and stuff, check MDNs for API.