import * as ActionTypes from '../actionTypes'
import { RestoreState } from '../actions'
import { RelayMap, RelayInfoObject } from '../../types'

export type RelaysState = {
  map?: RelayMap
  mapUpdated?: number
  info?: RelayInfoObject
}

export interface SetRelayMapAction {
  type: typeof ActionTypes.SET_RELAY_MAP
  payload: RelayMap
}

export interface SetRelayInfoAction {
  type: typeof ActionTypes.SET_RELAY_INFO
  payload: RelayInfoObject
}

export interface SetRelayMapUpdatedAction {
  type: typeof ActionTypes.SET_RELAY_MAP_UPDATED
}

export type RelaysDispatchTypes =
  | SetRelayMapAction
  | SetRelayInfoAction
  | SetRelayMapUpdatedAction
  | RestoreState
