import Dexie from 'dexie' ; export abstract class Database extends Dexie { protected schemaVersion : number | undefined ; protected constructor ( name , schemaVersion ? ) { super ( name ) ; this . schemaVersion = schemaVersion ; } protected async conditionalVersion ( version , schema , upgrade ? ) { if ( this . schemaVersion !== null && this . schemaVersion < version ) { return ; } const dexieVersion = this . version ( version ) . stores ( schema ) ; if ( upgrade ) { await dexieVersion . upgrade ( upgrade ) ; } } }