import { Currency } from "./autocomplete"; import { CategoryAncestor } from "./smartCollections"; import { Channel, FullTextResults, SDKUtils } from "./common"; export interface fullTextSearchResponse { items: Product[]; facets: Facet[]; total_results: number; facets_completed?: boolean; sort_by?: SortBy; narrow: [string, string, string][]; pop_products_no_results?: boolean; p: number; total_p: number; personalized_products?: number[]; ancestor_categories?: CategoryAncestor[]; avoid_tag_prefixes?: string; merch?: any; turbolink?: string; related_categories?: RelatedCategoryServer[]; related_results?: boolean; banner_html?: string; title?: string; } export interface fullTextSearchProps { term: string; storeID: number; uuid: string; cdn: number; userToken: string; sessionStart: number; page?: number; productsPerPage?: number; sortBy?: SortBy; narrowBy?: Narrow[]; facetRequired?: FacetRequired; withAttributes?: boolean; recent?: string; recentTimestamps?: Record; cartTimestamps?: Record; searchWithinSearch?: string; segments?: string[]; hasShopifyMarkets?: boolean; companyLocationContext?: number; withProductTypes?: boolean; abTestingVariations?: { [key: string]: { [key: string]: any; }; }; disableMerchandising?: boolean; disableStrategies?: boolean; disableMerchandisingRules?: boolean; isPersonalizedFiltersActive?: boolean; disableTurbolinks?: boolean; searchPersonalization?: boolean; channel?: Channel; self?: SDKUtils; } export type SortBy = "price_min_to_max" | "price_max_to_min" | "creation_date" | "creation_date_oldest" | "popularity" | "reviews" | "a_to_z" | "z_to_a" | 'relevency'; export declare function isSortBy(sort: string | undefined): sort is SortBy; export type Narrow = [FilterGroupName, FilterValue]; type FilterGroupName = string; type FilterValue = string; export type FacetRequired = 0 | 1 | 2; export declare enum FeaturedRanking { FEATURED_RANK_NO = 0, FEATURED_RANK_ON_MATCH = 1, FEATURED_RANK_ALWAYS = 2, FEATURED_RANK_NEVER = 3 } export interface Product { c: Currency; d: string; f: FeaturedRanking; id: string; iso: boolean; l: string; p: string; p_c: string; p_max: string; p_max_c: string; p_min: string; p_min_c: string; p_spl: number; review?: number; reviews_count?: number; s: string; sku: string; skus: string[]; t: string; t2: string; u: string; v_c: number; v: string; vra: Variant[]; vrc: object; att?: Attribute[]; real_sku?: string; imageID?: string; alt?: AlternativeColor[]; rec_src?: number; } export type Variant = [number, VariantData[]]; export type VariantData = [string, string[]]; export type Attribute = [string, AttributeData[]]; export type AttributeData = string[] | string[][]; export type Facet = [string, FacetValue[] | CategoryFacetValue[] | ColorFamilyFacetValue[], string, boolean, number]; export type FacetValue = [string, number]; export type CategoryFacetValue = [string, number, string, string]; export type ColorFamilyFacetValue = [string, string, string]; export type fullTextCallback = ({}: { action: "products" | "facets and products" | "turbolink"; payload: FullTextResults; }) => void; export type fullTextProductsCallback = ({}: { payload: FullTextResults; }) => void; export type fullTextFacetsCallback = ({}: { payload: FullTextResults; }) => void; export interface RecentSerpProducts { id: string; time: number; } export type AlternativeColor = [AlternativeColorName, AlternativeColorURL]; type AlternativeColorName = string; type AlternativeColorURL = string; export interface RelatedCategoryServer { id: string; l: string; t: string; u: string; } export {};