zalmoxisus / redux-devtools-extension

Redux DevTools extension.
MIT License
13.5k stars 1k forks source link

Using with serialize immutable option in typescript causes type errors #667

Open CMCDragonkai opened 5 years ago

CMCDragonkai commented 5 years ago

I have something like:

import * as Immutable from 'immutable';

const composeEnhancers = composeWithDevTools({
  serialize: {
    immutable: Immutable
  }
});

const middleware = composeEnhancers(
  applyMiddleware(
    thunkMiddleware,
    promiseMiddleware
  )
);

However typescript complains:

ERROR in [at-loader] ./src/index.tsx:17:5 
    TS2322: Type '{ immutable: typeof import("/home/cmcdragonkai/Projects/inverter-analysis/node_modules/immutable/dist/immutable-nonambient"); }' is not assignable to type 'boolean | { date?: boolean; regex?: boolean; undefined?: boolean; error?: boolean; symbol?: boolean; map?: boolean; set?: boolean; function?: boolean | Function; }'.
  Object literal may only specify known properties, and 'immutable' does not exist in type '{ date?: boolean; regex?: boolean; undefined?: boolean; error?: boolean; symbol?: boolean; map?: boolean; set?: boolean; function?: boolean | Function; }'.
FlorianGerhardt commented 4 years ago

Fix in #731