UNPKG

2.01 kBTypeScriptView Raw
1import { ModuleWithProviders } from '@angular/core';
2import { BaseRouterStoreState } from './serializers/base';
3import { SerializedRouterStateSnapshot } from './serializers/full_serializer';
4import { StoreRouterConfig } from './router_store_config';
5import * as i0 from "@angular/core";
6/**
7 * Connects RouterModule with StoreModule.
8 *
9 * During the navigation, before any guards or resolvers run, the router will dispatch
10 * a ROUTER_NAVIGATION action, which has the following signature:
11 *
12 * ```
13 * export type RouterNavigationPayload = {
14 * routerState: SerializedRouterStateSnapshot,
15 * event: RoutesRecognized
16 * }
17 * ```
18 *
19 * Either a reducer or an effect can be invoked in response to this action.
20 * If the invoked reducer throws, the navigation will be canceled.
21 *
22 * If navigation gets canceled because of a guard, a ROUTER_CANCEL action will be
23 * dispatched. If navigation results in an error, a ROUTER_ERROR action will be dispatched.
24 *
25 * Both ROUTER_CANCEL and ROUTER_ERROR contain the store state before the navigation
26 * which can be used to restore the consistency of the store.
27 *
28 * Usage:
29 *
30 * ```typescript
31 * @NgModule({
32 * declarations: [AppCmp, SimpleCmp],
33 * imports: [
34 * BrowserModule,
35 * StoreModule.forRoot(mapOfReducers),
36 * RouterModule.forRoot([
37 * { path: '', component: SimpleCmp },
38 * { path: 'next', component: SimpleCmp }
39 * ]),
40 * StoreRouterConnectingModule.forRoot()
41 * ],
42 * bootstrap: [AppCmp]
43 * })
44 * export class AppModule {
45 * }
46 * ```
47 */
48export declare class StoreRouterConnectingModule {
49 static forRoot<T extends BaseRouterStoreState = SerializedRouterStateSnapshot>(config?: StoreRouterConfig<T>): ModuleWithProviders<StoreRouterConnectingModule>;
50 static ɵfac: i0.ɵɵFactoryDeclaration<StoreRouterConnectingModule, never>;
51 static ɵmod: i0.ɵɵNgModuleDeclaration<StoreRouterConnectingModule, never, never, never>;
52 static ɵinj: i0.ɵɵInjectorDeclaration<StoreRouterConnectingModule>;
53}