UNPKG

@etsoo/toolpad

Version:

Dashboard framework extention based on Toolpad Core

17 lines (16 loc) 1.15 kB
import type { Navigation, NavigationItem, NavigationPageItem, NavigationSubheaderItem } from "../AppProvider"; export declare const getItemKind: (item: NavigationItem) => "page" | "header" | "divider"; export declare const isPageItem: (item: NavigationItem) => item is NavigationPageItem; export declare const getItemTitle: (item: NavigationPageItem | NavigationSubheaderItem) => string; export declare function getPageItemFullPath(basePath: string, navigationItem: NavigationPageItem): string; export declare function isPageItemSelected(navigationItem: NavigationPageItem, basePath: string, pathname: string): boolean; export declare function hasSelectedNavigationChildren(navigationItem: NavigationItem, basePath: string, pathname: string): boolean; /** * Matches a path against the navigation to find the active page. i.e. the page that should be * marked as selected in the navigation. */ export declare function matchPath(navigation: Navigation, path: string): NavigationPageItem | null; /** * Gets the path for a specific navigation page item. */ export declare function getItemPath(navigation: Navigation, item: NavigationPageItem): string;