@tramvai/tokens-router 1.30.1 → 1.32.1
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 +9 -7
- package/lib/index.es.js +7 -7
- package/lib/index.js +7 -7
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import type { AbstractRouter, NavigationGuard, Route, Navigation, NavigationRoute, NavigateOptions, UpdateCurrentRouteOptions, HistoryOptions } from '@tinkoff/router';
|
|
2
2
|
/**
|
|
3
3
|
* @description
|
|
4
|
-
*
|
|
4
|
+
* Token to access the router instance
|
|
5
5
|
*/
|
|
6
6
|
export declare const ROUTER_TOKEN: AbstractRouter;
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
9
|
-
*
|
|
9
|
+
* Token for defining static routes
|
|
10
10
|
*/
|
|
11
11
|
export declare const ROUTES_TOKEN: Route;
|
|
12
12
|
/**
|
|
13
13
|
* @description
|
|
14
|
-
*
|
|
14
|
+
* Token for providing guard handlers for page transitions
|
|
15
15
|
*/
|
|
16
16
|
export declare const ROUTER_GUARD_TOKEN: NavigationGuard;
|
|
17
17
|
/**
|
|
18
18
|
* @description
|
|
19
|
-
*
|
|
19
|
+
* Encapsulates the logic of working with the router - contains methods for getting the configuration of the route and performing navigation
|
|
20
20
|
*/
|
|
21
21
|
export declare const PAGE_SERVICE_TOKEN: PageService;
|
|
22
22
|
/**
|
|
23
23
|
* @description
|
|
24
|
-
*
|
|
24
|
+
* Hook to resolve route dynamically
|
|
25
25
|
*/
|
|
26
26
|
export declare const ROUTE_RESOLVE_TOKEN: RouteResolve;
|
|
27
27
|
/**
|
|
28
28
|
* @description
|
|
29
|
-
*
|
|
29
|
+
* Hook to transform route config
|
|
30
30
|
*/
|
|
31
31
|
export declare const ROUTE_TRANSFORM_TOKEN: RouteTransform;
|
|
32
32
|
/**
|
|
33
33
|
* @description
|
|
34
|
-
*
|
|
34
|
+
* Flag for SPA-transitions, indicating that actions must be executed before or after a route update in the stor
|
|
35
35
|
*/
|
|
36
36
|
export declare const ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN: "before" | "after";
|
|
37
37
|
export interface PageService {
|
|
@@ -48,6 +48,8 @@ export interface PageService {
|
|
|
48
48
|
back(options?: HistoryOptions): Promise<void>;
|
|
49
49
|
forward(): Promise<void>;
|
|
50
50
|
go(to: number, options?: HistoryOptions): Promise<void>;
|
|
51
|
+
addComponent(name: string, component: any): void;
|
|
52
|
+
getComponent(name: string): any;
|
|
51
53
|
}
|
|
52
54
|
export declare type RouteResolve = (navigation: Navigation) => Promise<Route | void>;
|
|
53
55
|
export declare type RouteTransform = (route: Route) => Route;
|
package/lib/index.es.js
CHANGED
|
@@ -2,39 +2,39 @@ import { createToken } from '@tinkoff/dippy';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @description
|
|
5
|
-
*
|
|
5
|
+
* Token to access the router instance
|
|
6
6
|
*/
|
|
7
7
|
const ROUTER_TOKEN = createToken('router router');
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
|
-
*
|
|
10
|
+
* Token for defining static routes
|
|
11
11
|
*/
|
|
12
12
|
const ROUTES_TOKEN = createToken('router routes', { multi: true });
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
15
|
-
*
|
|
15
|
+
* Token for providing guard handlers for page transitions
|
|
16
16
|
*/
|
|
17
17
|
const ROUTER_GUARD_TOKEN = createToken('router guard', { multi: true });
|
|
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
22
|
const PAGE_SERVICE_TOKEN = createToken('router pageService');
|
|
23
23
|
/**
|
|
24
24
|
* @description
|
|
25
|
-
*
|
|
25
|
+
* Hook to resolve route dynamically
|
|
26
26
|
*/
|
|
27
27
|
const ROUTE_RESOLVE_TOKEN = createToken('router routeResolve');
|
|
28
28
|
/**
|
|
29
29
|
* @description
|
|
30
|
-
*
|
|
30
|
+
* Hook to transform route config
|
|
31
31
|
*/
|
|
32
32
|
const ROUTE_TRANSFORM_TOKEN = createToken('router routeTransform', {
|
|
33
33
|
multi: true,
|
|
34
34
|
});
|
|
35
35
|
/**
|
|
36
36
|
* @description
|
|
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
40
|
|
package/lib/index.js
CHANGED
|
@@ -6,39 +6,39 @@ var dippy = require('@tinkoff/dippy');
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
9
|
-
*
|
|
9
|
+
* Token to access the router instance
|
|
10
10
|
*/
|
|
11
11
|
const ROUTER_TOKEN = dippy.createToken('router router');
|
|
12
12
|
/**
|
|
13
13
|
* @description
|
|
14
|
-
*
|
|
14
|
+
* Token for defining static routes
|
|
15
15
|
*/
|
|
16
16
|
const ROUTES_TOKEN = dippy.createToken('router routes', { multi: true });
|
|
17
17
|
/**
|
|
18
18
|
* @description
|
|
19
|
-
*
|
|
19
|
+
* Token for providing guard handlers for page transitions
|
|
20
20
|
*/
|
|
21
21
|
const ROUTER_GUARD_TOKEN = dippy.createToken('router guard', { multi: true });
|
|
22
22
|
/**
|
|
23
23
|
* @description
|
|
24
|
-
*
|
|
24
|
+
* Encapsulates the logic of working with the router - contains methods for getting the configuration of the route and performing navigation
|
|
25
25
|
*/
|
|
26
26
|
const PAGE_SERVICE_TOKEN = dippy.createToken('router pageService');
|
|
27
27
|
/**
|
|
28
28
|
* @description
|
|
29
|
-
*
|
|
29
|
+
* Hook to resolve route dynamically
|
|
30
30
|
*/
|
|
31
31
|
const ROUTE_RESOLVE_TOKEN = dippy.createToken('router routeResolve');
|
|
32
32
|
/**
|
|
33
33
|
* @description
|
|
34
|
-
*
|
|
34
|
+
* Hook to transform route config
|
|
35
35
|
*/
|
|
36
36
|
const ROUTE_TRANSFORM_TOKEN = dippy.createToken('router routeTransform', {
|
|
37
37
|
multi: true,
|
|
38
38
|
});
|
|
39
39
|
/**
|
|
40
40
|
* @description
|
|
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
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.1",
|
|
4
4
|
"description": "Tramvai tokens for @tramvai/module-router",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"build-for-publish": "true"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tinkoff/router": "0.1.
|
|
22
|
+
"@tinkoff/router": "0.1.62"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@tinkoff/dippy": "0.7.35",
|