@tarojs/router 3.6.25 → 3.6.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/history.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { Action, createBrowserHistory, createHashHistory, Blocker, BrowserHistoryOptions, HashHistoryOptions, History, Listener, Location, Path, To } from 'history';
2
1
  import { IH5RouterConfig } from '@tarojs/taro/types/compile';
3
2
  import { StateEvent } from '../types/history';
4
3
  declare let history: History;
@@ -1,17 +1,11 @@
1
- import { History, Action, createBrowserHistory, createHashHistory, Blocker, BrowserHistoryOptions, HashHistoryOptions, Listener, Location, Path, To } from 'history';
2
- import { MpaRouterConfig, SpaRouterConfig } from '../types/router';
3
- import Taro from "@tarojs/taro";
1
+ import { Action, createBrowserHistory, createHashHistory, Blocker, BrowserHistoryOptions, HashHistoryOptions, History, Listener, Location, Path, To } from "history";
4
2
  import { IH5RouterConfig } from "@tarojs/taro/types/compile";
5
3
  import { StateEvent } from "../types/history";
4
+ import { MpaRouterConfig, SpaRouterConfig } from '../types/router';
5
+ import Taro from "@tarojs/taro";
6
6
  import { AppInstance } from "@tarojs/runtime";
7
7
  import { MpaRouterConfig as MpaRouterConfig$0 } from "../../types/router";
8
8
  import { SpaRouterConfig as SpaRouterConfig$0 } from "../../types/router";
9
- declare function navigateTo(option: Taro.navigateTo.Option): ReturnType<typeof Taro.navigateTo>;
10
- declare function redirectTo(option: Taro.redirectTo.Option): ReturnType<typeof Taro.redirectTo>;
11
- declare function navigateBack(option?: Taro.navigateBack.Option): ReturnType<typeof Taro.navigateBack>;
12
- declare function switchTab(option: Taro.switchTab.Option): ReturnType<typeof Taro.switchTab>;
13
- declare function reLaunch(option: Taro.reLaunch.Option): ReturnType<typeof Taro.reLaunch>;
14
- declare function getCurrentPages(): Taro.Page[];
15
9
  declare let history: History;
