import Dexie from 'dexie' ; import { IFormat , ICommonTagsResult } from 'music-metadata/lib/type' ; import { Stats } from 'fs' ; interface ExtendedCommonTagsResult extends ICommonTagsResult { [ key ] : any ; } export interface TrackModel { id : number ; source : string ; common : ExtendedCommonTagsResult ; format : IFormat ; stats : Stats ; } export class TracksDatabase extends Dexie { library : Dexie . Table < TrackModel , number > ; constructor ( dbname ) { super ( dbname ) ; this . version ( 1 ) . stores ( { tracks : 'id, source, common, format' , } ) ; this . version ( 2 ) . stores ( { tracks : null , library : 'id, source, common, format' , } ) ; } }