UNPKG

1.82 kBTypeScriptView Raw
1import { InjectionToken } from '@angular/core';
2import { Action, ActionReducer, ActionReducerMap, ActionReducerFactory, StoreFeature, InitialState, MetaReducer, RuntimeChecks } from './models';
3import { combineReducers } from './utils';
4export interface StoreConfig<T, V extends Action = Action> {
5 initialState?: InitialState<T>;
6 reducerFactory?: ActionReducerFactory<T, V>;
7 metaReducers?: MetaReducer<{
8 [P in keyof T]: T[P];
9 }, V>[];
10}
11export interface RootStoreConfig<T, V extends Action = Action> extends StoreConfig<T, V> {
12 runtimeChecks?: Partial<RuntimeChecks>;
13}
14/**
15 * An object with the name and the reducer for the feature.
16 */
17export interface FeatureSlice<T, V extends Action = Action> {
18 name: string;
19 reducer: ActionReducer<T, V>;
20}
21export declare function _createStoreReducers<T, V extends Action = Action>(reducers: ActionReducerMap<T, V> | InjectionToken<ActionReducerMap<T, V>>): ActionReducerMap<T, V>;
22export declare function _createFeatureStore<T, V extends Action = Action>(configs: StoreConfig<T, V>[] | InjectionToken<StoreConfig<T, V>>[], featureStores: StoreFeature<T, V>[]): (StoreFeature<T, V> | {
23 key: string;
24 reducerFactory: ActionReducerFactory<T, V> | typeof combineReducers;
25 metaReducers: MetaReducer<{ [P in keyof T]: T[P]; }, V>[];
26 initialState: InitialState<T> | undefined;
27})[];
28export declare function _createFeatureReducers<T, V extends Action = Action>(reducerCollection: Array<ActionReducerMap<T, V> | InjectionToken<ActionReducerMap<T, V>>>): ActionReducerMap<T, V>[];
29export declare function _initialStateFactory(initialState: any): any;
30export declare function _concatMetaReducers(metaReducers: MetaReducer[], userProvidedMetaReducers: MetaReducer[]): MetaReducer[];
31export declare function _provideForRootGuard(): unknown;