@tramvai/module-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/README.md +5 -5
- package/lib/modules/fileSystemPages.d.ts +2 -2
- package/lib/modules/server.d.ts +1 -1
- package/lib/modules/tokens.d.ts +10 -10
- package/lib/services/page.d.ts +4 -4
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -238,7 +238,7 @@ const providers = [
|
|
|
238
238
|
In this case, it is best to use the [PAGE_SERVICE_TOKEN](#page_service_token)
|
|
239
239
|
|
|
240
240
|
```ts
|
|
241
|
-
import { provide,
|
|
241
|
+
import { provide, declareAction } from '@tramvai/core';
|
|
242
242
|
import { PAGE_SERVICE_TOKEN } from '@tramvai/module-router';
|
|
243
243
|
|
|
244
244
|
const provider = provide({
|
|
@@ -253,11 +253,11 @@ const provider = provide({
|
|
|
253
253
|
},
|
|
254
254
|
});
|
|
255
255
|
|
|
256
|
-
const action =
|
|
256
|
+
const action = declareAction({
|
|
257
257
|
name: 'action',
|
|
258
|
-
fn
|
|
259
|
-
if (pageService.getConfig().pageComponent === 'pageComponent') {
|
|
260
|
-
return
|
|
258
|
+
fn() {
|
|
259
|
+
if (this.deps.pageService.getConfig().pageComponent === 'pageComponent') {
|
|
260
|
+
return this.deps.pageService.updateCurrentRoute({ query: { test: 'true' } });
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
263
|
deps: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const providers: import("@tramvai/core").Provider<{
|
|
2
|
-
logger: import("@tinkoff/dippy
|
|
3
|
-
}, import("@tinkoff/dippy
|
|
2
|
+
logger: import("@tinkoff/dippy").BaseTokenInterface<import("@tramvai/tokens-common").LoggerFactory>;
|
|
3
|
+
}, import("@tinkoff/dippy").MultiTokenInterface<import("@tinkoff/router").Route | import("@tinkoff/router").Route[]>>[];
|
package/lib/modules/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare class NoSpaRouterModule {
|
|
2
2
|
static forRoot: (routes: import("@tinkoff/router").Route[], options?: {
|
|
3
|
-
spaActionsMode?: import("@tinkoff/dippy
|
|
3
|
+
spaActionsMode?: import("@tinkoff/dippy").BaseTokenInterface<"before" | "after">;
|
|
4
4
|
}) => {
|
|
5
5
|
mainModule: typeof NoSpaRouterModule;
|
|
6
6
|
providers: import("@tramvai/core").Provider<any, any>[];
|
package/lib/modules/tokens.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { NavigationHook, AbstractRouter, NavigationSyncHook, Route } from '@tinkoff/router';
|
|
2
|
-
export declare const routerClassToken: import("@tinkoff/dippy
|
|
3
|
-
export declare const additionalRouterParameters: import("@tinkoff/dippy
|
|
4
|
-
export declare const onChangeHooksToken: import("@tinkoff/dippy
|
|
5
|
-
export declare const beforeResolveHooksToken: import("@tinkoff/dippy
|
|
6
|
-
export declare const beforeNavigateHooksToken: import("@tinkoff/dippy
|
|
7
|
-
export declare const afterNavigateHooksToken: import("@tinkoff/dippy
|
|
8
|
-
export declare const beforeUpdateCurrentHooksToken: import("@tinkoff/dippy
|
|
9
|
-
export declare const afterUpdateCurrentHooksToken: import("@tinkoff/dippy
|
|
10
|
-
export declare const routeTransformToken: import("@tinkoff/dippy
|
|
11
|
-
export declare const routerBundleInfoAdditionalToken: import("@tinkoff/dippy
|
|
2
|
+
export declare const routerClassToken: import("@tinkoff/dippy").BaseTokenInterface<AbstractRouter>;
|
|
3
|
+
export declare const additionalRouterParameters: import("@tinkoff/dippy").BaseTokenInterface<Record<string, any>>;
|
|
4
|
+
export declare const onChangeHooksToken: import("@tinkoff/dippy").MultiTokenInterface<NavigationSyncHook>;
|
|
5
|
+
export declare const beforeResolveHooksToken: import("@tinkoff/dippy").MultiTokenInterface<NavigationHook>;
|
|
6
|
+
export declare const beforeNavigateHooksToken: import("@tinkoff/dippy").MultiTokenInterface<NavigationHook>;
|
|
7
|
+
export declare const afterNavigateHooksToken: import("@tinkoff/dippy").MultiTokenInterface<NavigationHook>;
|
|
8
|
+
export declare const beforeUpdateCurrentHooksToken: import("@tinkoff/dippy").MultiTokenInterface<NavigationHook>;
|
|
9
|
+
export declare const afterUpdateCurrentHooksToken: import("@tinkoff/dippy").MultiTokenInterface<NavigationHook>;
|
|
10
|
+
export declare const routeTransformToken: import("@tinkoff/dippy").BaseTokenInterface<import("@tinkoff/dippy").MultiTokenInterface<import("@tramvai/tokens-router").RouteTransform>>;
|
|
11
|
+
export declare const routerBundleInfoAdditionalToken: import("@tinkoff/dippy").BaseTokenInterface<() => Promise<Route[]>>;
|
package/lib/services/page.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Url } from '@tinkoff/url';
|
|
2
2
|
import type { NavigationRoute, NavigateOptions, UpdateCurrentRouteOptions, HistoryOptions } from '@tinkoff/router';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TramvaiComponent } from '@tramvai/react';
|
|
4
4
|
import type { PAGE_SERVICE_TOKEN } from '@tramvai/tokens-router';
|
|
5
5
|
declare type PageServiceInterface = typeof PAGE_SERVICE_TOKEN;
|
|
6
6
|
export declare class PageService implements PageServiceInterface {
|
|
@@ -20,9 +20,9 @@ export declare class PageService implements PageServiceInterface {
|
|
|
20
20
|
back(options?: HistoryOptions): Promise<void>;
|
|
21
21
|
forward(): Promise<void>;
|
|
22
22
|
go(to: number, options?: HistoryOptions): Promise<void>;
|
|
23
|
-
addComponent(name: string, component:
|
|
24
|
-
getComponent(name: string):
|
|
25
|
-
resolveComponentFromConfig(property: 'page' | 'layout' | 'header' | 'footer' | 'errorBoundary'):
|
|
23
|
+
addComponent(name: string, component: TramvaiComponent): void;
|
|
24
|
+
getComponent(name: string): TramvaiComponent | undefined;
|
|
25
|
+
resolveComponentFromConfig(property: 'page' | 'layout' | 'header' | 'footer' | 'errorBoundary'): TramvaiComponent;
|
|
26
26
|
private getComponentsGroupName;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-router",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"browser": {
|
|
@@ -22,27 +22,27 @@
|
|
|
22
22
|
"build-for-publish": "true"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@tinkoff/errors": "0.2
|
|
26
|
-
"@tinkoff/router": "0.2.
|
|
27
|
-
"@tinkoff/url": "0.
|
|
28
|
-
"@tramvai/tokens-child-app": "2.
|
|
29
|
-
"@tramvai/tokens-render": "2.
|
|
30
|
-
"@tramvai/tokens-router": "2.
|
|
31
|
-
"@tramvai/tokens-server": "2.
|
|
32
|
-
"@tramvai/experiments": "2.
|
|
25
|
+
"@tinkoff/errors": "0.3.2",
|
|
26
|
+
"@tinkoff/router": "0.2.2",
|
|
27
|
+
"@tinkoff/url": "0.8.2",
|
|
28
|
+
"@tramvai/tokens-child-app": "2.20.0",
|
|
29
|
+
"@tramvai/tokens-render": "2.20.0",
|
|
30
|
+
"@tramvai/tokens-router": "2.20.0",
|
|
31
|
+
"@tramvai/tokens-server": "2.20.0",
|
|
32
|
+
"@tramvai/experiments": "2.20.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@tinkoff/utils": "^2.1.2",
|
|
36
|
-
"@tramvai/cli": "2.
|
|
37
|
-
"@tramvai/core": "2.
|
|
38
|
-
"@tramvai/module-log": "2.
|
|
39
|
-
"@tramvai/module-server": "2.
|
|
40
|
-
"@tramvai/papi": "2.
|
|
41
|
-
"@tramvai/state": "2.
|
|
42
|
-
"@tramvai/test-helpers": "2.
|
|
43
|
-
"@tramvai/test-mocks": "2.
|
|
44
|
-
"@tramvai/tokens-common": "2.
|
|
45
|
-
"@tinkoff/dippy": "0.
|
|
36
|
+
"@tramvai/cli": "2.20.0",
|
|
37
|
+
"@tramvai/core": "2.20.0",
|
|
38
|
+
"@tramvai/module-log": "2.20.0",
|
|
39
|
+
"@tramvai/module-server": "2.20.0",
|
|
40
|
+
"@tramvai/papi": "2.20.0",
|
|
41
|
+
"@tramvai/state": "2.20.0",
|
|
42
|
+
"@tramvai/test-helpers": "2.20.0",
|
|
43
|
+
"@tramvai/test-mocks": "2.20.0",
|
|
44
|
+
"@tramvai/tokens-common": "2.20.0",
|
|
45
|
+
"@tinkoff/dippy": "0.8.2",
|
|
46
46
|
"react": "*",
|
|
47
47
|
"tslib": "^2.0.3"
|
|
48
48
|
},
|