UNPKG

2.13 kBTypeScriptView Raw
1import { InjectionToken } from '@angular/core';
2import { Selector } from '@ngrx/store';
3import { RouterReducerState } from './reducer';
4import { BaseRouterStoreState, RouterStateSerializer } from './serializers/base';
5import { SerializedRouterStateSnapshot } from './serializers/full_serializer';
6export declare type StateKeyOrSelector<T extends BaseRouterStoreState = SerializedRouterStateSnapshot> = string | Selector<any, RouterReducerState<T>>;
7export declare enum NavigationActionTiming {
8 PreActivation = 1,
9 PostActivation = 2
10}
11export declare const DEFAULT_ROUTER_FEATURENAME = "router";
12export declare const _ROUTER_CONFIG: InjectionToken<unknown>;
13export declare const ROUTER_CONFIG: InjectionToken<unknown>;
14/**
15 * Minimal = Serializes the router event with MinimalRouterStateSerializer
16 * Full = Serializes the router event with FullRouterStateSerializer
17 */
18export declare const enum RouterState {
19 Full = 0,
20 Minimal = 1
21}
22export declare function _createRouterConfig(config: StoreRouterConfig): StoreRouterConfig;
23export interface StoreRouterConfig<T extends BaseRouterStoreState = SerializedRouterStateSnapshot> {
24 stateKey?: StateKeyOrSelector<T>;
25 serializer?: new (...args: any[]) => RouterStateSerializer;
26 /**
27 * By default, ROUTER_NAVIGATION is dispatched before guards and resolvers run.
28 * Therefore, the action could run too soon, for example
29 * there may be a navigation cancel due to a guard saying the navigation is not allowed.
30 * To run ROUTER_NAVIGATION after guards and resolvers,
31 * set this property to NavigationActionTiming.PostActivation.
32 */
33 navigationActionTiming?: NavigationActionTiming;
34 /**
35 * Decides which router serializer should be used, if there is none provided, and the metadata on the dispatched @ngrx/router-store action payload.
36 * Set to `Minimal` to use the `MinimalRouterStateSerializer` and to set a minimal router event with the navigation id and url as payload.
37 * Set to `Full` to use the `FullRouterStateSerializer` and to set the angular router events as payload.
38 */
39 routerState?: RouterState;
40}