import { createToken } from '@tinkoff/dippy' ; import type { DispatcherContext , Event , Middleware , Reducer } from '@tramvai/state' ; description export const DISPATCHER_TOKEN = createToken ( 'dispatcher' ) ; description export const DISPATCHER_CONTEXT_TOKEN = createToken < DispatcherContext < any > > ( 'dispatcherContext' ) ; description export const COMBINE_REDUCERS = createToken ( 'combineReducers' , { multi : true } ) ; description export const STORE_TOKEN = createToken < Store > ( 'store' ) ; description export const STORE_MIDDLEWARE = createToken < Middleware > ( 'storeMiddleware' , { multi : true } ) ; description export const INITIAL_APP_STATE_TOKEN = createToken < { stores : Record < string , any > ; } > ( 'initialAppState' ) ; export interface Store < State = Record < string , any > > { dispatch : < Payload > ( actionOrNameEvent : string | Event < Payload > , payload ? : Payload ) => Payload ; subscribe ( callback ) : ( ) => void ; subscribe < S > ( reducer , callback ) : ( ) => void ; getState ( ) : State ; getState < S > ( reducer ) : S ; }