apix/lib/db.ts
Khoa.vo 2a4bf8b58b
Some checks are pending
CI / build (18.x) (push) Waiting to run
CI / build (20.x) (push) Waiting to run
feat: updates before deployment
2026-01-06 13:26:11 +07:00

23 lines
558 B
TypeScript

import Dexie, { Table } from 'dexie';
export interface ImageItem {
id?: number;
data: string; // Base64 or URL
prompt: string;
aspectRatio: string;
createdAt: number;
provider?: 'whisk' | 'grok' | 'meta'; // Track which AI generated the image
}
export class KeyValuePixDB extends Dexie {
gallery!: Table<ImageItem, number>;
constructor() {
super('kv-pix-db');
this.version(1).stores({
gallery: '++id, createdAt'
});
}
}
export const db = new KeyValuePixDB();