UNPKG

@ovine/core

Version:

Build flexible admin system with json.

44 lines (43 loc) 1.81 kB
/** * APP 路由相关组件 * 优化: 由于route读取数据时,会有短暂的 404 * BUG: 页面切换太快时,会导致页面报错 * Uncaught (in promise) Error: [mobx-state-tree] Cannot modify 'ErrorDetail[]@/errorData [dead]', the object is protected and can only be modified by using an action. */ import React from 'react'; import { CheckLimitFunc, PresetRouteProps, PrivateRouteProps, RouteItem } from "./types"; export declare const getPageAsync: (option: PresetRouteProps) => React.LazyExoticComponent<() => JSX.Element>; export declare const PrivateRoute: (props: PrivateRouteProps) => JSX.Element; export declare const usePresetContext: () => { checkLimit: CheckLimitFunc; nodePath?: string | undefined; limits?: import("../utils/types").ObjectOf<import("./types").Limit> | undefined; apis?: import("../utils/types").ObjectOf<import("../utils/request/types").ReqOption<any, any> & import("./types").LimitSchema & { key?: string | undefined; actionAddr?: string | undefined; }> | undefined; route: import("react-router").RouteProps<string, { [x: string]: string | undefined; }>; }; export declare const PrestRoute: (props: PresetRouteProps) => JSX.Element | null; declare type AppMenuRoutesProps = { authRoutes: RouteItem[]; fallback: any; pathPrefix?: string; debounceRoute?: number; }; export declare const AppMenuRoutes: (props: AppMenuRoutesProps) => JSX.Element; declare type UseRoutesConfigOpts = { routes: any[]; pathPrefix?: string; }; /** * 将routes配置转为路由的hooks,可用于更加方便创建自定义 layout */ export declare function useRoutesConfig(options: UseRoutesConfigOpts): { AuthRoutes: JSX.Element; asideMenus: RouteItem[]; authRoutes: RouteItem[]; }; export {};