export type UnlockFn = () => void; /** * An asynchronous semaphore implementation with associated items per lease. * * @internal This class is meant to be used in PowerSync SDKs only, and is not part of the public API. */ export declare class Semaphore { private readonly available; readonly size: number; private firstWaiter?; private lastWaiter?; constructor(elements: Iterable); private addWaiter; private deactivateWaiter; private requestPermits; /** * Requests a single item from the pool. * * The returned `release` callback must be invoked to return the item into the pool. */ requestOne(abort?: AbortSignal): Promise<{ item: T; release: UnlockFn; }>; /** * Requests access to all items from the pool. * * The returned `release` callback must be invoked to return items into the pool. */ requestAll(abort?: AbortSignal): Promise<{ items: T[]; release: UnlockFn; }>; } /** * An asynchronous mutex implementation. * * @internal This class is meant to be used in PowerSync SDKs only, and is not part of the public API. */ export declare class Mutex { private inner; acquire(abort?: AbortSignal): Promise; runExclusive(fn: () => PromiseLike | T, abort?: AbortSignal): Promise; } /** * Creates a signal aborting after the set timeout. */ export declare function timeoutSignal(timeout: number): AbortSignal; export declare function timeoutSignal(timeout?: number): AbortSignal | undefined;