// Copyright (c) 2019 Gonzalo Müller Bravo. import type { Context, Element, } from 'react' export type Dispatcher = (value: ACTION) => void export type Reducer = (prevState: STATE, action: ACTION) => STATE export type ReducerContextValue = [STATE, Dispatcher] export type ReducerContextDefaultValue = ReducerContextValue | null export interface ReducerContextProps { context: Context>; reducer: Reducer; initialState: STATE; children: Element; } export interface ReducerContextInterface { state: STATE; dispatch: Dispatcher; } declare export default function ReducerContext(props: ReducerContextProps): Element declare export function useReducerContext( context: Context> ): ReducerContextInterface declare export function useReducerState( context: Context> ): STATE declare export function useReducerDispatcher( context: Context> ): Dispatcher