/** * svelte-idb — Store * * Generic CRUD layer over a single IndexedDB object store. * Every mutation notifies the ChangeNotifier for reactive updates. */ import type { IStore, StoreConfig } from './types.js'; import type { ChangeNotifier } from './change-notifier.js'; import { QueryBuilder } from './query-builder.js'; export declare class Store implements IStore { readonly storeName: string; private dbPromise; private notifier; private config; private debug; constructor(storeName: string, dbPromise: Promise, notifier: ChangeNotifier, config: StoreConfig, debug?: boolean); private log; /** * Insert a new record. Fails if the key already exists. */ add(value: T): Promise; /** * Insert or update a record (upsert). */ put(value: T): Promise; /** * Retrieve a single record by primary key. */ get(key: IDBValidKey): Promise; /** * Retrieve all records in the store. */ getAll(): Promise; /** * Query records via a secondary index. */ getAllFromIndex(indexName: string, query?: IDBValidKey | IDBKeyRange, count?: number): Promise; where(indexName: string): QueryBuilder; /** * Remove a record by primary key. */ delete(key: IDBValidKey): Promise; /** * Remove all records from the store. */ clear(): Promise; /** * Count records in the store. */ count(): Promise; /** * Low-level helper: open a transaction, perform an operation, return a promise. */ private request; }