import { WatchOptions } from 'vue' ; import { Dictionary , Returns } from '../../utils/types' ; import { XEvent , XEventPayload } from '../../wiring/events.types' ; import { AnyXStoreModule } from '../store.types' ; /**
 * Selects a part of the store state or getters (AKA "getter" inside
 *  https watchers).
 *
 *  param ReturnType param State - The type of the state of the  XModule where this selector is used.
 *  param Getters - The type of the getters of the  XModule where this selector is used.
 *  public export type SimpleStateSelector < ReturnType , State extends Dictionary , Getters extends Dictionary > = ( state : State , getters : Getters ) => ReturnType ; /**
 * Composition type of  SimpleStateSelector which allows to indicate if the state selector
 * should be executed in first instance (first assignment of values). Selector is the
 *  SimpleStateSelector and immediate flags if the selector should be executed when it is
 * initialized for first time.
 *
 *  param ReturnType param State - The type of the state of the  XModule where this selector is used.
 *  param Getters - The type of the getters of the  XModule where this selector is used.
 *  public export interface StateSelector < ReturnType , State extends Dictionary , Getters extends Dictionary > extends WatchOptions { selector : SimpleStateSelector < ReturnType , State , Getters > ; remarks param newValue param oldValue returns filter ? ( newValue , oldValue ) : boolean ; } /**
 * Dictionary where the key is a  XEvent , and the value is  SimpleStateSelector or
 *  StateSelector . This  SimpleStateSelector or  StateSelector can only
 * access the state and getters from the  XStoreModule passed as param type. This
 * dictionary is used to emits a  XEvent when the part of the store selected by
 *  SimpleStateSelector changes.
 *
 *  param StoreModule public export type StoreEmitters < StoreModule extends AnyXStoreModule > = { [ Event in XEvent ] ? : SimpleStateSelector < XEventPayload < Event > , ReturnType < StoreModule [ 'state' ] > , Returns < StoreModule [ 'getters' ] > > | StateSelector < XEventPayload < Event > , ReturnType < StoreModule [ 'state' ] > , Returns < StoreModule [ 'getters' ] > > ; } ; public export type AnySimpleStateSelector = SimpleStateSelector < any , any , any > ; public export type AnyStateSelector = StateSelector < any , any , any > ; public export type AnyStoreEmitters = StoreEmitters < AnyXStoreModule > ; /**
 * Helper function for creating type-safe  StoreEmitters .
 *
 *  param storeModule param emitters - The  StoreEmitters to create.
 *  returns public export function createStoreEmitters < Module extends AnyXStoreModule , Emitters extends StoreEmitters < Module > > ( storeModule , emitters ) { return emitters ; }