@tramvai/tokens-router 2.40.0 → 2.45.0

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/lib/index.d.ts CHANGED
@@ -35,6 +35,8 @@ export declare const ROUTE_TRANSFORM_TOKEN: import("@tinkoff/dippy").MultiTokenI
35
35
  * Flag for SPA-transitions, indicating that actions must be executed before or after a route update in the stor
36
36
  */
37
37
  export declare const ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<"before" | "after">;
38
+ export declare const LINK_PREFETCH_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<LinkPrefetchManager>;
39
+ export type PageServiceComponentType = 'page' | 'layout' | 'nestedLayout' | 'header' | 'footer' | 'errorBoundary';
38
40
  export interface PageService {
39
41
  getCurrentRoute(): NavigationRoute;
40
42
  getCurrentUrl(): ReturnType<AbstractRouter['getCurrentUrl']>;
@@ -50,8 +52,11 @@ export interface PageService {
50
52
  forward(): Promise<void>;
51
53
  go(to: number, options?: HistoryOptions): Promise<void>;
52
54
  addComponent(name: string, component: TramvaiComponent): void;
53
- getComponent(name: string): TramvaiComponent;
54
- resolveComponentFromConfig(property: 'page' | 'layout' | 'header' | 'footer' | 'errorBoundary'): TramvaiComponent | undefined;
55
+ getComponent(name: string): TramvaiComponent | undefined;
56
+ resolveComponentFromConfig(property: PageServiceComponentType): TramvaiComponent | undefined;
57
+ }
58
+ export type RouteResolve = (navigation: Navigation) => Promise<Route | void>;
59
+ export type RouteTransform = (route: Route) => Route;
60
+ export interface LinkPrefetchManager {
61
+ prefetch(url: string): Promise<void>;
55
62
  }
56
- export declare type RouteResolve = (navigation: Navigation) => Promise<Route | void>;
57
- export declare type RouteTransform = (route: Route) => Route;
package/lib/index.es.js CHANGED
@@ -37,5 +37,6 @@ const ROUTE_TRANSFORM_TOKEN = createToken('router routeTransform', {
37
37
  * Flag for SPA-transitions, indicating that actions must be executed before or after a route update in the stor
38
38
  */
39
39
  const ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN = createToken('router spaRunMode');
40
+ const LINK_PREFETCH_MANAGER_TOKEN = createToken('link prefetch manager');
40
41
 
41
- export { PAGE_SERVICE_TOKEN, ROUTER_GUARD_TOKEN, ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN, ROUTER_TOKEN, ROUTES_TOKEN, ROUTE_RESOLVE_TOKEN, ROUTE_TRANSFORM_TOKEN };
42
+ export { LINK_PREFETCH_MANAGER_TOKEN, PAGE_SERVICE_TOKEN, ROUTER_GUARD_TOKEN, ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN, ROUTER_TOKEN, ROUTES_TOKEN, ROUTE_RESOLVE_TOKEN, ROUTE_TRANSFORM_TOKEN };
package/lib/index.js CHANGED
@@ -41,7 +41,9 @@ const ROUTE_TRANSFORM_TOKEN = dippy.createToken('router routeTransform', {
41
41
  * Flag for SPA-transitions, indicating that actions must be executed before or after a route update in the stor
42
42
  */
43
43
  const ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN = dippy.createToken('router spaRunMode');
44
+ const LINK_PREFETCH_MANAGER_TOKEN = dippy.createToken('link prefetch manager');
44
45
 
46
+ exports.LINK_PREFETCH_MANAGER_TOKEN = LINK_PREFETCH_MANAGER_TOKEN;
45
47
  exports.PAGE_SERVICE_TOKEN = PAGE_SERVICE_TOKEN;
46
48
  exports.ROUTER_GUARD_TOKEN = ROUTER_GUARD_TOKEN;
47
49
  exports.ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN = ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-router",
3
- "version": "2.40.0",
3
+ "version": "2.45.0",
4
4
  "description": "Tramvai tokens for @tramvai/module-router",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.es.js",
@@ -19,8 +19,8 @@
19
19
  "build-for-publish": "true"
20
20
  },
21
21
  "dependencies": {
22
- "@tinkoff/router": "0.2.4",
23
- "@tramvai/tokens-common": "2.40.0"
22
+ "@tinkoff/router": "0.2.5",
23
+ "@tramvai/tokens-common": "2.45.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@tinkoff/dippy": "0.8.9",