aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Database/IDB/tracker.ts
blob: 4c3b116a41eeb284addeb8094086619b21bff363 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Dexie, { type Table } from 'dexie';

export interface TrackerEntry {
  id: string;
  url: string;
  title: string;
  progress: number;
}

export class TrackerDatabase extends Dexie {
  entries: Table<TrackerEntry>;

  constructor() {
    super('tracker');
    this.version(1).stores({
      entries: 'id, url, title, progress'
    });

    this.entries = this.table('entries');
  }
}

export const database = new TrackerDatabase();