import { Comparator, NgRedux, PathSelector, Selector } from '@angular-redux/store'; import { AnyAction, Dispatch, Middleware, Reducer, Store, StoreEnhancer } from 'redux'; import { Observable, Subject } from 'rxjs'; import { MockObservableStore } from './observable-store.mock'; /** * Convenience mock to make it easier to control selector * behaviour in unit tests. */ export declare class MockNgRedux extends NgRedux { /** @deprecated Use MockNgRedux.getInstance() instead. */ static mockInstance?: MockNgRedux; /** * Returns a subject that's connected to any observable returned by the * given selector. You can use this subject to pump values into your * components or services under test; when they call .select or @select * in the context of a unit test, MockNgRedux will give them the values * you pushed onto your stub. */ static getSelectorStub(selector?: Selector, comparator?: Comparator): Subject; /** * Returns a mock substore that allows you to set up selectorStubs for * any 'fractal' stores your app creates with NgRedux.configureSubStore. * * If your app creates deeply nested substores from other substores, * pass the chain of pathSelectors in as ordered arguments to mock * the nested substores out. * @param pathSelectors */ static getSubStore(...pathSelectors: PathSelector[]): MockObservableStore; /** * Reset all previously configured stubs. */ static reset(): void; /** * Gets the singleton MockNgRedux instance. Useful for cases where your * tests need to spy on store methods, for example. */ static getInstance(): MockNgRedux; private mockRootStore; configureSubStore: any; dispatch: Dispatch; getState: any; subscribe: () => () => any; replaceReducer: () => any; select: (selector?: Selector, comparator?: Comparator) => Observable; /** @hidden */ constructor(); provideStore: (_: Store) => void; configureStore: (_: Reducer, __: any, ___?: Middleware<{}, any, Dispatch>[], ____?: StoreEnhancer[]) => void; }