export type BarrierAction = { ready: (val: T) => Promise; remove: () => void; }; /** * A class to help make async code execute at the same time. * * Making sure all participants are ready before continuing. */ export default class Barrier { private listeners; private lastValue; private open; constructor(); /** * Returns true if the barrier is already opened meaning the add * function would panic */ isOpen(): boolean; /** * Add yourself to the barrier * * Only if all participants call ready the barrier is opened. * * @throws if the barrier is already open */ add(): BarrierAction; private _maybeTrigger; } //# sourceMappingURL=Barrier.d.ts.map