import { UUID } from 'node:crypto';
import { AKAuthUser } from '../types.js';
export type AKAuthContextSnapshot = {
    userId?: UUID;
    isAdmin?: boolean;
};
export declare class AKAuthContext<User extends AKAuthUser> {
    #private;
    constructor(findUserById: (id: UUID) => Promise<User | undefined>);
    runWithCurrentUser<R>(user: User, callback: () => R): R;
    runWithCurrentUserAnonymous<R>(callback: () => R): R;
    runWithIsAdmin<R>(callback: () => R): R;
    get user(): User | undefined;
    get isAdmin(): boolean;
    get isAnonymous(): boolean;
    map<T>(handler: {
        admin: (user: User | undefined) => T;
        user: (user: User) => T;
        anonymous: () => T;
    }): T;
    snapshot(): AKAuthContextSnapshot;
    runWithSnapshot<R>(snapshot: AKAuthContextSnapshot, callback: () => R): Promise<R>;
}
