import '../node-crypto-polyfill.js';
import { REDOCLY_ROUTE_RBAC } from '@redocly/config';
import type { PageProps, PageStaticData, RbacConfig, RbacScopeItems, SsoConfig } from '@redocly/config';
import type { AuthDetails, PageRouteDetails } from '../types';
import type { ContentFs } from '../fs/content-fs.js';
import { RbacFeatures } from '../../constants/index.js';
export type ProjectRole = 'NONE' | 'READ' | 'TRIAGE' | 'WRITE' | 'MAINTAIN' | 'ADMIN';
export declare const PROJECT_ROLES_ORDERED_BY_ACCESS_LEVEL: string[];
export declare function getHigherRole(a: ProjectRole, b: ProjectRole): ProjectRole;
export declare function getAllowedTeamsForRoute(rbacConfig: RbacConfig | undefined, resource: Pick<PageRouteDetails, typeof REDOCLY_ROUTE_RBAC> | undefined): RbacScopeItems;
export declare function canAccessFeature(feature: RbacFeatures, auth: AuthDetails, rbacConfig?: RbacConfig, requiresLogin?: boolean): boolean;
export declare function canAccessResource(resource: any, user?: {
    isAuthenticated?: boolean;
    email?: string;
    teams?: string[];
}, rbacConfig?: RbacConfig, requiresLogin?: boolean): boolean;
export declare function canDownloadApiDefinition(pathname: string, rbacConfig: RbacConfig, requiresLogin: boolean, user?: {
    isAuthenticated?: boolean;
    email?: string;
    teams?: string[];
}): boolean;
export declare function canAccessAsset(pathname: string, rbacConfig: RbacConfig, requiresLogin: boolean, directoryPaths: Record<string, string>, user?: {
    isAuthenticated?: boolean;
    email?: string;
    teams?: string[];
}): boolean;
export declare function getAuthDetailsFromCookies(ssoConfig: SsoConfig, cookies: Record<string, string>): Promise<AuthDetails>;
/**
 * Maps the input deep and removes objects that have a 'permission' prop
 * but do not match the input permissions list
 * @param input can be object, array, string or any other value
 * @param user - user object with email and teams
 * @returns
 */
export declare function filterDataByAccessDeep(input: any, user?: {
    isAuthenticated?: boolean;
    email?: string;
    teams?: string[];
}, rbacConfig?: RbacConfig, requiresLogin?: boolean): any;
export declare function parseTeamClaimToArray(claimValue: unknown): string[];
/**
 * Extends RBAC config rules to include all supported languages
 *
 */
export declare function applyL10nToRbacConfig(fs: ContentFs, rbacConfig: RbacConfig | undefined): RbacConfig | undefined;
export declare function resolveDirectoryHashes(fs: ContentFs, rbacConfig: RbacConfig | undefined): Promise<Record<string, string>>;
export declare const isRbacConfigValid: (rbacConfig: unknown) => boolean;
export declare const parseRbacConfig: (rbacConfig: RbacConfig | undefined) => RbacConfig | undefined;
export declare const normalizeRbacConfig: (rbacConfig: RbacConfig) => {
    [x: string]: unknown;
    reunite?: {
        [x: string]: string;
    } | undefined;
    content?: {
        [x: string]: unknown;
        "**"?: {
            [x: string]: string;
        } | undefined;
    } | undefined;
    teamNamePatterns?: string[] | undefined;
    teamFolders?: string[] | undefined;
    teamFoldersBaseRoles?: {
        [x: string]: string;
    } | undefined;
    cms?: {
        [x: string]: string;
    } | undefined;
    features?: {
        aiSearch?: {
            [x: string]: string;
        } | undefined;
    } | undefined;
};
export declare function getRbacTeamsForSearch(route: PageRouteDetails<PageStaticData, PageProps>, rbacConfig: RbacConfig): string[];
export declare function extractTeamsForSearch(scopeItems: RbacScopeItems | undefined): string[];
export declare function expandTeamsForRead(rbacConfig: RbacConfig, teamNames: string[]): string[];
//# sourceMappingURL=rbac.d.ts.map