import { InjectionKey, Component } from 'vue'; import { Cart, CartMainItem, Product, Cluster } from '@propeller-commerce/propeller-sdk-v2'; /** * Tier 2 grid config context. Collapses the feature-flag / display and * callback props that `ProductGrid` otherwise cascades through * `ProductCard` / `ClusterCard` down to `AddToCart` / `ItemStock`. * `ProductGrid` is the provider; the card subtree consumes via * `useProductGridConfig()` instead of receiving ~20 threaded props. */ export interface ProductGridConfig { columns: number; showPrice?: boolean; showStock?: boolean; showAvailability?: boolean; enableAddFavorite?: boolean; allowAddToCart?: boolean; createCart?: boolean; showModal?: boolean; allowIncrDecr?: boolean; enableStockValidation?: boolean; cartId?: string; childItems?: number[]; notes?: string; price?: number; stockLabels?: Record; priceLabels?: Record; addToCartLabels?: Record; onCartCreated?: (cart: Cart) => void; afterAddToCart?: (cart: Cart, item?: CartMainItem) => void; onProceedToCheckout?: () => void; onRequestQuoteClick?: (cart: Cart) => void; onToggleFavorite?: (item: Product | Cluster, isFavorite: boolean) => void; onProductClick?: (product: Product) => void; onClusterClick?: (cluster: Cluster) => void; priceComponent?: Component; stockComponent?: Component; addToCartComponent?: Component; imageComponent?: Component; badgesComponent?: Component; favoriteComponent?: Component; bundlesComponent?: Component; bulkPricesComponent?: Component; surchargesComponent?: Component; productCardComponent?: Component; clusterCardComponent?: Component; /** * Render arbitrary content directly below each card's product name. Receives * the product as a prop; cascades to every ProductCard. Lets hosts surface * extra per-product info (e.g. package descriptions) across the whole grid * without swapping the entire card. */ belowNameComponent?: Component; } /** Injection key for the Tier 2 grid config. Symbol-keyed, collision-free. */ export declare const ProductGridInjectionKey: InjectionKey; /** * Install the grid config for the card subtree. `ProductGrid` calls this in * its `setup()`; `ProductCard` / `ClusterCard` and their children read it. */ export declare function provideProductGridConfig(value: ProductGridConfig): void; /** * Non-throwing: `ProductCard` / `ClusterCard` used outside a grid * (`ProductSlider`, standalone, tests) get `null` and fall back to explicit * props / defaults. */ export declare function useProductGridConfig(): ProductGridConfig | null;