16
10
  declare class MpaHistory implements History {
17
11
  action: Action;
@@ -33,6 +27,12 @@ declare function setHistory(h: History, base?: string): void;
33
27
  declare function createMpaHistory(_?: HashHistoryOptions | BrowserHistoryOptions): MpaHistory;
34
28
  declare function setHistoryMode(mode?: IH5RouterConfig["mode"], base?: string): void;
35
29
  declare function prependBasename(url?: string): string;
30
+ declare function navigateTo(option: Taro.navigateTo.Option): ReturnType<typeof Taro.navigateTo>;
31
+ declare function redirectTo(option: Taro.redirectTo.Option): ReturnType<typeof Taro.redirectTo>;
32
+ declare function navigateBack(option?: Taro.navigateBack.Option): ReturnType<typeof Taro.navigateBack>;
33
+ declare function switchTab(option: Taro.switchTab.Option): ReturnType<typeof Taro.switchTab>;
34
+ declare function reLaunch(option: Taro.reLaunch.Option): ReturnType<typeof Taro.reLaunch>;
35
+ declare function getCurrentPages(): Taro.Page[];
36
36
  // TODO 支持多路由 (APP 生命周期仅触发一次)
37
37
  /** Note: 关于多页面应用
38
38
  * - 需要配置路由映射(根目录跳转、404 页面……)
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { History } from 'history';
1
+ import { History } from "./history.js";
2
2
  import { MpaRouterConfig, SpaRouterConfig } from '../types/router';
3
3
  declare function handleAppMount(config: SpaRouterConfig | MpaRouterConfig, _: History, appId?: string): void;
4
4
  declare function handleAppMountWithTabbar(config: SpaRouterConfig | MpaRouterConfig, history: History, appId?: string): void;
@@ -1,17 +1,11 @@
1
- import { History, Action, createBrowserHistory, createHashHistory, Blocker, BrowserHistoryOptions, HashHistoryOptions, Listener, Location, Path, To } from 'history';
2
- import { MpaRouterConfig, SpaRouterConfig } from '../types/router';
3
- import Taro from "@tarojs/taro";
1
+ import { Action, createBrowserHistory, createHashHistory, Blocker, BrowserHistoryOptions, HashHistoryOptions, History, Listener, Location, Path, To } from "history";
4
2
  import { IH5RouterConfig } from "@tarojs/taro/types/compile";
5
3
  import { StateEvent } from "../types/history";
4
+ import { MpaRouterConfig, SpaRouterConfig } from '../types/router';
5
+ import Taro from "@tarojs/taro";
6
6
  import { AppInstance } from "@tarojs/runtime";
7
7
  import { MpaRouterConfig as MpaRouterConfig$0 } from "../../types/router";
8
8
  import { SpaRouterConfig as SpaRouterConfig$0 } from "../../types/router";
9
- declare function navigateTo(option: Taro.navigateTo.Option): ReturnType<typeof Taro.navigateTo>;
10
- declare function redirectTo(option: Taro.redirectTo.Option): ReturnType<typeof Taro.redirectTo>;
11
- declare function navigateBack(option?: Taro.navigateBack.Option): ReturnType<typeof Taro.navigateBack>;
12
- declare function switchTab(option: Taro.switchTab.Option): ReturnType<typeof Taro.switchTab>;
13
- declare function reLaunch(option: Taro.reLaunch.Option): ReturnType<typeof Taro.reLaunch>;
14
- declare function getCurrentPages(): Taro.Page[];
15
9
  declare let history: History;
16
10
  declare class MpaHistory implements History {
17
11
  action: Action;
@@ -33,6 +27,12 @@ declare function setHistory(h: History, base?: string): void;
33
27
  declare function createMpaHistory(_?: HashHistoryOptions | BrowserHistoryOptions): MpaHistory;
34
28
  declare function setHistoryMode(mode?: IH5RouterConfig["mode"], base?: string): void;
35
29
  declare function prependBasename(url?: string): string;
30
+ declare function navigateTo(option: Taro.navigateTo.Option): ReturnType<typeof Taro.navigateTo>;
31
+ declare function redirectTo(option: Taro.redirectTo.Option): ReturnType<typeof Taro.redirectTo>;
32
+ declare function navigateBack(option?: Taro.navigateBack.Option): ReturnType<typeof Taro.navigateBack>;
33
+ declare function switchTab(option: Taro.switchTab.Option): ReturnType<typeof Taro.switchTab>;
34
+ declare function reLaunch(option: Taro.reLaunch.Option): ReturnType<typeof Taro.reLaunch>;
35
+ declare function getCurrentPages(): Taro.Page[];
36
36
  // TODO 支持多路由 (APP 生命周期仅触发一次)
37
37
  /** Note: 关于多页面应用
38
38
  * - 需要配置路由映射(根目录跳转、404 页面……)
@@ -4,7 +4,7 @@ declare class RouterConfig {
4
4
  static set config(e: SpaRouterConfig | MpaRouterConfig);
5
5
  static get config(): SpaRouterConfig | MpaRouterConfig;
6
6
  static get pages(): string[];
7
- static get router(): import("taro-router/types/router").Router;
7
+ static get router(): import("../types/router").Router;
8
8
  static get mode(): "hash" | "browser" | "multi";
9
9
  static get customRoutes(): Record<string, string | string[]>;
10
10
  static isPage(url?: string): boolean;
@@ -1,5 +1,5 @@
1
1
  import { AppInstance } from '@tarojs/runtime';
2
- import { History } from 'history';
2
+ import { History } from "../history.js";
3
3
  import { MpaRouterConfig } from '../../types/router';
4
4
  /** Note: 关于多页面应用
5
5
  * - 需要配置路由映射(根目录跳转、404 页面……)
@@ -1,13 +1,13 @@
1
1
  import { PageInstance } from '@tarojs/runtime';
2
2
  import { PageConfig } from '@tarojs/taro';
3
- import { History } from 'history';
3
+ import { History } from "../history.js";
4
4
  import { MpaRouterConfig, Route } from '../../types/router';
5
5
  declare class MultiPageHandler {
6
6
  history: History;
7
7
  protected config: MpaRouterConfig;
8
8
  constructor(config: MpaRouterConfig, history: History);
9
9
  get appId(): string;
10
- get router(): import("taro-router/types/router").Router;
10
+ get router(): import("../types/router").Router;
11
11
  get routerMode(): "hash" | "browser" | "multi";
12
12
  get customRoutes(): Record<string, string | string[]>;
13
13
  get tabBarList(): import("@tarojs/taro").TabBarItem[];
@@ -1,7 +1,7 @@
1
1
  import NavigationBarHandler from "./navigation-bar.js";
2
2
  import { PageInstance } from '@tarojs/runtime';
3
3
  import { PageConfig, RouterAnimate } from '@tarojs/taro';
4
- import { History } from 'history';
4
+ import { History } from "../history.js";
5
5
  import { Route, SpaRouterConfig } from '../../types/router';
6
6
  declare class PageHandler {
7
7
  history: History;
@@ -16,7 +16,7 @@ declare class PageHandler {
16
16
  constructor(config: SpaRouterConfig, history: History);
17
17
  get currentPage(): string;
18
18
  get appId(): string;
19
- get router(): import("taro-router/types/router").Router;
19
+ get router(): import("../types/router").Router;
20
20
  get routerMode(): "hash" | "browser" | "multi";
21
21
  get customRoutes(): Record<string, string | string[]>;
22
22
  get routes(): Route[];
@@ -1,5 +1,5 @@
1
1
  import { AppInstance } from '@tarojs/runtime';
2
- import { History } from 'history';
2
+ import { History } from "../history.js";
3
3
  import { SpaRouterConfig } from '../../types/router';
4
4
  declare function createRouter(history: History, app: AppInstance, config: SpaRouterConfig, framework?: string): () => void;
5
5
  export { createRouter };
package/dist/tabbar.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { AppConfig } from '@tarojs/taro';
2
- import { History } from 'history';
2
+ import { History } from "./history.js";
3
3
  declare function initTabbar(config: AppConfig, history: History): void;
4
4
  export { initTabbar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/router",
3
- "version": "3.6.25",
3
+ "version": "3.6.26",
4
4
  "description": "Taro-router",
5
5
  "browser": "dist/index.js",
6
6
  "main:h5": "dist/index.esm.js",
@@ -44,14 +44,14 @@
44
44
  "rollup-plugin-ts": "^3.0.2",
45
45
  "ts-jest": "^29.0.5",
46
46
  "typescript": "^4.7.4",
47
- "@tarojs/runtime": "3.6.25",
48
- "@tarojs/taro": "3.6.25",
49
- "@tarojs/shared": "3.6.25"
47
+ "@tarojs/taro": "3.6.26",
48
+ "@tarojs/shared": "3.6.26",
49
+ "@tarojs/runtime": "3.6.26"
50
50
  },
51
51
  "peerDependencies": {
52
- "@tarojs/runtime": "3.6.25",
53
- "@tarojs/shared": "3.6.25",
54
- "@tarojs/taro": "3.6.25"
52
+ "@tarojs/runtime": "3.6.26",
53
+ "@tarojs/taro": "3.6.26",
54
+ "@tarojs/shared": "3.6.26"
55
55
  },
56
56
  "scripts": {
57
57
  "prebuild": "pnpm run clean",