import { EPermissionType, ESubPermissionType, IGraphData, IPermission, IPrivilege, IResource, IResourcePermission, IResourcesByPermission, ISanitized, TAction, TById, TRawData, TRole, TRolesDict, TSanitizedPrivilege } from '../types/roles';
export declare const PERMISSIONS: {
    key: TAction;
    label: string;
    canApplyTo: (EPermissionType | ESubPermissionType)[];
}[];
/**
 * pushes uniquely list of items
 * @param array input array
 * @param args list of elements to add to the array
 * @returns an array containing unique fields
 */
export declare function uniquePush<T = string>(array: T[], ...args: T[]): T[];
/**
 * Sanitize a privileges array
 * @param data unsanitized data
 * @returns sanitized data
 */
export declare function sanitizePrivileges(data: IPrivilege[]): TById;
/**
 * sort list of sanitized pivileges
 * @param dict sanitized data
 * @returns sorted privileges
 */
export declare function sortPrivileges(dict: TById): TSanitizedPrivilege[];
export declare function parents(id: string, dict: TById): string[];
export declare function children(id: string, dict: TById): string[];
export declare function allowed(id: string, dict: TById): string[];
export declare function removePrivilege(id: string, dict: TById): TById;
export declare function addPrivilegeIn(parentId: string, childId: string, dict: TById): TById;
export declare function removePrivilegeFrom(parentId: string, childId: string, dict: TById): TById;
export declare function createPrivilege(name: string, dict: TById): TById;
export declare function renamePrivilege(name: string, id: string, dict: TById): TById;
export declare function populateShallow(ids: string[], dict: TById): (IPrivilege | null)[];
export declare function getPrivilegeById(id: string, dict: TById): TSanitizedPrivilege | null;
export declare function actionsToPrivs({ applyTo: _, type, ...actions }: IPermission): {
    [privName: string]: string[];
};
export declare function getResourceFromType(item: IPermission): IResource;
export declare function sanitizePermissions(data: IPermission[], byKey: TById): TById;
export declare function getDictByName(dict: TById): TById;
export declare function sanitizeRoles(data: TRawData): ISanitized;
export declare function rolesToAPI(data: ISanitized): TRawData;
export declare function getGraphData(id: string, dict: TById): IGraphData;
export declare function addPermission(id: string, permission: IPermission, dict: TById): TById;
export declare function removePermission(id: string, permission: IPermission, dict: TById): TById;
export declare function removeMultiplePermissions(resourcesByPermission: IResourcesByPermission, dict: TById): TById;
export declare function resetResources(id: string, dict: TById): TById;
export declare function togglePermission(id: string, resource: IResource, permission: IResourcePermission, dict: TById): TById;
export declare function getPromotions(id: string, dict: TById): Record<string, string[]>;
export declare function getInheritedResources(id: string, dict: TById): IResource[];
export declare const createRole: (id: string, name: string, roles: TRolesDict) => TRolesDict;
export declare const removeRole: (id: string, roles: TRolesDict) => TRolesDict;
export declare const saveRole: (role: TRole, roles: TRolesDict) => TRolesDict;
