import { ModelDefinition, QueryOptions } from "./types"; import { ReactIndexDBClient } from "./react-indexdb-client"; export declare class ReactIndexDBModel { private dbClient; private modelDef; constructor(dbClient: ReactIndexDBClient, modelDef: ModelDefinition); /** * Ensure the database is connected before performing any operation. */ private ensureDatabase; /** * Create a new record in IndexedDB after validating the data. * @param data - The record data to insert. * @returns The inserted record ID. */ create(data: Record): Promise; /** * Update an existing record after validating the data. * @param id - The ID of the record to update. * @param data - The updated record data. * @returns The updated record ID. */ update(id: any, data: Record): Promise; /** * Delete a record by ID. * @param id - The ID of the record to delete. * @returns A confirmation message. */ delete(id: any): Promise; /** * Retrieve multiple records with optional query filters. * @param options - Query options such as filters, pagination, sorting, etc. * @returns An array of matching records. */ findMany(options?: QueryOptions): Promise; /** * Find a single record by ID. * @param id - The ID of the record to retrieve. * @param options - Query options for selecting specific fields. * @returns The found record or null. */ findUnique(id: any, options?: QueryOptions): Promise; /** * Handles unknown errors and ensures they are transformed into a proper `ReactIndexDBError`. * @param error - The caught error. * @returns {ReactIndexDBError} - A formatted error. */ private handleError; }