import type React from "react"; /** * Module accessibility is determined by permission only. * permissions are only serve for use. */ export interface NavigationModuleItem { /** * Must be unique for all modules. */ url: string; title: string; componentType: React.ComponentType; /** * If undefined, this module can be accessed by any one. * If given, this module can be accessed by any user, with at least 1 of the provided Feature permissions. * If the user is entitled with some super Feature permission (like "ALL"), this module can be accessed as well. * Pass an empty array [] if allow only user with super Feature permission */ featurePermissions?: Feature[]; fieldPermissions?: Field[]; /** * To define route parameter for React Router. * Example: "/:direction(asc|desc)" */ routeParam?: string; /** * default - display NavItem normally, can access by route. * hidden - Not shown as NavItem, can access by route. Useful for modules in development. * disabled - Not shown as NavItem, cannot access by route. */ display?: "default" | "hidden" | "disabled"; /** * If true, each different URL will use different navigator tab. * Only work when routeParam is specified. * * Example: * /user/detail/100 and /user/detail/101 will occupy 2 tabs. * * Attention: * In order to distinguish each tab by title, AdminAppContext.updateTitle() should be used together. * A loading indicator will be shown before AdminAppContext.updateTitle() is called. */ separateTab?: boolean; } export interface NavigationGroupItem { title: string; icon: React.ReactElement; modules: Array>; } export declare class AdminNavigationUtil { static groups(navigationGroupItems: Array>, permissions: Feature[], superAdminPermission: Feature, showHidden: boolean): Array>; static modules(navigationGroupItems: NavigationGroupItem[]): Array>; static moduleByURL(url: string, modules: Array>): NavigationModuleItem | undefined; private static canAccessModule; }