import {  IRequestUiMeta, IUrl } from '@api-client/core/build/browser.js';
import { DBSchema } from 'idb/with-async-ittr';

export interface IStoredRequestUi {
  data: IRequestUiMeta;
  meta: { key: string; project: string; }
}

export type StoreName = 'UrlHistory' | 'WsHistory' | 'ProjectUi';

export interface HttpClientDB extends DBSchema {
  UrlHistory: {
    key: string;
    value: IUrl;
  }
  WsHistory: {
    key: string;
    value: IUrl;
  }
  ProjectUi: {
    key: string[];
    value: IStoredRequestUi;
    indexes: {
      project: string;
    }
  }
}
