import Dexie from 'dexie';
import { type Book } from './Book';

class BookDatabase extends Dexie {
  public books: Dexie.Table<Book, number>;

  public constructor() {
    super('BookDatabase');
    this.version(1).stores({
      books: 'id,title',
    });
    this.books = this.table('books');
  }
}

export default new BookDatabase();
