import { ReadonlySignal } from "@preact/signals-core"; import type { SwishApp } from "../swish"; import type { Product, ProductVariant } from "../types"; export interface ProductIds { /** Shopify product ID or GID. */ productId: string | number; /** Shopify variant ID or GID. Resolves the saved variant when present. */ variantId?: string | number | null; } export interface ProductState { product: Product | null; variant: ProductVariant | null; /** `true` until the product has resolved (or failed) once. */ loading: boolean; error: Error | null; } export type ProductSignal = ReadonlySignal & { dispose: () => void; }; /** * Render-ready product data for one saved item. Thin signal over * `swish.storefront.loadResolvedProduct`, cached in the TanStack client so * every card asking for the same product shares one request, and excluded * from localStorage persistence like all storefront product data. */ export declare const productSignal: (swish: SwishApp) => (ids: ProductIds) => ProductSignal;