/** * @description * The AsyncChain helps to synchronise async tasks. * It also can be used to synchronise async tasks across multiple components. * It represents an alternative to the process chain feature. */ export default class AsyncChain { private lastPromise; private pressure; private readonly idleListener?; readonly destroyed: boolean; constructor(onIdle?: () => void); /** * Adds an async task to the chain * and returns the promise of the task. * @param task */ runInChain(task: (...args: any[]) => Promise): Promise; /** * Returns the backpressure of the chain * (how many promises are still not resolved). */ getBackpressure(): number; /** * @description * Destroys the async chain. */ destroy(): void; }