UNPKG

cyra-pure

Version:

single page application view engine

36 lines (35 loc) 1.15 kB
import { Page } from './Page'; import { Route } from './Route'; import { ModelsObject, InitAppObject, RouteData, ContextType } from '../types'; export declare class Cyra { static models: ModelsObject; static pageIndex: number; private static defaultPath; private static currentRoute; private static currentIndex; /** * Context * @property {string} root - 全局容器的css选择器 * @property {Element} rootContainre - 全局容器 * @property {Action} currentAction - 当前动作 */ static context: ContextType; private static startRouting(); private static getRouteByPath(path); static getPageByID(pageID: string, index: number): Page; private static beforeSwitchPage(matchedRoute, hashData); private static switchPage(matchedRoute, hashData); /** * 修正页面历史记录 */ private static cancelSwitch(); /** * @function defineRoute And define page actions * @return {routes} */ static defineRoute(routeData: RouteData): Route[]; /** * @function initApp */ static initApp(obj: InitAppObject): void; }