/** * A lightweight fair mutex. (Other libraries contain too many features and we want to keep size down). * * Characteristics: * - Non-reentrant. * - Fair. * - This means multiple callers awaiting 'lock' will be granted the mutex in the order they requested it. * - This is important, as in React, developers calling 'AuthManager.endAuthSession' in a 'useEffect' cleanup need it * to take effect immediately, such that subsequent 'AuthManager.beginAuthSession' calls will always succeed. * - When calling `safe` consecutively with no 'awaits' in-between, the current context will synchronously acquire * the mutex every time. */ export declare class FairMutex { private locked; private readonly queue; safe(callback: () => Promise): Promise; private lock; private unlock; }