import { AutocompleteResults, CollectionsPersonalization } from "./common"; import { Product } from "./fullTextSearch"; import { ArticleResponse } from "../services/content"; export interface DashboardResponse extends DashboardKeys { cdn_cache_key: number; platform: string; state?: number; } export interface DashboardKeys { site_url: string; site_domain?: string; disable_categories_suggestions: boolean; max_popular_categories_suggestions: number; max_popular_searches_suggestions: number; max_product_suggestions: number; using_isp_api: boolean; isp_personalized_search_enabled: boolean; isp_personalized_collection_enabled: boolean; show_popular_products_on_focus: boolean; products_per_page: number; categories_products_per_page: number; is_content: boolean; has_bloomreach?: boolean; is_klaviyo_recommendations?: boolean; has_shopify_markets?: boolean; ab_testing_variations?: { [key: string]: { [key: string]: object; }; }; headers_language?: string; is_personalized_filter?: boolean; has_visual_discovery_tapcart?: boolean; collectionsPersonalization?: CollectionsPersonalization; searchPersonalization?: boolean; is_attentive_recommendations?: boolean; isp_attentive?: boolean; } export interface PopResponse { products: Product[]; q2p: string[]; searches?: string[]; } export type Currency = string | 'USD' | 'CRC' | 'AUD' | 'AZN' | 'NZD' | 'CAD' | 'VES' | 'SGD' | 'COP' | 'GBP' | 'BRL' | 'ILS' | 'AED' | 'JMD' | 'MYR' | 'THB' | 'DKK' | 'EGP' | 'NOK' | 'SEK' | 'HKD' | 'ZAR' | 'CHF' | 'HRK' | 'INR' | 'UAH' | 'RUB' | 'BYR' | 'IRR' | 'MXN' | 'TWD' | 'TRY' | 'TRL' | 'TL' | 'PLN' | 'HUF' | 'BGN' | 'EUR' | 'NGN' | 'RON' | 'VND' | 'BDT' | 'XOF' | 'JPY' | 'CNY' | 'KRW' | 'ARS'; export interface FastCategory { d: string; id: string; l: string; p_id: string; t: string; u: string; parent_name?: string; } export interface FastTurbolinks { l: string; t: string; u: string; } export interface PopularSearchesResponse { items: PopularSearch[]; term: string; } export interface PopularSearch { label: string; type: "p"; } export interface AutocompleteProductsResponse { total_results: number; items: Product[]; term: string; searches?: string[]; categories?: FastCategory[]; } export type AutocompleteCallback = ({}: { action: "instantSearch"; payload: AutocompleteResults; }) => void; export type AutocompleteContentCallback = ({}: { action: "instantSearchArticles"; payload: { articles: ArticleResponse[]; query: string; }; }) => void;