title: Type definitions for Redux (Toolkit) store with preloadedState
body: <p>I'm trying to make typings work for configuring a Redux store with a preloaded state.</p>
  <p>The <a href="https://redux-toolkit.js.org/tutorials/typescript" rel="noreferrer">Redux Toolkit TypeScript quick start guide</a> has this example:</p>
  <pre><code>import { configureStore } from '@reduxjs/toolkit'
  
  const store = configureStore({
    reducer: {
      one: oneSlice.reducer,
      two: twoSlice.reducer
    }
  })
  
  // Infer the `RootState` and `AppDispatch` types from the store itself
  export type RootState = ReturnType&lt;typeof store.getState&gt;
  export type AppDispatch = typeof store.dispatch
  </code></pre>
  <p>Unfortunately with a preloaded state, it looks more like this:</p>
  <pre><code>export function initStore(preloadedState) {
    const store = configureStore({
      reducer: {
        one: oneSlice.reducer,
        two: twoSlice.reducer
      },
      preloadedState,
    })
  
    return store
  }
  </code></pre>
  <p>From where do I now get the <code>RootState</code> type and the <code>AppDispatch</code> type?</p>