File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,20 @@ export interface PersistentStorage<T> {
18
18
removeItem : ( key : string ) => Promise < T > | Promise < void > | void ;
19
19
}
20
20
21
- export interface ApolloPersistOptions < TSerialized > {
21
+ type StorageType < T , TSerialize extends boolean > = TSerialize extends true
22
+ ? PersistentStorage < string >
23
+ : PersistentStorage < T > ;
24
+
25
+ export interface ApolloPersistOptions <
26
+ TSerialized ,
27
+ TSerialize extends boolean = true
28
+ > {
22
29
cache : ApolloCache < TSerialized > ;
23
- storage : PersistentStorage < PersistedData < TSerialized > > ;
30
+ storage : StorageType < PersistedData < TSerialized > , TSerialize > ;
24
31
trigger ?: 'write' | 'background' | TriggerFunction | false ;
25
32
debounce ?: number ;
26
33
key ?: string ;
27
- serialize ?: boolean ;
34
+ serialize ?: TSerialize ;
28
35
maxSize ?: number | false ;
29
36
persistenceMapper ?: PersistenceMapperFunction ;
30
37
debug ?: boolean ;
You can’t perform that action at this time.
0 commit comments