ngssm-navigation 19.4.0 → 20.0.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.
@@ -63,10 +63,10 @@ class NavigationReducer {
63
63
  }
64
64
  return state;
65
65
  }
66
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NavigationReducer, deps: [{ token: NGSSM_NAVIGATION_LOCKING_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
67
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NavigationReducer }); }
66
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NavigationReducer, deps: [{ token: NGSSM_NAVIGATION_LOCKING_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
67
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NavigationReducer }); }
68
68
  }
69
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NavigationReducer, decorators: [{
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NavigationReducer, decorators: [{
70
70
  type: Injectable
71
71
  }], ctorParameters: () => [{ type: undefined, decorators: [{
72
72
  type: Inject,
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-navigation.mjs","sources":["../../../projects/ngssm-navigation/src/lib/state/navigation.state.ts","../../../projects/ngssm-navigation/src/lib/guards/navigation-guards.ts","../../../projects/ngssm-navigation/src/lib/actions/navigation-action-type.ts","../../../projects/ngssm-navigation/src/lib/model/navigation-locking-config.ts","../../../projects/ngssm-navigation/src/lib/reducers/navigation.reducer.ts","../../../projects/ngssm-navigation/src/lib/routing/routing-effect.ts","../../../projects/ngssm-navigation/src/lib/provide-ngssm-navigation.ts","../../../projects/ngssm-navigation/src/public-api.ts","../../../projects/ngssm-navigation/src/ngssm-navigation.ts"],"sourcesContent":["import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNavigationState = (state: State): NavigationState =>\n state[NavigationStateSpecification.featureStateKey] as NavigationState;\n\nexport const updateNavigationState = (state: State, command: Spec<NavigationState, never>): State =>\n update(state, {\n [NavigationStateSpecification.featureStateKey]: command\n });\n\nexport interface NavigationState {\n navigationLocked: boolean;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NavigationStateSpecification.featureStateKey,\n initialState: NavigationStateSpecification.initialState\n})\nexport class NavigationStateSpecification {\n public static readonly featureStateKey = 'navigation-state';\n public static readonly initialState: NavigationState = {\n navigationLocked: false\n };\n}\n","import { inject } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { selectNavigationState } from '../state';\n\nexport const isNavigationLocked = (): boolean => {\n const state = inject(Store).state();\n return selectNavigationState(state).navigationLocked;\n};\n\nexport const isNavigationUnLocked = (): boolean => {\n const state = inject(Store).state();\n return !selectNavigationState(state).navigationLocked;\n};\n","export enum NavigationActionType {\n lockNavigation = '[NavigationActionType] lockNavigation',\n unLockNavigation = '[NavigationActionType] unLockNavigation'\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface NavigationLockingConfig {\n actionsLockingNavigation?: string[];\n actionsUnLockingNavigation?: string[];\n}\n\nexport const NGSSM_NAVIGATION_LOCKING_CONFIG = new InjectionToken<NavigationLockingConfig>('NGSSM_NAVIGATION_LOCKING_CONFIG');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NavigationActionType } from '../actions';\nimport { NavigationLockingConfig, NGSSM_NAVIGATION_LOCKING_CONFIG } from '../model';\nimport { updateNavigationState } from '../state';\n\n@Injectable()\nexport class NavigationReducer implements Reducer {\n private readonly lockingActions: Set<string>;\n private readonly unlockingActions: Set<string>;\n\n public readonly processedActions: string[] = [];\n\n constructor(\n @Inject(NGSSM_NAVIGATION_LOCKING_CONFIG)\n @Optional()\n configs: NavigationLockingConfig[]\n ) {\n this.lockingActions = new Set<string>([NavigationActionType.lockNavigation]);\n this.unlockingActions = new Set<string>([NavigationActionType.unLockNavigation]);\n\n (configs ?? []).forEach((config) => {\n (config.actionsLockingNavigation ?? []).forEach((command) => this.lockingActions.add(command));\n (config.actionsUnLockingNavigation ?? []).forEach((command) => this.unlockingActions.add(command));\n });\n\n this.processedActions = [...this.lockingActions, ...this.unlockingActions];\n }\n\n public updateState(state: State, action: Action): State {\n if (this.lockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: true }\n });\n }\n\n if (this.unlockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: false }\n });\n }\n\n return state;\n }\n}\n","import { effect, inject, untracked } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { Logger, Store } from 'ngssm-store';\n\nimport { RoutingAction } from './routing-action';\n\nexport const routingEffectInitializer = async () => {\n const store = inject(Store);\n const router = inject(Router);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n const routingAction = action as RoutingAction;\n if (routingAction.navigate) {\n logger.information(`[Routing Effect] Processing action ${action.type}`);\n try {\n untracked(() => routingAction.navigate?.(store.state(), router));\n logger.information(`[Routing Effect] Successfully navigated for action ${action.type}`);\n } catch (error) {\n logger.error(`[Routing Effect] Error while processing action ${action.type}: ${error}`);\n }\n }\n });\n\n return true;\n};\n","import { EnvironmentProviders, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { provideReducer } from 'ngssm-store';\n\nimport { isNavigationUnLocked } from './guards';\nimport { NavigationReducer } from './reducers/navigation.reducer';\nimport { routingEffectInitializer } from './routing';\n\nconst initializeNavigation = () => {\n inject(Router).config.forEach((route) => {\n route.canDeactivate = [isNavigationUnLocked, ...(route.canDeactivate ?? [])];\n });\n};\n\nexport const provideNgssmNavigation = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideReducer(NavigationReducer),\n provideAppInitializer(initializeNavigation),\n provideAppInitializer(routingEffectInitializer)\n ]);\n};\n","/*\n * Public API Surface of ngssm-navigation\n */\n\nexport * from './lib/provide-ngssm-navigation';\nexport * from './lib/state';\nexport * from './lib/guards';\nexport * from './lib/actions';\nexport * from './lib/model';\nexport * from './lib/routing';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,qBAAqB,GAAG,CAAC,KAAY,KAChD,KAAK,CAAC,4BAA4B,CAAC,eAAe;AAE7C,MAAM,qBAAqB,GAAG,CAAC,KAAY,EAAE,OAAqC,KACvF,MAAM,CAAC,KAAK,EAAE;AACZ,IAAA,CAAC,4BAA4B,CAAC,eAAe,GAAG;AACjD,CAAA;AAUU,IAAA,4BAA4B,GAAlC,MAAM,4BAA4B,CAAA;aAChB,IAAe,CAAA,eAAA,GAAG,kBAAH,CAAsB;AACrC,IAAA,SAAA,IAAA,CAAA,YAAY,GAAoB;AACrD,QAAA,gBAAgB,EAAE;AACnB,KAFkC,CAEjC;;AAJS,4BAA4B,GAAA,UAAA,CAAA;AAJxC,IAAA,iBAAiB,CAAC;QACjB,eAAe,EAAE,4BAA4B,CAAC,eAAe;QAC7D,YAAY,EAAE,4BAA4B,CAAC;KAC5C;AACY,CAAA,EAAA,4BAA4B,CAKxC;;ACnBM,MAAM,kBAAkB,GAAG,MAAc;IAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE;AACnC,IAAA,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC,gBAAgB;AACtD;AAEO,MAAM,oBAAoB,GAAG,MAAc;IAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE;AACnC,IAAA,OAAO,CAAC,qBAAqB,CAAC,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,MAAM,CAAC,CAAC;gBAChE,MAAM,CAAC,WAAW,CAAC,CAAA,mDAAA,EAAsD,MAAM,CAAC,IAAI,CAAE,CAAA,CAAC;;YACvF,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,CAAkD,+CAAA,EAAA,MAAM,CAAC,IAAI,CAAK,EAAA,EAAA,KAAK,CAAE,CAAA,CAAC;;;AAG7F,KAAC,CAAC;AAEF,IAAA,OAAO,IAAI;AACb;;AClBA,MAAM,oBAAoB,GAAG,MAAK;IAChC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACtC,QAAA,KAAK,CAAC,aAAa,GAAG,CAAC,oBAAoB,EAAE,IAAI,KAAK,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;AAC9E,KAAC,CAAC;AACJ,CAAC;AAEM,MAAM,sBAAsB,GAAG,MAA2B;AAC/D,IAAA,OAAO,wBAAwB,CAAC;QAC9B,cAAc,CAAC,iBAAiB,CAAC;QACjC,qBAAqB,CAAC,oBAAoB,CAAC;QAC3C,qBAAqB,CAAC,wBAAwB;AAC/C,KAAA,CAAC;AACJ;;ACrBA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngssm-navigation.mjs","sources":["../../../projects/ngssm-navigation/src/lib/state/navigation.state.ts","../../../projects/ngssm-navigation/src/lib/guards/navigation-guards.ts","../../../projects/ngssm-navigation/src/lib/actions/navigation-action-type.ts","../../../projects/ngssm-navigation/src/lib/model/navigation-locking-config.ts","../../../projects/ngssm-navigation/src/lib/reducers/navigation.reducer.ts","../../../projects/ngssm-navigation/src/lib/routing/routing-effect.ts","../../../projects/ngssm-navigation/src/lib/provide-ngssm-navigation.ts","../../../projects/ngssm-navigation/src/public-api.ts","../../../projects/ngssm-navigation/src/ngssm-navigation.ts"],"sourcesContent":["import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNavigationState = (state: State): NavigationState =>\n state[NavigationStateSpecification.featureStateKey] as NavigationState;\n\nexport const updateNavigationState = (state: State, command: Spec<NavigationState, never>): State =>\n update(state, {\n [NavigationStateSpecification.featureStateKey]: command\n });\n\nexport interface NavigationState {\n navigationLocked: boolean;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NavigationStateSpecification.featureStateKey,\n initialState: NavigationStateSpecification.initialState\n})\nexport class NavigationStateSpecification {\n public static readonly featureStateKey = 'navigation-state';\n public static readonly initialState: NavigationState = {\n navigationLocked: false\n };\n}\n","import { inject } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { selectNavigationState } from '../state';\n\nexport const isNavigationLocked = (): boolean => {\n const state = inject(Store).state();\n return selectNavigationState(state).navigationLocked;\n};\n\nexport const isNavigationUnLocked = (): boolean => {\n const state = inject(Store).state();\n return !selectNavigationState(state).navigationLocked;\n};\n","export enum NavigationActionType {\n lockNavigation = '[NavigationActionType] lockNavigation',\n unLockNavigation = '[NavigationActionType] unLockNavigation'\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface NavigationLockingConfig {\n actionsLockingNavigation?: string[];\n actionsUnLockingNavigation?: string[];\n}\n\nexport const NGSSM_NAVIGATION_LOCKING_CONFIG = new InjectionToken<NavigationLockingConfig>('NGSSM_NAVIGATION_LOCKING_CONFIG');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NavigationActionType } from '../actions';\nimport { NavigationLockingConfig, NGSSM_NAVIGATION_LOCKING_CONFIG } from '../model';\nimport { updateNavigationState } from '../state';\n\n@Injectable()\nexport class NavigationReducer implements Reducer {\n private readonly lockingActions: Set<string>;\n private readonly unlockingActions: Set<string>;\n\n public readonly processedActions: string[] = [];\n\n constructor(\n @Inject(NGSSM_NAVIGATION_LOCKING_CONFIG)\n @Optional()\n configs: NavigationLockingConfig[]\n ) {\n this.lockingActions = new Set<string>([NavigationActionType.lockNavigation]);\n this.unlockingActions = new Set<string>([NavigationActionType.unLockNavigation]);\n\n (configs ?? []).forEach((config) => {\n (config.actionsLockingNavigation ?? []).forEach((command) => this.lockingActions.add(command));\n (config.actionsUnLockingNavigation ?? []).forEach((command) => this.unlockingActions.add(command));\n });\n\n this.processedActions = [...this.lockingActions, ...this.unlockingActions];\n }\n\n public updateState(state: State, action: Action): State {\n if (this.lockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: true }\n });\n }\n\n if (this.unlockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: false }\n });\n }\n\n return state;\n }\n}\n","import { effect, inject, untracked } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { Logger, Store } from 'ngssm-store';\n\nimport { RoutingAction } from './routing-action';\n\nexport const routingEffectInitializer = async () => {\n const store = inject(Store);\n const router = inject(Router);\n const logger = inject(Logger);\n\n effect(() => {\n const action = store.processedAction();\n const routingAction = action as RoutingAction;\n if (routingAction.navigate) {\n logger.information(`[Routing Effect] Processing action ${action.type}`);\n try {\n untracked(() => routingAction.navigate?.(store.state(), router));\n logger.information(`[Routing Effect] Successfully navigated for action ${action.type}`);\n } catch (error) {\n logger.error(`[Routing Effect] Error while processing action ${action.type}: ${error}`);\n }\n }\n });\n\n return true;\n};\n","import { EnvironmentProviders, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { provideReducer } from 'ngssm-store';\n\nimport { isNavigationUnLocked } from './guards';\nimport { NavigationReducer } from './reducers/navigation.reducer';\nimport { routingEffectInitializer } from './routing';\n\nconst initializeNavigation = () => {\n inject(Router).config.forEach((route) => {\n route.canDeactivate = [isNavigationUnLocked, ...(route.canDeactivate ?? [])];\n });\n};\n\nexport const provideNgssmNavigation = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideReducer(NavigationReducer),\n provideAppInitializer(initializeNavigation),\n provideAppInitializer(routingEffectInitializer)\n ]);\n};\n","/*\n * Public API Surface of ngssm-navigation\n */\n\nexport * from './lib/provide-ngssm-navigation';\nexport * from './lib/state';\nexport * from './lib/guards';\nexport * from './lib/actions';\nexport * from './lib/model';\nexport * from './lib/routing';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,qBAAqB,GAAG,CAAC,KAAY,KAChD,KAAK,CAAC,4BAA4B,CAAC,eAAe;AAE7C,MAAM,qBAAqB,GAAG,CAAC,KAAY,EAAE,OAAqC,KACvF,MAAM,CAAC,KAAK,EAAE;AACZ,IAAA,CAAC,4BAA4B,CAAC,eAAe,GAAG;AACjD,CAAA;AAUU,IAAA,4BAA4B,GAAlC,MAAM,4BAA4B,CAAA;aAChB,IAAe,CAAA,eAAA,GAAG,kBAAH,CAAsB;AACrC,IAAA,SAAA,IAAA,CAAA,YAAY,GAAoB;AACrD,QAAA,gBAAgB,EAAE;AACnB,KAFkC,CAEjC;;AAJS,4BAA4B,GAAA,UAAA,CAAA;AAJxC,IAAA,iBAAiB,CAAC;QACjB,eAAe,EAAE,4BAA4B,CAAC,eAAe;QAC7D,YAAY,EAAE,4BAA4B,CAAC;KAC5C;AACY,CAAA,EAAA,4BAA4B,CAKxC;;ACnBM,MAAM,kBAAkB,GAAG,MAAc;IAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE;AACnC,IAAA,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC,gBAAgB;AACtD;AAEO,MAAM,oBAAoB,GAAG,MAAc;IAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE;AACnC,IAAA,OAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,gBAAgB;AACvD;;ICdY;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,gBAAA,CAAA,GAAA,uCAAwD;AACxD,IAAA,oBAAA,CAAA,kBAAA,CAAA,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kD,+CAAA,EAAA,MAAM,CAAC,IAAI,CAAK,EAAA,EAAA,KAAK,CAAE,CAAA,CAAC;;;AAG7F,KAAC,CAAC;AAEF,IAAA,OAAO,IAAI;AACb;;AClBA,MAAM,oBAAoB,GAAG,MAAK;IAChC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACtC,QAAA,KAAK,CAAC,aAAa,GAAG,CAAC,oBAAoB,EAAE,IAAI,KAAK,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;AAC9E,KAAC,CAAC;AACJ,CAAC;AAEM,MAAM,sBAAsB,GAAG,MAA2B;AAC/D,IAAA,OAAO,wBAAwB,CAAC;QAC9B,cAAc,CAAC,iBAAiB,CAAC;QACjC,qBAAqB,CAAC,oBAAoB,CAAC;QAC3C,qBAAqB,CAAC,wBAAwB;AAC/C,KAAA,CAAC;AACJ;;ACrBA;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,39 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="ngssm-navigation" />
5
- export * from './public-api';
1
+ import { EnvironmentProviders, InjectionToken } from '@angular/core';
2
+ import { Spec } from 'immutability-helper';
3
+ import { State } from 'ngssm-store';
4
+ import { Router } from '@angular/router';
5
+
6
+ declare const provideNgssmNavigation: () => EnvironmentProviders;
7
+
8
+ declare const selectNavigationState: (state: State) => NavigationState;
9
+ declare const updateNavigationState: (state: State, command: Spec<NavigationState, never>) => State;
10
+ interface NavigationState {
11
+ navigationLocked: boolean;
12
+ }
13
+ declare class NavigationStateSpecification {
14
+ static readonly featureStateKey = "navigation-state";
15
+ static readonly initialState: NavigationState;
16
+ }
17
+
18
+ declare const isNavigationLocked: () => boolean;
19
+ declare const isNavigationUnLocked: () => boolean;
20
+
21
+ declare enum NavigationActionType {
22
+ lockNavigation = "[NavigationActionType] lockNavigation",
23
+ unLockNavigation = "[NavigationActionType] unLockNavigation"
24
+ }
25
+
26
+ interface NavigationLockingConfig {
27
+ actionsLockingNavigation?: string[];
28
+ actionsUnLockingNavigation?: string[];
29
+ }
30
+ declare const NGSSM_NAVIGATION_LOCKING_CONFIG: InjectionToken<NavigationLockingConfig>;
31
+
32
+ interface RoutingAction {
33
+ navigate?(state: State, router: Router): void;
34
+ }
35
+
36
+ declare const routingEffectInitializer: () => Promise<boolean>;
37
+
38
+ export { NGSSM_NAVIGATION_LOCKING_CONFIG, NavigationActionType, NavigationStateSpecification, isNavigationLocked, isNavigationUnLocked, provideNgssmNavigation, routingEffectInitializer, selectNavigationState, updateNavigationState };
39
+ export type { NavigationLockingConfig, NavigationState, RoutingAction };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "ngssm-navigation",
3
- "version": "19.4.0",
3
+ "version": "20.0.1",
4
4
  "description": "NgSsm - Helpers to control angular navigation.",
