aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Database/IDB/tracker.ts
blob: bb7d2f273060dc501990525ab976c787b4f66095 (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();