UNPKG

little-state-machine

Version:
11 lines (10 loc) 554 B
import { StateMachineOptions, GlobalState, AnyCallback, AnyActions, ActionsOutput } from './types'; export declare function createStore(defaultState: GlobalState, options?: StateMachineOptions): void; export declare function useStateMachine<TCallback extends AnyCallback, TActions extends AnyActions<TCallback>, TStore>({ actions, selector, }?: { actions?: TActions; selector?: ((payload: TStore) => TStore) | undefined; }): { actions: ActionsOutput<TCallback, TActions>; state: GlobalState; getState: () => GlobalState; };