import type { SwishUiManifest, SwishUiOptions } from "../types"; import type { ShopBridge } from "../utils/shop-bridge"; import type { Ref, SwishUiElement } from "./swish-ui-element"; import "../utils/shop-bridge"; import { Item, ItemDetail } from "@swishapp/api-client"; import { GetProductCardDataWithVariantQuery, GetSelectedVariantQuery } from "../storefront-api/storefront-api-client"; export interface Notifications { pushNotification(notification: Notification): string; removeNotification(id: string): void; clearAllNotifications(): void; } export interface Notification { title?: string; text: string; image?: string; action?: { label: string; url?: string; onAction?: () => void; }; } export declare const setConfig: (opts: SwishUiOptions) => void; export declare const hideModal: (element: string | HTMLElement) => Promise; export declare const showModal: (element: string | HTMLElement) => Promise; export declare const showSignIn: (options?: { returnTo?: string; }) => Promise; export interface UnsaveAlertOptions { itemId: string; onSubmit?: (data: UnsaveAlertSubmitData) => void; onCancel?: () => void; } export interface UnsaveAlertSubmitData { itemId: string; } export declare const showUnsaveAlert: (options: UnsaveAlertOptions) => Promise; export declare const showDeleteListAlert: (options: { listId: string; onSubmit?: () => void; onCancel?: () => void; }) => Promise; export declare const showDrawer: () => Promise; export declare const showListMenu: (options: { listId: string; onClose?: (data: { reason: string; }) => void; }) => Promise; export interface ListSelectOptions { itemId: string; onSubmit?: (data: ListSelectSubmitData) => void | Promise; onClose?: () => void; onUnsave?: (data: UnsaveAlertSubmitData) => void; } export type ListSelectProduct = Exclude; export type ListSelectVariant = Exclude; export interface ListSelectSubmitData { item: ItemDetail; product: ListSelectProduct; variant?: ListSelectVariant; } export declare const showListSelect: (options: ListSelectOptions) => Promise; export declare const showNotification: (options: { title?: string; text: string; image?: string; action?: { label: string; url?: string; onAction?: () => void; }; }) => Promise; export declare const hideAllNotifications: () => Promise; export interface VariantSelectOptions { productId?: string; productHandle?: string; variantId?: string; displayType?: "rows" | "pills"; action?: "none" | "save"; onSubmit: (data: VariantSelectSubmitData) => void; } export type VariantSelectProduct = Exclude; export type VariantSelectVariant = Exclude; export interface VariantSelectSubmitData { item: Item; product: VariantSelectProduct; variant: VariantSelectVariant; } export declare const showVariantSelect: (options?: VariantSelectOptions) => Promise; export declare const showListEditor: (options?: { listId?: string; variantId?: string; onSubmit: (data: TData) => void | Promise; }) => Promise; export declare const initShopBridge: ({ onShopModalOpen, }: { onShopModalOpen: () => void; }) => Promise; export declare const loadManifest: () => Promise; export interface RequireUiComponentOptions { instance?: string; listeners?: Record void>; onHydrated?: (ref: Ref) => void; } export declare const requireUiComponent: (name: string, options?: RequireUiComponentOptions) => Promise; export declare const insertComponent: ({ name, instance, template, position, refElement, }: { name: string; instance?: string; template: string; position: InsertPosition; refElement: HTMLElement; }) => Promise; export declare const queryComponent: (name: string, instance?: string) => T;