UNPKG

elmer-ui-core

Version:

web app framework

57 lines (56 loc) 1.67 kB
import { IVirtualElement } from "elmer-virtual-dom"; import { Component } from "../../core/Component"; import { IRouter } from "../../interface/IDeclareComponentOptions"; import { TypeUIRenderOptions } from "../../interface/IElmerRender"; import { IPropCheckRule } from "../../propsValidation"; import "./Route"; declare type TypeRouterPropRule = { hashRouter: IPropCheckRule; url: IPropCheckRule; param: IPropCheckRule; C404: IPropCheckRule; }; declare type TypeRouterProps = { [P in keyof TypeRouterPropRule]: any; } & { children: IVirtualElement[]; }; declare type TypeRouterState = { url: string; isAjaxLoading: boolean; isNeedAjax: boolean; loadingPercent?: string; }; declare type TypeRouterInjectService = { data?: any; }; declare type TypeRouterContextType = { renderStore: IPropCheckRule; }; declare type TypeRouterContext = { renderStore?: { options?: TypeUIRenderOptions; }; }; export declare class Router extends Component { static propType: TypeRouterPropRule; static contextType: TypeRouterContextType; currentPage: any; firstCheck: boolean; props: TypeRouterProps; state: TypeRouterState; model: TypeRouterInjectService; context: TypeRouterContext; protected router: IRouter; private sourceRouters; private redux; constructor(props: TypeRouterProps, context: { [P in keyof TypeRouterContextType]: any; }); $willMount(): void; $onPropsChanged(props: TypeRouterProps): void; $inject(): void; onRouterChanged(newUrl: string, oldUrl: string, param: any): void; render(): string; } export * from "./withRoter";