import type { IUser } from '@api-client/core/models/store/User.js';
import type { GroupSchema } from '@api-client/core/models/store/Group.js';
import { type IPermission } from '@api-client/core/models/store/Permission.js';
import { Service } from '../core/Service.js';
declare enum CheckState {
    NotChecked = 0,
    Checking = 1,
    Checked = 2
}
export default class UserService extends Service {
    #private;
    static key: string;
    /**
     * Tells yhe current state of checking for user session.
     */
    status: CheckState;
    /**
     * Checks whether user is logged in and exists.
     * @returns `true`
     */
    get isLoggedIn(): boolean;
    protected onStart(): Promise<void>;
    protected onDestroy(): Promise<void>;
    /**
     * Ensures that the user data is loaded.
     * @returns A promise that resolves when the user data is loaded.
     */
    ready(): Promise<void>;
    /**
     * Loads the user data from the API.
     * This gets the user data from the API and the list of groups the user belongs to.
     *
     * Note that calling this method multiple times will refresh the user data
     * and the list of groups, so it is recommended to call this method only once
     * and then use the `getUser()` method to get the user data.
     * @returns A promise that resolves when the user data is loaded.
     */
    load(): Promise<void>;
    getUserOrThrow(): Promise<IUser>;
    getUser(): Promise<IUser | null>;
    getGroups(): Promise<GroupSchema[]>;
    /**
     * Finds the user's highest permission in the given list of permissions.
     * @param permissions The list of permissions to search in.
     * @return The user's permission if found, otherwise `undefined`.
     */
    findUserPermission(permissions: IPermission[]): IPermission | undefined;
}
export {};
//# sourceMappingURL=UserService.d.ts.map