import { Serializable, toDeserialized, toSerialized } from "../shared.js";
export interface BarrierWaitResult {
    isLeader: boolean;
}
export declare class Barrier extends Serializable {
    #private;
    constructor(n?: number, _buffer?: SharedArrayBuffer);
    /**
     * Blocks the current thread until all participating threads have reached the barrier.
     */
    blockingWait(): BarrierWaitResult;
    /**
     * Asynchronously waits until all participating threads have reached the barrier.
     */
    wait(): Promise<BarrierWaitResult>;
    [toSerialized](): readonly [SharedArrayBuffer];
    static [toDeserialized](buffer: ReturnType<Barrier[typeof toSerialized]>[0]): Barrier;
}
