import {MutationTree} from 'vuex'
import {PortaitState} from './state'
import {PortaitMutationTypes} from './mutation-types'

export type Mutations<S = PortaitState> = {
  [PortaitMutationTypes.SET_AIR](state: S, airConditioner: boolean): void
  [PortaitMutationTypes.SET_AIR](state: S, light: boolean): void
}

export const mutations: MutationTree<PortaitState> & Mutations = {
  [PortaitMutationTypes.SET_AIR](state: PortaitState, airConditioner: boolean) {
    state.airConditioner = airConditioner
  },
  [PortaitMutationTypes.SET_LIGHT](state: PortaitState, light: boolean) {
    state.light = light
  }
}


