import type { ClientUser } from 'payload'; export type AuthRequestContext = { /** Accepts the result when its session is still active and cancels any deferred invalidation. */ acceptResult: () => boolean; /** Invalidates the session after newer queued auth requests have had a chance to restore it. */ invalidateWhenIdle: (invalidate: () => void) => void; /** Whether the session changed or logout began after this request was queued. */ isResultStale: () => boolean; }; export type AuthSessionRequests = { discardPendingResults: () => void; isLoggingOut: () => boolean; logOut: ({ clearSession, request, }: { clearSession: () => void; request: () => Promise; }) => Promise; queue: (request: (context: AuthRequestContext) => Promise) => Promise; refresh: (request: (context: AuthRequestContext) => Promise) => Promise; }; /** * Coordinates requests that read or update the current auth session. * * Requests run in order, concurrent refreshes and logouts share a promise, and outdated results can * be discarded after the session changes. */ export declare function createAuthSessionRequests(): AuthSessionRequests; //# sourceMappingURL=authSessionRequests.d.ts.map