Numerous Philanthropic Misanthropes

    @types/redux-mock-store
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    Installation

    npm install --save @types/redux-mock-store

    Summary

    This package contains type definitions for Redux Mock Store (https://github.com/dmitry-zaets/redux-mock-store).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-mock-store.

    index.d.ts

    // Type definitions for Redux Mock Store 1.0.2
    // Project: https://github.com/dmitry-zaets/redux-mock-store
    // Definitions by: Marian Palkus <https://github.com/MarianPalkus>, Cap3 <http://www.cap3.de>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.3
    
    import * as Redux from 'redux';
    
    export interface MockStore<S = any, A extends Redux.Action = Redux.AnyAction> extends Redux.Store<S, A> {
        getActions(): any[];
        clearActions(): void;
    }
    
    export type MockStoreEnhanced<S = {}, DispatchExts = {}> = MockStore<S> & {dispatch: DispatchExts};
    
    export type MockStoreCreator<S = {}, DispatchExts = {}> = (state?: S | MockGetState<S>) => MockStoreEnhanced<S, DispatchExts>;
    
    export type MockGetState<S = {}> = (actions: Redux.AnyAction[]) => S;
    
    /**
     * Create Mock Store returns a function that will create a mock store from a state
     * with the same set of set of middleware applied.
     *
     * @param middlewares The list of middleware to be applied.
     * @template S The type of state to be held by the store.
     * @template DispatchExts The additional Dispatch signatures for the middlewares applied.
     */
    declare function createMockStore<S, DispatchExts = {}>(middlewares?: Redux.Middleware[]): MockStoreCreator<S, DispatchExts>;
    
    export default createMockStore;

    Additional Details

    • Last updated: Fri, 09 Jul 2021 02:32:41 GMT
    • Dependencies: @types/redux
    • Global values: none

    Credits

    These definitions were written by Marian Palkus, and Cap3.

    Keywords

    none

    Install

    npm i @types/redux-mock-store

    DownloadsWeekly Downloads

    465,793

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    5.44 kB

    Total Files

    4

    Last publish

    Collaborators

    • types