declare module '@blotoutio/providers-shop-gpt-sdk' declare global { const registryKey: unique symbol type Views = 'overlay' | 'modal' type Modes = 'disabled' | 'enabled' | 'ab-test' | 'preview' type Sender = 'user' | 'bot' type CustomPromptUserType = 'anonymous' | 'returning' | 'both' type UIAction = | 'shopGPTInitialized' | 'shopGPTLoaded' | 'chatbotOpened' | 'chatbotClosed' | 'singleThreadDelete' | 'allThreadsDelete' | 'switchThread' | 'newSearch' | 'thumbsUp' | 'thumbsDown' | 'showThreads' | 'queryInteractions' | 'promptClicked' | 'customPromptClicked' | 'productRecommendationClicked' | 'blotoutLinkClicked' | 'searchMinimised' | 'chatbotOpened-search-query' | 'chatbotOpened-search-support' | 'chatbotOpened-search-other' | 'chatbotOpened-nudge-query' | 'chatbotOpened-nudge-support' | 'chatbotOpened-nudge-other' type CustomPrompt = { prompt: string link: string userType: CustomPromptUserType } type DevContext = { email?: string city?: string productHandle?: string firstName?: string gender?: string state?: string preferences?: { size?: string color?: string material?: string } } type ProductResponse = { id: string | undefined title: string image: { url: string alt: string } url: string handle: string hasOnlyDefaultVariant: boolean description: string options: { name: string values: string[] }[] variants: { title: string url: string displayName: string id: string image: | { url: string alt: string } | undefined | null price: string comparedAtPrice: string | null selectedOptions: { name: string; value: string }[] }[] } type MessageFeedback = { rating: 'good' | 'bad' comment?: string | null } type QueryResponse = { messageId: string message: string sender: Sender products?: ProductResponse[] chatTitle?: string feedback?: MessageFeedback prompts?: string[] } type UIPreferences = { mode: Modes view: Views devMode: boolean targetPath: string | undefined maxThreadAge: number | undefined merchantProfiles: Profile[] | undefined productHandles: string[] | undefined merchantImageUrl: string | undefined merchantUrl: string | undefined botIconUrl: string | undefined css?: string nudge?: { show?: boolean timeout?: number sound?: boolean prompt?: string welcomeMessage?: string } loadUIManually: boolean | undefined } type Profile = { email?: string firstName?: string lastName?: string gender?: string city?: string state?: string hasOrderHistory?: boolean preferences?: { size?: string color?: string materialType?: string } } type SiteCurrency = { currency: string rate: number } type ChatThreadResponse = { threadId: string title: string devContext?: DevContext createdAt: number } type CreateThreadPayload = { title: string devContext?: DevContext } type StoreAPI = { addToCart: (item: { productId: string variantId: string quantity: number }) => Promise refreshCart?: () => Promise getSiteCurrency: () => Promise getCurrentProductHandle: () => string | undefined getCustomerId: () => Promise } type StoreAPIFactory = (fetchImpl?: typeof fetch) => StoreAPI type UIImplementation = { init: (params: { destination: string storeAPI: StoreAPI shopGPTAPI: ShopGPTAPI devMode?: boolean view?: Views merchantUrl?: string merchantImage?: string profiles?: Profile[] productHandles?: string[] path: string | undefined brandName: string | undefined quickPrompts: string | undefined supportPrompts: string | undefined searchSuggestions: string[] latestThreadLoad: number botIconUrl: string | undefined css?: string nudge?: UIPreferences['nudge'] sessionId: string | undefined loadUIManually: boolean | undefined userId: string attachmentsEnabled?: boolean addToCartEnabled?: boolean }) => void loadUI: () => void destroy: () => void show: () => void hide: () => void } type ShopGPTAPI = { processQuery: ( query: string, threadId: string, productHandle?: string ) => Promise fetchChatHistory: (threadId?: string) => Promise fetchChatThreads: () => Promise createChatThread: ( payload: CreateThreadPayload ) => Promise deleteSingleThread: (threadId: string) => Promise deleteAllThreads: () => Promise saveFeedback: ( messageId: string, queryMessageId: string, threadId: string, feedback: MessageFeedback ) => Promise fetchCustomPrompts: ( threadId: string ) => Promise[]> sendEvent: ( action: UIAction, currency?: string, actionData?: Record, clickData?: Record, boolean?: boolean ) => void sendUserData: (data: Record) => void getUserData: (keys: string[]) => Promise> } interface Window { [registryKey]: { storeAPIFactory?: StoreAPIFactory ui?: UIImplementation shopGPTAPI?: ShopGPTAPI storeAPI?: StoreAPI devMode?: boolean } } }