UNPKG

1.49 kBTypeScriptView Raw
1import { AnyAction, Reducer } from 'redux';
2import { ObservableStore } from '../components/observable-store';
3import { Comparator, Selector, Transformer } from '../components/selectors';
4/**
5 * Used with the `@WithSubStore` class decorator to define a SubStore (AKA a
6 * fractal store).
7 *
8 * For more info on substores, see
9 * https://github.com/angular-redux/platform/blob/master/packages/store/articles/fractal-store.md
10 */
11export interface FractalStoreOptions {
12 /**
13 * The name of an instance method that will define the
14 * base path for the subStore. This method is expected to return an array
15 * of property names or undefined/null.
16 */
17 basePathMethodName: string;
18 /**
19 * The localReducer for the substore in question.
20 */
21 localReducer: Reducer<any, AnyAction>;
22}
23/** @hidden */
24export declare const setClassOptions: (decoratedClassConstructor: any, options: FractalStoreOptions) => void;
25/**
26 * Gets the store associated with a decorated instance (e.g. a
27 * component or service)
28 * @hidden
29 */
30export declare const getBaseStore: (decoratedInstance: any) => ObservableStore<any>;
31/**
32 * Creates an Observable from the given selection parameters,
33 * rooted at decoratedInstance's store, and caches it on the
34 * instance for future use.
35 * @hidden
36 */
37export declare const getInstanceSelection: <T>(decoratedInstance: any, key: string | symbol, selector: Selector<any, T>, transformer?: Transformer<any, T>, comparator?: Comparator) => any;