import { Ref, ComputedRef } from 'vue'; import { GraphQLClient, Product, Cluster, Contact, Customer, ProductsResponse, AttributeFilter, ProductTextFilterInput, Category, MediaImageProductSearchInput, TransformationsInput } from '@propeller-commerce/propeller-sdk-v2'; import { Availability } from '@propeller-commerce/propeller-v2-core-ui'; export interface UseProductSearchOptions { graphqlClient?: GraphQLClient; /** Controlled mode: pass products in, skip internal fetch */ products?: Ref<(Product | Cluster)[] | undefined>; categoryId?: Ref; term?: Ref; brand?: Ref; language?: Ref; taxZone?: string; user?: Ref; companyId?: Ref; /** Scope the product fetch to specific orderlist IDs (e.g. a chosen B2B contract). */ orderlistIds?: Ref; /** * Apply the orderlist filter. Defaults to `true` when `orderlistIds` is * non-empty, `false` otherwise — so an authenticated user without a contract * still sees the full catalogue. */ applyOrderlists?: Ref; /** * Attribute names to request per product, e.g. `['MPN']`. Unset returns the * first page of ALL attributes (12 per product), so products with more than * 12 silently lose the rest — name what you render. */ productTrackAttributes?: Ref; textFilters?: Ref; priceFilterMin?: Ref; priceFilterMax?: Ref; /** * Stock selection to filter by. `'all'` or unset sends no stock filter. * Filtering happens server-side, so `itemsFound` and the page count * describe the filtered set. */ availability?: Ref; /** Minimum stock quantity for the `'in-stock'` selection. */ minStock?: Ref; sortField?: Ref; sortOrder?: Ref; page?: Ref; pageSize?: Ref; configuration: { baseCategoryId?: number; /** The channel's anonymous user — logged-out listings are scoped to it. */ anonymousUserId?: number; imageSearchFiltersGrid?: MediaImageProductSearchInput; imageVariantFiltersMedium?: TransformationsInput; }; onFiltersChange?: (filters: AttributeFilter[]) => void; onPriceBoundsChange?: (min: number, max: number) => void; onItemsFoundChange?: (count: number) => void; onPageChange?: (page: number) => void; onProductsResponse?: (products: ProductsResponse) => void; onCategoryChange?: (category: Category) => void; } export interface UseProductSearchReturn { displayProducts: ComputedRef<(Product | Cluster)[]>; itemsFound: Ref; isLoading: ComputedRef; currentSortField: Ref; currentSortOrder: Ref; currentPage: Ref; totalPages: Ref; searchTerm: Ref; searchResults: Ref<(Product | Cluster)[]>; searchItemsFound: Ref; searchLoading: Ref; fetchProducts: () => Promise; search: (term: string) => void; goToPage: (page: number) => void; } export declare function useProductSearch(options: UseProductSearchOptions): UseProductSearchReturn;