1 | import NavigationBarHandler from './navigation-bar';
|
2 | import type { PageInstance } from '@tarojs/runtime';
|
3 | import type { PageConfig, RouterAnimate } from '@tarojs/taro';
|
4 | import type { History } from 'history';
|
5 | import type { Route, SpaRouterConfig } from '../../types/router';
|
6 | export default class PageHandler {
|
7 | history: History;
|
8 | config: SpaRouterConfig;
|
9 | protected readonly defaultAnimation: RouterAnimate;
|
10 | protected unloadTimer: ReturnType<typeof setTimeout> | null;
|
11 | protected hideTimer: ReturnType<typeof setTimeout> | null;
|
12 | protected lastHidePage: HTMLElement | null;
|
13 | protected lastUnloadPage: PageInstance | null;
|
14 | protected navigationBarHandler: NavigationBarHandler;
|
15 | homePage: string;
|
16 | originHomePage: string;
|
17 | constructor(config: SpaRouterConfig, history: History);
|
18 | get currentPage(): string;
|
19 | get appId(): string;
|
20 | get router(): import("../../types/router").Router;
|
21 | get routerMode(): "hash" | "browser" | "multi";
|
22 | get customRoutes(): Record<string, string | string[]>;
|
23 | get routes(): Route[];
|
24 | get tabBarList(): import("@tarojs/taro").TabBarItem[];
|
25 | get PullDownRefresh(): any;
|
26 | get animation(): boolean | RouterAnimate;
|
27 | get animationDelay(): number;
|
28 | get animationDuration(): number;
|
29 | set pathname(p: string);
|
30 | get pathname(): string;
|
31 | get originPathname(): string;
|
32 | get basename(): string;
|
33 | get pageConfig(): Route | undefined;
|
34 | isTabBar(pathname: string): boolean;
|
35 | isDefaultNavigationStyle(): boolean;
|
36 | isSamePage(page?: PageInstance | null): boolean;
|
37 | get search(): string;
|
38 | get usingWindowScroll(): boolean;
|
39 | getQuery(stamp?: string, search?: string, options?: Record<string, unknown>): {
|
40 | [x: string]: unknown;
|
41 | };
|
42 | mount(): void;
|
43 | onReady(page: PageInstance, onLoad?: boolean): void;
|
44 | load(page: PageInstance, pageConfig: Route | undefined, stampId: string, pageNo?: number): void;
|
45 | unload(page?: PageInstance | null, delta?: number, top?: boolean): void;
|
46 | show(page?: PageInstance | null, pageConfig?: Route, pageNo?: number): void;
|
47 | hide(page?: PageInstance | null, animation?: boolean): void;
|
48 | addAnimation(pageEl?: HTMLElement | null, first?: boolean): void;
|
49 | getPageContainer(page?: PageInstance | null): HTMLElement | null;
|
50 | getScrollingElement(page?: PageInstance | null): (Window & typeof globalThis) | HTMLElement;
|
51 | bindPageEvents(page: PageInstance, config?: Partial<PageConfig>): void;
|
52 | triggerRouterChange(): void;
|
53 | }
|