import React from "react"; import { ProviderProps } from "."; import { Action, Reducer } from "./types"; export interface Store { useState(): S; useDispatch(): (action: Action, callback?: () => void) => void; persist(state: S, action: { type: any; }): void; setToState(): Promise; dispatch: (action: any, callback?: () => void) => void; state: S; Provider: (props: Omit, "store">) => any; } export interface PrivateStore extends Store { stateContext: React.Context; dispatchContext: React.Context<(action: any, callback?: () => void) => void>; reducer: Reducer; initialState: S; persistKey?: string; } /** * This function gives you a store. Use it in your components where you want to * connect to store and provider */ export declare const createStore: ({ reducer, initialState, mapStateToPersist, storage, persistKey, }: { reducer: Reducer; initialState: T; /** Window.localStorage, window.sessionStorage, AsyncStorage supported */ storage?: any; persistKey?: string | undefined; mapStateToPersist?: ((state: T) => Partial) | undefined; }) => Store; //# sourceMappingURL=createStore.d.ts.map