import { Ref } from 'vue'; import { GraphQLClient, Cart, MediaImageProductSearchInput, TransformationsInput } from '@propeller-commerce/propeller-sdk-v2'; import { AnyUser } from '@propeller-commerce/propeller-v2-core-ui'; /** A product resolved from a typed code — the shape a row fills in on select. */ export interface QuickOrderMatch { productId: number; clusterId?: number; name: string; sku: string; netPrice: number; grossPrice: number; minQuantity: number; imageUrl: string; } /** One line a caller submits to be added to the cart. */ export interface QuickOrderLine { productId: number; quantity: number; clusterId?: number; code?: string; } export interface UseQuickOrderOptions { graphqlClient: GraphQLClient; /** The signed-in user (quick order is an authenticated feature). */ user?: AnyUser; /** Active company id — scopes cart + pricing for B2B users. */ companyId?: number; /** Language for search + cart queries. Defaults to `'NL'`. */ language?: string; /** Max typeahead results per row. Defaults to 8. */ searchLimit?: number; /** Tax zone for price calculation. Defaults to `'NL'`. */ taxZone?: string; /** Orderlist (contract) ids to scope the catalogue by. */ orderlistIds?: number[]; /** Set `false` to ignore `orderlistIds`. Defaults to true when ids are given. */ applyOrderlists?: boolean; /** Image filters + the base category the search is scoped to. */ configuration?: { /** The channel's anonymous user — logged-out listings are scoped to it. */ anonymousUserId?: number; imageSearchFiltersGrid?: MediaImageProductSearchInput; imageVariantFiltersSmall?: TransformationsInput; /** Catalog root. Without it the search returns nothing — see `searchProducts`. */ baseCategoryId?: number; }; onCartCreated?: (cart: Cart) => void; afterAddToCart?: (cart: Cart) => void; } export interface QuickOrderSubmitResult { success: boolean; cart?: Cart; added?: number; error?: string; } export interface UseQuickOrderReturn { submitting: Ref; error: Ref; searchProducts: (term: string) => Promise; submit: (lines: QuickOrderLine[]) => Promise; } export declare function useQuickOrder(options: UseQuickOrderOptions): UseQuickOrderReturn;