/// import { Location, PathPattern } from 'react-router-dom'; import { IRoutableItemDescriptor } from '../../RoutableMenu/IRoutableItemDescriptor.type'; export interface INavConfig extends IRoutableItemDescriptor { title: string; key: string; subNav?: INavConfig[]; highlight?: string[]; } export interface IConsoleMenuConfig { displayPath?: PathPattern[] | string[]; notDisplayPath?: PathPattern[] | string[]; /** * 默认收起侧边栏的路径设置 */ collapsedPath?: PathPattern[] | string[]; /** * 默认展开的目录 */ defaultOpen?: PathPattern[] | string[]; } export interface ISidebarConfig { title: string; navs: INavConfig[]; onItemClick?: (key: string, itemInfo: any, e: MouseEvent) => void; /** * @deprecated */ defaultOpenKeys?: PathPattern[] | string[]; /** * @deprecated */ collapsedKeys?: PathPattern[] | string[]; /** * @deprecated */ invisiblePaths?: PathPattern[] | string[]; } export type SidebarCallBack = (location: Location) => ISidebarConfig; export interface IProp { sidebar: ISidebarConfig | SidebarCallBack; consoleMenu?: IConsoleMenuConfig; children?: React.ReactChildren; menuParams: Record; collapsed?: boolean; onNavCollapseTriggerClick?: any; } export interface IMenuProps { header?: string; title?: string; navs?: INavConfig[]; items?: INavConfig[]; currentPath?: string; menuParams?: Record; defaultOpenKeys?: PathPattern[] | string[]; collapsedKeys?: PathPattern[] | string[]; onItemClick?: (key: string, itemInfo: any, e: MouseEvent) => void; }