import { IntentHandler } from "../intent-handler"; import { IntentResponse, SuccessIntentResponse } from "../types"; /** Marks a wishlist item that came from the cart, by either path into it. */ export declare const SAVED_FROM_CART_TAG = "saved-from-cart"; export interface SaveCartLineIntentData { items: Array<{ productId: number; variantId: number; quantity: number; title?: string; image?: string; variantTitle?: string; }>; } export type SaveCartLineSuccessResponse = SuccessIntentResponse; export declare class SaveCartLineHandler extends IntentHandler<"save:cart-line"> { /** Create and undo must agree on the destination — derive it in one place. */ private get savesToWishlist(); invoke(data: SaveCartLineIntentData): Promise>; /** * Drops lines the shopper already has in their wishlist: offering to save * them again reads as a glitch. It also protects the wishlist destination — * the API de-dupes that create onto the existing item, so an undo would * delete the shopper's original save. A product-level save (no variant) * covers every variant of it. If the lookup fails, every line is kept. */ private withoutWishlisted; /** Nothing is saved unless the user accepts the prompt toast. */ private saveWithPrompt; /** * Items are saved right away while the feedback toast offers an undo * window. The toast shows before the save requests complete; if the save * then fails, the toast is retracted so it can't claim success. */ private saveWithUndo; private removeSavedItems; private createItems; }