I've create a PR to fix the type issues we encountered and here is the diff that solved my problem (from patch-package):
TSConfig Error Message:
node_modules/@wora/relay-store/lib/RecordSource.d.ts:22:5 - error TS2416: Property 'toJSON' in type 'RecordSource' is not assignable to the same property in base type 'IMutableRecordSourceOffline'.
Type '() => RecordMap' is not assignable to type '() => { [key: string]: Record<{}>; }'.
Type 'RecordMap' is not assignable to type '{ [key: string]: Record<{}>; }'.
'string' index signatures are incompatible.
Type 'Record<{}> | null | undefined' is not assignable to type 'Record<{}>'.
Type 'undefined' is not assignable to type 'Record<{}>'.
22 toJSON(): RecordMap;
~~~~~~
```diff
diff --git a/node_modules/@wora/relay-store/lib/RecordSource.d.ts b/node_modules/@wora/relay-store/lib/RecordSource.d.ts
index 422b7bf..74cfe72 100644
--- a/node_modules/@wora/relay-store/lib/RecordSource.d.ts
+++ b/node_modules/@wora/relay-store/lib/RecordSource.d.ts
@@ -1,5 +1,5 @@
import { RecordState } from 'relay-runtime';
-import { MutableRecordSource, Record, RecordMap } from 'relay-runtime/lib/store/RelayStoreTypes';
+import { MutableRecordSource, Record } from 'relay-runtime/lib/store/RelayStoreTypes';
import { DataCache, CacheOptions } from '@wora/cache-persist';
export interface IMutableRecordSourceOffline extends MutableRecordSource {
restore(): Promise<DataCache>;
@@ -19,6 +19,6 @@ export declare class RecordSource implements IMutableRecordSourceOffline {
remove(dataID: string): void;
set(dataID: string, record: Record): void;
size(): number;
- toJSON(): RecordMap;
+ toJSON(): { [key: string]: Record };
}
//# sourceMappingURL=RecordSource.d.ts.map
Hi @morrys ! 👋
Firstly, thanks for your amazing work! 🙂
We are using @wora/relay-store 6.0.0 in our project Eigen and ran into a type issue with strict mode enabled.
I've create a PR to fix the type issues we encountered and here is the diff that solved my problem (from patch-package):
TSConfig Error Message:
This issue body was partially generated by patch-package.