import { ReadingFilter , ReadingState } from '@icarus/shared' ; import { ReadingStateStore } from '@icarus/storage' ; import NullPersistence from './NullPersistence' ; export default class TestBookStore extends ReadingStateStore { saved : ReadingState = { appVersion : '0.0.1' , bookLocations : [ ] , cursor : { bookIndex : 0 , imageIndex : 0 } , filter : { tagNames : [ ] } , } ; constructor ( ) { super ( new NullPersistence ( ) ) ; } async read ( ) { return this . saved ; } async resetBookLocations ( bookLocations ) { this . saved = { ... this . saved , bookLocations , cursor : { bookIndex : 0 , imageIndex : 0 } , filter : { tagNames : [ ] } , } ; } async applyFilter ( filter ) { this . saved . filter = filter ; } async moveCursor ( bookIndex , imageIndex ) { this . saved . cursor = { bookIndex , imageIndex } ; } }