/// <reference types="node" />
import type { EventEmitter } from 'events';
import type { IAccessInfo, IAccessStore, IProjectRoleUsage, IRole, IRoleWithProject, IUserPermission, IUserRole, IUserWithProjectRoles } from '../types/stores/access-store';
import type { IPermission, IUserAccessOverview } from '../types/model';
import type { Db } from './db';
import type { NamePermissionRef, PermissionRef } from '../services/access-service';
interface IPermissionRow {
    id: number;
    permission: string;
    display_name: string;
    environment?: string;
    type: string;
    project?: string;
    role_id: number;
}
export declare class AccessStore implements IAccessStore {
    private logger;
    private timer;
    private db;
    constructor(db: Db, eventBus: EventEmitter, getLogger: Function);
    private permissionHasName;
    private permissionIdsToNames;
    resolvePermissions: (permissions: PermissionRef[]) => Promise<NamePermissionRef[]>;
    delete(key: number): Promise<void>;
    deleteAll(): Promise<void>;
    destroy(): void;
    exists(key: number): Promise<boolean>;
    get(key: number): Promise<IRole>;
    getAll(): Promise<IRole[]>;
    getAvailablePermissions(): Promise<IPermission[]>;
    mapPermission(permission: IPermissionRow): IPermission;
    getPermissionsForUser(userId: number): Promise<IUserPermission[]>;
    mapUserPermission(row: IPermissionRow): IUserPermission;
    getPermissionsForRole(roleId: number): Promise<IPermission[]>;
    addEnvironmentPermissionsToRole(role_id: number, permissions: PermissionRef[]): Promise<void>;
    unlinkUserRoles(userId: number): Promise<void>;
    unlinkUserGroups(userId: number): Promise<void>;
    clearUserPersonalAccessTokens(userId: number): Promise<void>;
    clearPublicSignupUserTokens(userId: number): Promise<void>;
    getProjectUsersForRole(roleId: number, projectId?: string): Promise<IUserRole[]>;
    getProjectUsers(projectId?: string): Promise<IUserWithProjectRoles[]>;
    getRolesForUserId(userId: number): Promise<IRoleWithProject[]>;
    getAllProjectRolesForUser(userId: number, project: string): Promise<IRoleWithProject[]>;
    getRootRoleForUser(userId: number): Promise<IRole | undefined>;
    getUserIdsForRole(roleId: number): Promise<number[]>;
    getGroupIdsForRole(roleId: number): Promise<number[]>;
    getProjectUserAndGroupCountsForRole(roleId: number): Promise<IProjectRoleUsage[]>;
    addUserToRole(userId: number, roleId: number, projectId?: string): Promise<void>;
    removeUserFromRole(userId: number, roleId: number, projectId?: string): Promise<void>;
    addGroupToRole(groupId: number, roleId: number, createdBy: string, projectId?: string): Promise<void>;
    removeGroupFromRole(groupId: number, roleId: number, projectId?: string): Promise<void>;
    updateUserProjectRole(userId: number, roleId: number, projectId: string): Promise<void>;
    updateGroupProjectRole(groupId: number, roleId: number, projectId: string): Promise<void>;
    addRoleAccessToProject(users: IAccessInfo[], groups: IAccessInfo[], projectId: string, roleId: number, createdBy: string): Promise<void>;
    addAccessToProject(roles: number[], groups: number[], users: number[], projectId: string, createdBy: string): Promise<void>;
    setProjectRolesForUser(projectId: string, userId: number, roles: number[]): Promise<void>;
    getProjectRolesForUser(projectId: string, userId: number): Promise<number[]>;
    setProjectRolesForGroup(projectId: string, groupId: number, roles: number[], createdBy: string): Promise<void>;
    getProjectRolesForGroup(projectId: string, groupId: number): Promise<number[]>;
    removeUserAccess(projectId: string, userId: number): Promise<void>;
    removeGroupAccess(projectId: string, groupId: number): Promise<void>;
    removeRolesOfTypeForUser(userId: number, roleTypes: string[]): Promise<void>;
    addPermissionsToRole(role_id: number, permissions: PermissionRef[] | string[], environment?: string): Promise<void>;
    removePermissionFromRole(role_id: number, permission: string, environment?: string): Promise<void>;
    wipePermissionsFromRole(role_id: number): Promise<void>;
    cloneEnvironmentPermissions(sourceEnvironment: string, destinationEnvironment: string): Promise<void>;
    getUserAccessOverview(): Promise<IUserAccessOverview[]>;
}
export {};
//# sourceMappingURL=access-store.d.ts.map