title: TypeScript Vuex Plugin "incompatible types"
body: <p>Having trouble creating a vuex plugin for a vuex store using TypeScript. The plugin utilises a higher order function in order to take parameters, as depicted below:</p>
  
  <p>Plugin.ts</p>
  
  <pre><code>export const ParamsPlugin = 
         () =&gt; {
              (store: Store&lt;RootState&gt;) =&gt; {
                  console.log("ParamsPlugin");
              } 
          }
  </code></pre>
  
  <p>Index.ts</p>
  
  <pre><code>const store :StoreOptions&lt;RootState&gt; = {
      state: &lt;RootState&gt; {
        ...
      },
      mutations: {
        ...
      },
      modules: {
        ...
      },
       plugins:  [ ParamsPlugin() ]
    }
  </code></pre>
  
  <p>The Typescript error:</p>
  
  <blockquote>
    <p>Types of property 'plugins' are incompatible. Type 'void[]' is not
    assignable to type 'Plugin[] | undefined'. Type 'void[]' is not
    assignable to type 'Plugin[]'. Type 'void' is not assignable to type
    'Plugin'.</p>
  </blockquote>
  
  <p>I realise this is a TypeScript issue and being new to TypeScript It would be great to know the best way to resolve this.</p>