1 | import { Action, createBrowserHistory, createHashHistory } from 'history';
|
2 | import type { IH5RouterConfig } from '@tarojs/taro/types/compile';
|
3 | import type { Blocker, BrowserHistoryOptions, HashHistoryOptions, History, Listener, Location, Path, To } from 'history';
|
4 | import type { StateEvent } from '../types/history';
|
5 | export declare let history: History;
|
6 | declare class MpaHistory implements History {
|
7 | action: Action;
|
8 | get location(): Location;
|
9 | createHref(_to: To): string;
|
10 | parseUrl(to: Partial<Path>): string;
|
11 | push(to: Partial<Path>, _state?: Record<string, unknown>): void;
|
12 | replace(to: Partial<Path>, _state?: Record<string, unknown>): void;
|
13 | go(delta: number): void;
|
14 | back: () => void;
|
15 | forward: () => void;
|
16 | listen(listener: Listener): () => void;
|
17 | block(_blocker: Blocker): () => void;
|
18 | pushState: globalThis.History['pushState'];
|
19 | replaceState: globalThis.History['replaceState'];
|
20 | eventState(action: Required<StateEvent>['action']): (data: any, unused: string, url?: string | URL | null) => any;
|
21 | }
|
22 | export declare function setHistory(h: History, base?: string): void;
|
23 | export declare function createMpaHistory(_?: HashHistoryOptions | BrowserHistoryOptions): MpaHistory;
|
24 | export { createBrowserHistory, createHashHistory };
|
25 | export declare function setHistoryMode(mode?: IH5RouterConfig['mode'], base?: string): void;
|
26 | export declare function prependBasename(url?: string): string;
|