UNPKG

@versatiledatakit/shared

Version:

Versatile Data Kit Shared library enables reusability of shared features like: NgRx Redux, Error Handlers, Utils, Generic Components, etc.

46 lines (45 loc) 2.63 kB
import { InjectionToken, ModuleWithProviders, Type } from '@angular/core'; import { Action, ActionReducer, ActionReducerMap, StoreConfig, StoreFeatureModule } from '@ngrx/store'; import { EffectsFeatureModule } from '@ngrx/effects'; import { TaurusNgRxConfig } from './config'; import { VdkSharedNgrxProdModule, VdkSharedNgrxDevModule } from './helper-modules'; import * as i0 from "@angular/core"; /** * ** Integration Class module for NgRx Redux. */ export declare class VdkSharedNgRxModule { /** * ** Provides VdkSharedNgrxProdModule and all Services related to VDK Redux. * * - Recommended for Prod (release) builds. * - Should be invoked at Root and only once for entire project. * - In FeaturesModules (lazy loaded Modules) invoke one of the methods <b>forFeatureEffects/forFeatureStore</b>. */ static forRoot(): ModuleWithProviders<VdkSharedNgrxProdModule>; /** * ** Provides VdkSharedNgrxDevModule including StoreDevTools and all Services related to VDK Redux. * * - Recommended for Dev (local) builds. * - Should be invoked at Root and only once for entire project. * - In FeaturesModules (lazy loaded Modules) invoke one of the methods <b>forFeatureEffects/forFeatureStore</b>. */ static forRootWithDevtools(config?: TaurusNgRxConfig): ModuleWithProviders<VdkSharedNgrxDevModule>; /** * ** Load Features Effects. * * - Should be invoke in FeatureModules (lazy loaded Modules). * - It will register Effects for that Feature. */ static forFeatureEffects(effects: Array<Type<any>>): ModuleWithProviders<EffectsFeatureModule>; /** * ** Load Features Store reducers. * * - Should be invoke in FeatureModules (lazy loaded Modules). * - It will extend Store and add reducers for that Feature. */ static forFeatureStore<T, V extends Action = Action>(featureName: string, reducers: ActionReducerMap<T, V> | InjectionToken<ActionReducerMap<T, V>>, config?: StoreConfig<T, V> | InjectionToken<StoreConfig<T, V>>): ModuleWithProviders<StoreFeatureModule>; static forFeatureStore<T, V extends Action = Action>(featureName: string, reducer: ActionReducer<T, V> | InjectionToken<ActionReducer<T, V>>, config?: StoreConfig<T, V> | InjectionToken<StoreConfig<T, V>>): ModuleWithProviders<StoreFeatureModule>; static ɵfac: i0.ɵɵFactoryDeclaration<VdkSharedNgRxModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<VdkSharedNgRxModule, never, never, never>; static ɵinj: i0.ɵɵInjectorDeclaration<VdkSharedNgRxModule>; }