UNPKG

overmind-react

Version:
21 lines (20 loc) 953 B
import * as React from 'react'; import { IContext, IReaction, Overmind, OvermindMock } from 'overmind'; export type IReactComponent<P = any> = React.FunctionComponent<P> | React.ComponentClass<P> | React.ClassicComponentClass<P>; export declare const Provider: React.ProviderExoticComponent<React.ProviderProps<Overmind<any> | OvermindMock<any>>>; export interface StateHook<Context extends IContext<{}>> { (): Context['state']; <T>(cb?: (state: Context['state']) => T): T; } export declare const createStateHook: <Context extends IContext<{ state: {}; }>>() => StateHook<Context>; export declare const createActionsHook: <Context extends IContext<{ actions: {}; }>>() => () => Context['actions']; export declare const createEffectsHook: <Context extends IContext<{ effects: {}; }>>() => () => Context['effects']; export declare const createReactionHook: <Context extends IContext<{ state: {}; }>>() => () => IReaction<Context>;