@tramvai/tokens-router 2.7.1 → 2.20.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 +11 -11
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import type { AbstractRouter, NavigationGuard, Route, Navigation, NavigationRoute, NavigateOptions, UpdateCurrentRouteOptions, HistoryOptions } from '@tinkoff/router';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TramvaiComponent } from '@tramvai/react';
|
|
3
3
|
/**
|
|
4
4
|
* @description
|
|
5
5
|
* Token to access the router instance
|
|
6
6
|
*/
|
|
7
|
-
export declare const ROUTER_TOKEN: import("@tinkoff/dippy
|
|
7
|
+
export declare const ROUTER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<AbstractRouter>;
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
10
|
* Token for defining static routes
|
|
11
11
|
*/
|
|
12
|
-
export declare const ROUTES_TOKEN: import("@tinkoff/dippy
|
|
12
|
+
export declare const ROUTES_TOKEN: import("@tinkoff/dippy").MultiTokenInterface<Route | Route[]>;
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
15
15
|
* Token for providing guard handlers for page transitions
|
|
16
16
|
*/
|
|
17
|
-
export declare const ROUTER_GUARD_TOKEN: import("@tinkoff/dippy
|
|
17
|
+
export declare const ROUTER_GUARD_TOKEN: import("@tinkoff/dippy").MultiTokenInterface<NavigationGuard>;
|
|
18
18
|
/**
|
|
19
19
|
* @description
|
|
20
20
|
* Encapsulates the logic of working with the router - contains methods for getting the configuration of the route and performing navigation
|
|
21
21
|
*/
|
|
22
|
-
export declare const PAGE_SERVICE_TOKEN: import("@tinkoff/dippy
|
|
22
|
+
export declare const PAGE_SERVICE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<PageService>;
|
|
23
23
|
/**
|
|
24
24
|
* @description
|
|
25
25
|
* Hook to resolve route dynamically
|
|
26
26
|
*/
|
|
27
|
-
export declare const ROUTE_RESOLVE_TOKEN: import("@tinkoff/dippy
|
|
27
|
+
export declare const ROUTE_RESOLVE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<RouteResolve>;
|
|
28
28
|
/**
|
|
29
29
|
* @description
|
|
30
30
|
* Hook to transform route config
|
|
31
31
|
*/
|
|
32
|
-
export declare const ROUTE_TRANSFORM_TOKEN: import("@tinkoff/dippy
|
|
32
|
+
export declare const ROUTE_TRANSFORM_TOKEN: import("@tinkoff/dippy").MultiTokenInterface<RouteTransform>;
|
|
33
33
|
/**
|
|
34
34
|
* @description
|
|
35
35
|
* Flag for SPA-transitions, indicating that actions must be executed before or after a route update in the stor
|
|
36
36
|
*/
|
|
37
|
-
export declare const ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN: import("@tinkoff/dippy
|
|
37
|
+
export declare const ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<"before" | "after">;
|
|
38
38
|
export interface PageService {
|
|
39
39
|
getCurrentRoute(): NavigationRoute;
|
|
40
40
|
getCurrentUrl(): ReturnType<AbstractRouter['getCurrentUrl']>;
|
|
@@ -49,9 +49,9 @@ export interface PageService {
|
|
|
49
49
|
back(options?: HistoryOptions): Promise<void>;
|
|
50
50
|
forward(): Promise<void>;
|
|
51
51
|
go(to: number, options?: HistoryOptions): Promise<void>;
|
|
52
|
-
addComponent(name: string, component:
|
|
53
|
-
getComponent(name: string):
|
|
54
|
-
resolveComponentFromConfig(property: 'page' | 'layout' | 'header' | 'footer' | 'errorBoundary'):
|
|
52
|
+
addComponent(name: string, component: TramvaiComponent): void;
|
|
53
|
+
getComponent(name: string): TramvaiComponent;
|
|
54
|
+
resolveComponentFromConfig(property: 'page' | 'layout' | 'header' | 'footer' | 'errorBoundary'): TramvaiComponent | undefined;
|
|
55
55
|
}
|
|
56
56
|
export declare type RouteResolve = (navigation: Navigation) => Promise<Route | void>;
|
|
57
57
|
export declare type RouteTransform = (route: Route) => Route;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-router",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"description": "Tramvai tokens for @tramvai/module-router",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"build-for-publish": "true"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tinkoff/router": "0.2.
|
|
23
|
-
"@tramvai/tokens-common": "2.
|
|
22
|
+
"@tinkoff/router": "0.2.2",
|
|
23
|
+
"@tramvai/tokens-common": "2.20.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@tinkoff/dippy": "0.
|
|
26
|
+
"@tinkoff/dippy": "0.8.2",
|
|
27
27
|
"tslib": "^2.0.3"
|
|
28
28
|
},
|
|
29
29
|
"license": "Apache-2.0"
|