import * as Constants from './constants' ; import * as Types from './types' ; export const updateConfigValue = ( path , value ) : Types . UpdateConfigValueAction => ( { type : Constants . UPDATE_VALUE , payload : { path , value } , meta : { shell : true } , } ) ; export const resetConfigValue = ( path ) : Types . ResetConfigValueAction => ( { type : Constants . RESET_VALUE , payload : { path } , meta : { shell : true } , } ) ; export const toggleConfigValue = ( path ) : Types . ToggleConfigValueAction => ( { type : Constants . TOGGLE_VALUE , payload : { path } , meta : { shell : true } , } ) ; export const addUniqueConfigValue = ( path , value ) : Types . AddUniqueConfigValueAction => ( { type : Constants . ADD_UNIQUE_VALUE , payload : { path , value } , meta : { shell : true } , } ) ; export const subtractConfigValue = ( path , value ) : Types . SubtractConfigValueAction => ( { type : Constants . SUBTRACT_VALUE , payload : { path , value } , meta : { shell : true } , } ) ; export const configInitialized = ( config ) : Types . ConfigInitializedAction => ( { type : Constants . INITIALIZED , payload : { config } , } ) ; export const configValueUpdated = ( path , value ) : Types . ConfigValueUpdatedAction => ( { type : Constants . VALUE_UPDATED , payload : { path , value } , } ) ; export function toggleDevtools ( ) { return toggleConfigValue ( 'devtools' ) ; } export function toggleDevInternalFlag ( flag ) { return toggleConfigValue ( `devInternal.${ flag }` ) ; } export function addManualIp ( ip ) { return addUniqueConfigValue ( 'discovery.candidates' , ip ) ; } export function removeManualIp ( ip ) { return subtractConfigValue ( 'discovery.candidates' , ip ) ; }