5
5
  "author": "Lion Marc",
6
6
  "license": "MIT",
7
7
  "peerDependencies": {
8
- "@angular/common": ">=18.0.0",
9
- "@angular/core": ">=18.0.0",
10
- "ngssm-store": "19.4.0"
8
+ "@angular/common": ">=20.0.0",
9
+ "@angular/core": ">=20.0.0",
10
+ "ngssm-store": ">=19.0.0"
11
11
  },
12
12
  "dependencies": {
13
13
  "tslib": "^2.3.0"
@@ -1 +0,0 @@
1
- export * from './navigation-action-type';
@@ -1,4 +0,0 @@
1
- export declare enum NavigationActionType {
2
- lockNavigation = "[NavigationActionType] lockNavigation",
3
- unLockNavigation = "[NavigationActionType] unLockNavigation"
4
- }
@@ -1 +0,0 @@
1
- export * from './navigation-guards';
@@ -1,2 +0,0 @@
1
- export declare const isNavigationLocked: () => boolean;
2
- export declare const isNavigationUnLocked: () => boolean;
@@ -1 +0,0 @@
1
- export * from './navigation-locking-config';
@@ -1,6 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export interface NavigationLockingConfig {
3
- actionsLockingNavigation?: string[];
4
- actionsUnLockingNavigation?: string[];
5
- }
6
- export declare const NGSSM_NAVIGATION_LOCKING_CONFIG: InjectionToken<NavigationLockingConfig>;
@@ -1,2 +0,0 @@
1
- import { EnvironmentProviders } from '@angular/core';
2
- export declare const provideNgssmNavigation: () => EnvironmentProviders;
@@ -1,12 +0,0 @@
1
- import { Reducer, State, Action } from 'ngssm-store';
2
- import { NavigationLockingConfig } from '../model';
3
- import * as i0 from "@angular/core";
4
- export declare class NavigationReducer implements Reducer {
5
- private readonly lockingActions;
6
- private readonly unlockingActions;
7
- readonly processedActions: string[];
8
- constructor(configs: NavigationLockingConfig[]);
9
- updateState(state: State, action: Action): State;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<NavigationReducer, [{ optional: true; }]>;
11
- static ɵprov: i0.ɵɵInjectableDeclaration<NavigationReducer>;
12
- }
@@ -1,2 +0,0 @@
1
- export * from './routing-action';
2
- export * from './routing-effect';
@@ -1,5 +0,0 @@
1
- import { Router } from '@angular/router';
2
- import { State } from 'ngssm-store';
3
- export interface RoutingAction {
4
- navigate?(state: State, router: Router): void;
5
- }
@@ -1 +0,0 @@
1
- export declare const routingEffectInitializer: () => Promise<boolean>;
@@ -1 +0,0 @@
1
- export * from './navigation.state';
@@ -1,11 +0,0 @@
1
- import { Spec } from 'immutability-helper';
2
- import { State } from 'ngssm-store';
3
- export declare const selectNavigationState: (state: State) => NavigationState;
4
- export declare const updateNavigationState: (state: State, command: Spec<NavigationState, never>) => State;
5
- export interface NavigationState {
6
- navigationLocked: boolean;
7
- }
8
- export declare class NavigationStateSpecification {
9
- static readonly featureStateKey = "navigation-state";
10
- static readonly initialState: NavigationState;
11
- }
package/public-api.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './lib/provide-ngssm-navigation';
2
- export * from './lib/state';
3
- export * from './lib/guards';
4
- export * from './lib/actions';
5
- export * from './lib/model';
6
- export * from './lib/routing';