import { type IntentOptionsInput } from "../options/swish-options"; import { SwishApp } from "../swish"; import { SwishUi } from "../swish-ui/swish-ui"; import type { PreviewOptions, Product, ProductVariant } from "../types"; import { CreateCartLineHandler } from "./handlers/create-cart-line-handler"; import { CreateListHandler } from "./handlers/create-list-handler"; import { CreateSubscriptionHandler } from "./handlers/create-subscription-handler"; import { DeleteListHandler } from "./handlers/delete-list-handler"; import { EditItemListsHandler } from "./handlers/edit-item-lists-handler"; import { EditItemVariantHandler } from "./handlers/edit-item-variant-handler"; import { EditListAccessHandler } from "./handlers/edit-list-access-handler"; import { EditListHandler } from "./handlers/edit-list-handler"; import { InitiateCheckoutHandler } from "./handlers/initiate-checkout-handler"; import { InitiateQuickBuyHandler } from "./handlers/initiate-quick-buy-handler"; import { InitiateSignInHandler } from "./handlers/initiate-sign-in-handler"; import { InitiateSignOutHandler } from "./handlers/initiate-sign-out-handler"; import { SaveCartLineHandler } from "./handlers/save-cart-line-handler"; import { SaveItemHandler } from "./handlers/save-item-handler"; import { ShareListHandler } from "./handlers/share-list-handler"; import { ShowToastHandler } from "./handlers/show-toast-handler"; import { UnsaveItemHandler } from "./handlers/unsave-item-handler"; import { ViewHomeHandler } from "./handlers/view-home-handler"; import { ViewListDetailPageMenuHandler } from "./handlers/view-list-detail-page-menu-handler"; import { ViewListHandler } from "./handlers/view-list-handler"; import { ViewListMenuHandler } from "./handlers/view-list-menu-handler"; import { ViewListsHandler } from "./handlers/view-lists-handler"; import { ViewNotificationsHandler } from "./handlers/view-notifications-handler"; import { ViewOrderHandler } from "./handlers/view-order-handler"; import { ViewOrderMenuHandler } from "./handlers/view-order-menu-handler"; import { ViewOrdersHandler } from "./handlers/view-orders-handler"; import { ViewProductHandler } from "./handlers/view-product-handler"; import { ViewProfileHandler } from "./handlers/view-profile-handler"; import { ViewSavesHandler } from "./handlers/view-saves-handler"; import { Intent, IntentActivity, IntentQueryWithParams, IntentResponse, IntentToData } from "./types"; export interface IntentOptions { saveProduct: { promptVariantIfMissing: boolean | ((args: { product: Product; variant: ProductVariant | null | undefined; }) => boolean); promptVariantIfPresent: boolean; saveBeforeVariantPrompt: boolean; showFeedback: boolean; }; unsaveProduct: { selectList: boolean; confirm: boolean; showFeedback: boolean; }; editSavedProduct: { promptVariantChange: boolean; showFeedback: boolean; }; initiateQuickBuy: { promptVariantIfPresent: boolean; }; createCartLine: { afterComplete?: (response: IntentResponse<"create:cart-line">) => void; }; removeCartLine: { saveCartLine: boolean; }; saveCartLine: { confirm: boolean; showFeedback: boolean; /** Which list a saved cart line lands in. */ destination: "saved-from-cart" | "wishlist"; afterComplete?: (response: IntentResponse<"save:cart-line">) => void; }; } export declare class Intents { private readonly swish; private readonly ui; private readonly eventBus; private options; private features; private handlers; private _invoking; private readonly announced; constructor(swish: SwishApp, ui: SwishUi); applyPreview(preview: IntentOptionsInput | null | undefined): void; applyFeaturesPreview(preview: PreviewOptions["features"]): void; initHandlers(): { "create:cart-line": CreateCartLineHandler; "initiate:checkout": InitiateCheckoutHandler; "save:item": SaveItemHandler; "save:cart-line": SaveCartLineHandler; "unsave:item": UnsaveItemHandler; "edit:item-variant": EditItemVariantHandler; "edit:item-lists": EditItemListsHandler; "create:list": CreateListHandler; "edit:list": EditListHandler; "edit:list-access": EditListAccessHandler; "delete:list": DeleteListHandler; "view:home": ViewHomeHandler; "initiate:share": ShareListHandler; "view:list": ViewListHandler; "view:lists": ViewListsHandler; "view:orders": ViewOrdersHandler; "view:order": ViewOrderHandler; "view:saves": ViewSavesHandler; "view:notifications": ViewNotificationsHandler; "view:profile": ViewProfileHandler; "view:product": ViewProductHandler; "view:list-menu": ViewListMenuHandler; "view:order-menu": ViewOrderMenuHandler; "view:list-detail-page-menu": ViewListDetailPageMenuHandler; "initiate:sign-in": InitiateSignInHandler; "initiate:sign-out": InitiateSignOutHandler; "initiate:quick-buy": InitiateQuickBuyHandler; "create:subscription": CreateSubscriptionHandler; "show:toast": ShowToastHandler; }; publishAnalyticsEvent(event: string, data: Record): void; invoke(intent: I, ...args: IntentToData extends void ? [] | [undefined] : [IntentToData]): Promise>>; listen(intent: I, callback: (response: IntentResponse) => void): () => void; parseIntentFromString(intentString: Intent | IntentQueryWithParams): { intent: Intent; data: Record; }; parseIntentFromUrl(url: URL): { intent: Intent; data: Record; } | null; private mapParamNames; private resolveIntentData; private invokeFromParsed; parseIntentFromHash(hash: string): Intent | null; handleIntent(intent: I, data: IntentToData): Promise>; private isSignedIn; private requiresSignIn; initIntentHooks(): void; private initCartChangeListener; initIntentWatcher(): void; }