import { IExportPostLog , IMessage , InstallationState } from './reducers/AdminState' ; export interface IAction { type : string ; data : any ; } export const UPDATE_ADMIN_OPTIONS = 'UPDATE_ADMIN_OPTIONS' ; export const UPDATE_SYNC_STATUS = 'UPDATE_SYNC_STATUS' ; export const TOGGLE_VALUE = 'TOGGLE_VALUE' ; export const SET_VALUE = 'SET_VALUE' ; export const UPDATE_LOCAL_OPTION = 'UPDATE_LOCAL_OPTION' ; export const SET_MESSAGE = 'SET_MESSAGE' ; export const CHANGE_INSTALL_STATE = 'CHANGE_INSTALL_STATE' ; export const CHANGE_TAB_STATE = 'CHANGE_TAB_STATE' ; export const UPDATE_EXPORT_POST_LOG = 'UPDATE_EXPORT_POST_LOG' ; export function updateAdminOptionsAction ( data ) { return { data , type : UPDATE_ADMIN_OPTIONS , } ; } export function updateLocalOptionAction ( key , newValue ) { return { data : { [ key ] : newValue , } , type : UPDATE_LOCAL_OPTION , } ; } export function updateSyncStatusAction ( data ) { return { data , type : UPDATE_SYNC_STATUS , } ; } export function toggleValueAction ( key ) { return { data : key , type : TOGGLE_VALUE , } ; } export function setValueAction ( key , newValue ) { return { data : { [ key ] : newValue , } , type : SET_VALUE , } ; } export function setMessageAction ( message ) { return { data : message , type : SET_MESSAGE , } ; } export function changeInstallStateAction ( state ) { return { data : state , type : CHANGE_INSTALL_STATE , } ; } export function changeTabStateAction ( tab ) { return { data : tab , type : CHANGE_TAB_STATE , } ; } export function updateExportPostLogAction ( log ) { return { data : log , type : UPDATE_EXPORT_POST_LOG , } ; }