Open manueliglesias opened 6 years ago
any chances this will be fixed any time soon? it is still borked in appsync 1.7.0, doesn't work in typescript:
Try `npm install @types/redux-offline__redux-offline` if it exists or add a new declaration (.d.ts) file containing `declare module '@redux-offline/redux-offline/lib/types';` TS7016
2 | import { AWSAppSyncClient, OfflineCallback } from './client';
3 | import { NormalizedCacheObject, IdGetter } from 'apollo-cache-inmemory';
> 4 | import { NetInfo, NetworkCallback } from '@redux-offline/redux-offline/lib/types';
| ^
5 | declare const newStore: <TCacheShape extends NormalizedCacheObject>(clientGetter: () => AWSAppSyncClient<TCacheShape>, persistCallback: () => any, dataIdFromObject: (obj: any) => string, storage: any, callback?: OfflineCallback) => Store<any>;
6 | export declare type OfflineEffectConfig = {
7 | enqueueAction: string;```
A workaround, for the interim.
This issue breaks typescript compilation for any project using aws-appsync. @AndrewKvalheim 's solution works, for convenience, directly adding the code here:
Place a typings.d.ts
file at project root:
declare module '@redux-offline/redux-offline/lib/types' {
export type NetInfo = any;
export type NetworkCallback = any;
}
We need to upgrade to the latest redux-offline, see #276