import { IDBPDatabase } from "idb";
import { HttpClientDB } from "../types.js";
import { HttpClientIdbDatabase } from "../HttpClientIdbDatabase.js";

export abstract class IdbStore {
  /**
   * @param parent The parent data store object
   */
  constructor(public parent: HttpClientIdbDatabase, public db: IDBPDatabase<HttpClientDB>) {}
  
  /**
   * A logic to be implemented when the model starts-up.
   * It is optional to implement but always called.
   */
  async warmup(): Promise<void> {
    // 
  }

  /**
   * Cleans up before shut down.
   * It is optional to implement but always called.
   */
  async cleanup(): Promise<void> {
    // 
  }
}
