import { IKeyAction , IKeyState , IKeyObject } from '../key.interface' ; import { IExtensionOptions , paneType } from '../../../../utilities/interfaces' ; import { store } from '../../../../appStore' ; import * as keyActions from '../key.actions' ; export const KeyActionBuilder = ( type , screen , key , isMerge , extensionOptions ? ) : IKeyAction => { return { type : type , payload : { screen : screen , key : key , isMerge : isMerge , extensionOptions } } ; } ; /**
 * mocks keyState building 3 objects for the final state
 */ export const mockKeyState = ( screen , isMerge , prependKey = '' ) : IKeyState => { const first = keyObjectBuilder ( `${ prependKey }first` , isMerge , screen ) ; const second = keyObjectBuilder ( `${ prependKey }second` , isMerge , screen ) ; const third = keyObjectBuilder ( `${ prependKey }third` , isMerge , screen ) ; return { keys : [ first , second , third ] } ; } ; export const keyObjectBuilder = ( key , isMerge , screen , extensionOptions ? ) : IKeyObject => { return { key : key , isMerge : isMerge , screen : screen , extensionOptions } ; } ; export const populateKeyStore3 = ( screen , isMerge ) => { const keyState = mockKeyState ( screen , isMerge ) ; keyState . keys . map ( val => store . dispatch ( keyActions . pushKey ( val . screen , val . key , val . isMerge ) ) ) ; } ;