import { Ref } from 'vue'; import { GraphQLClient, Cart, Bundle, MediaImageProductSearchInput, TransformationsInput } from '@propeller-commerce/propeller-sdk-v2'; import { AnyUser } from '@propeller-commerce/propeller-v2-core-ui'; export interface UseProductBundlesOptions { graphqlClient: GraphQLClient; user: Ref; companyId?: Ref; language?: Ref; configuration: { language?: string; imageSearchFiltersGrid: MediaImageProductSearchInput; imageVariantFiltersSmall: TransformationsInput; }; onCartCreated?: (cart: Cart) => void; } /** * A bundle as the component consumes it. `BundleService.getBundles` * returns `BundlesResponse` whose `items` are SDK `Bundle` objects * (`id`, `name`, `description`, `condition`, `price`, `items`), so this * is an alias of the SDK type. */ export type BundleItem = Bundle; export interface UseProductBundlesReturn { bundles: Ref; loading: Ref; adding: Ref; error: Ref; cartId: Ref; fetchBundles: (productId: number) => Promise; addBundleToCart: (bundleId: string, existingCartId?: string) => Promise<{ success: boolean; cart?: Cart; error?: string; }>; calcDiscountPercent: (original: number, discounted: number) => number; } export declare function useProductBundles(options: UseProductBundlesOptions): UseProductBundlesReturn;