title: TypeScript definition for StoreEnhancer prevents rest parameters
body: <p>I’m setting up an app with React-Redux and configured the store, similar to the guide shown <a href="https://redux.js.org/recipes/configuringyourstore" rel="nofollow noreferrer">here</a> </p>
  
  <p>Here is my code:</p>
  
  <pre><code>import { applyMiddleware, compose, createStore } from 'redux';
  import thunkMiddleware from 'redux-thunk';
  import rootReducer from '../reducers/reducers'
  
  export default function configureStore() {
  
    const middlewares = [thunkMiddleware];
    const middlewareEnhancer = applyMiddleware(...middlewares);
  
    const enhancers = [middlewareEnhancer];
  
    const composedEnhancers = compose(...enhancers);
  
    const preloadedState = (&lt;any&gt;window).__PRELOADED_STATE__;
  
    delete (&lt;any&gt;window).__PRELOADED_STATE__;
  
    const store = createStore(rootReducer, preloadedState, composedEnhancers);
  
    return store;
  
  }
  </code></pre>
  
  <p>However, I keep receiving the following Typescript error when I run build</p>
  
  <pre><code>TS2345: Argument of type '(...args: any[]) =&gt; {}' is not assignable to parameter of type 'StoreEnhancer&lt;{}, {}&gt;'.
  </code></pre>
  
  <p>I’m confused. Doesn’t Redux’s declaration file state (shown below) that the StoreEnhancer simply receives the Store and State extensions as empty plain objects? </p>
  
  <pre><code>export type StoreEnhancer&lt;Ext = {}, StateExt = {}&gt; = (next: StoreEnhancerStoreCreator) =&gt; StoreEnhancerStoreCreator&lt;Ext, StateExt&gt;
  </code></pre>
  
  <p>If so, why wouldn’t it accept 'Any' type from the rest parameters, even though I set “noImplicitAny” property to "true" in the config file, as shown below? </p>
  
  <p>(To the best of my knowledge, rest parameters can’t receive a declared type anyway.) </p>
  
  <p>What am I missing?
  <br/>
  <br/>
  <br/>
  <br/>
  Also, I’m using the following package versions:</p>
  
  <blockquote>
    <p>"react": "^16.4.2",<br/>
    "redux": "^4.0.0",<br/>
    "redux-thunk": "^2.3.0",<br/>
    "webpack": "^4.16.5",<br/>
    "awesome-typescript-loader": "^5.2.0",<br/>
    "typescript": "^3.0.3"<br/>
    "@types/react": "^16.4.12",<br/>
    "@types/redux": "^3.6.0",<br/>
    "@types/redux-thunk": "^2.1.0"</p>
  </blockquote>
  
  <p>with the following TS config settings:</p>
  
  <blockquote>
    <p>"compilerOptions": {<br/>
       * "outDir": "./dist/",<br/>
       * "sourceMap": true,<br/>
       * "noImplicitAny": true,<br/>
       * "module": "esnext",<br/>
       * "target": "esnext",<br/>
       * "jsx": "react",<br/>
       * "moduleResolution": "node",<br/>
       * "noUnusedLocals": true,<br/>
       * "noUnusedParameters": true,<br/>
       * "strict": true,<br/>
       * "esModuleInterop": false,<br/>
       * "noFallthroughCasesInSwitch": true,<br/>
       * "allowSyntheticDefaultImports": true<br/>
    }</p>
  </blockquote>