/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import type { ComponentType, ReactNode } from 'react'; export interface Role { createdAt?: string; updatedAt?: string; name: string; title: string; description?: string; strategy?: { actions?: string[]; }; default?: boolean; hidden?: boolean; allowConfigure?: boolean; allowNewMenu?: boolean; snippets?: string[]; } export interface RoleTabProps { active: boolean; role: Role | null; onRoleChange: (role: Role | null) => void; } export interface PermissionTabProps { activeKey: string; activeRole: Role | null; currentUserRole: Role | null; onRoleChange: (role: Role | null) => void; } export type ComponentLoader = () => Promise<{ default: ComponentType; }>; export interface RoleTabOptions { title: ReactNode; componentLoader: ComponentLoader; sort?: number; } export interface PermissionTabOptions { key: string; label: ReactNode; componentLoader: ComponentLoader; sort?: number; } export type PermissionTabOptionResolver = PermissionTabOptions | ((props: PermissionTabProps) => PermissionTabOptions | null | undefined); export declare class RolesManager { private readonly items; add(name: string, options: RoleTabOptions): void; list(): [string, RoleTabOptions][]; } export declare class ACLSettingsUI { private readonly permissionTabs; addPermissionsTab(options: PermissionTabOptionResolver): void; getPermissionsTabs(props: PermissionTabProps): PermissionTabOptions[]; }