import { IDBPDatabase } from "idb/build/entry"; import { StoreNames } from "idb"; import { StorageEntity } from "../entities/StorageEntity"; import { ConditionCallback, HandlerCallback, IStorageService } from "./IStorageService"; import { PaginationOptions } from "../models/PaginationOptions"; /** * abstract class AbstractStorageService */ export declare abstract class AbstractStorageService implements IStorageService { protected db: IDBPDatabase | any; protected databaseName: string; protected version: number; protected storeName: StoreNames | any; protected autoIncrementKey: boolean; protected constructor(databaseName: string); protected init(): Promise; /** * @param item {any} * @returns { string | null } */ validateValidItem(item: any): string | null; /** * delete all items * @returns {Promise} */ clear(): Promise; /** * @param key - wallet address is the key * @returns {Promise} */ delete(key: string): Promise; /** * get item by key * @param key * @returns {Promise<* | null>} */ get(key: string): Promise; /** * Put an item into the database, and will replace the item with the same key. * @param key * @param value * @returns {Promise} */ put(key: string, value: T): Promise; /** * get the first item * @returns {Promise<* | null>} */ getFirst(): Promise; /** * get all of keys * @param query * @param maxCount * @returns {Promise | null>} */ getAllKeys(query?: string, maxCount?: number): Promise | null>; /** * query all items * @param query * @param maxCount * @returns {Promise | null>} */ getAll(query?: string, maxCount?: number): Promise | null>; /** * query items * @param condition {ConditionCallback} * @param pageOptions {PaginationOptions} * @returns {Promise | null>} */ query(condition?: ConditionCallback, pageOptions?: PaginationOptions): Promise | null>; /** * @param condition {ConditionCallback} * @param updateHandler {HandlerCallback} * @returns {Promise} */ update(condition: ConditionCallback, updateHandler: HandlerCallback): Promise; /** * Retrieves the number of records matching the given condition * @param condition {ConditionCallback} * @returns {Promise} */ count(condition?: ConditionCallback): Promise; /** * @param value {any} * @returns {string | null} */ getKeyByItem(value: any): string | null; } //# sourceMappingURL=AbstractStorageService.d.ts.map