import type {
  CatalogFilter,
  Page,
  Product,
  ReadOpts,
} from '@platform-modules/commerce-catalog'

/**
 * Injected, DB-free data seam for browser-side catalog reads (§1).
 * The host wires each method to an API route it owns (the route enforces the
 * audience/visibility floor). The one production transport is HTTP; an
 * in-process core wrapper and a mock are test doubles, not production adapters.
 * `db` is bound host-side and never appears here.
 */
export interface CatalogClient {
  getProductBySlug(slug: string, opts: ReadOpts): Promise<Product | null>
  getProductById(id: string, opts: ReadOpts): Promise<Product | null>
  listProducts(filter: CatalogFilter): Promise<Page<Product>>
}
