title: How to access other Vuex modules with typescript?
body: <p>I'm trying to write a Vuex store with typescript (not using <code>vuex-module-decorators</code>, just plain Vuex + typescript to keep things simple).
  My root store has no state, just modules:</p>
  
  <pre><code>export interface RootState { }
  export const store: StoreOptions&lt;RootState&gt; = {
    strict: (process.env.NODE_ENV !== 'production'),
    state: {},
    mutations: {},
    modules: {
      moduleA,
      moduleB
    }
  }
  </code></pre>
  
  <p>moduleA has some state:</p>
  
  <pre><code>export interface ModAState { 
   aValue: string
  }
  const modAState: ModAState = {
   aValue: 'value A'
  }
  export default const moduleA = {
    namespaced: true,
    state: modAState,
    getters: {},
    mutations: {},
    actions: {}
  }
  </code></pre>
  
  <p>as does moduleB:</p>
  
  <pre><code>export interface ModBState { 
   bValue: string
  }
  const modBState: ModBState = {
   bValue: 'value B'
  }
  const modBActions: ActionTree&lt;ModBState, RootState&gt; = {
    act1({state, rootState, commit, dispatch}) {
      let foo = rootState.moduleA.aValue // &lt;&lt;&lt;&lt;&lt; Typescript error: property moduleA does not exist on '{}' 
    }
  }
  export default const moduleB = {
    namespaced: true,
    state: modBState,
    getters: {},
    mutations: {},
    actions: modBActions
  }
  </code></pre>
  
  <p>The error is above in modB's <code>act1</code> -- <code>rootState</code> is just <code>{}</code>, as far as typescript is concerned it has no access to the root store's <code>modules</code>. So how can I get moduleA's state in an action in moduleB?</p>
  
  <p>Here's a codesandbox: <a href="https://codesandbox.io/embed/vuex-typescript-modules-x7f7s" rel="nofollow noreferrer">https://codesandbox.io/embed/vuex-typescript-modules-x7f7s</a> (the store is in <code>App.vue</code> there)</p>