changes.mady.by.user Jordan Kasper (Deactivated)
Saved on Aug 31, 2022
Saved on Nov 01, 2022
...
type FacetType = | 'checkbox' | 'color' | 'date-range' | 'link' | 'numeric-range' | 'range-slider' | 'recent-searches' | 'related-searches' | 'search' | 'size' | 'tabs' | 'unsupported';
interface FacetValueColor { name: string; hex?: string; imageUrl?: string; }
interface FacetValue { title: string; imageUrl?: string; value?: string; color?: FacetValueColor; count?: number; level?: number; selected?: boolean; excluded?: boolean; children?: Array<FacetValue>; }
interface
FacetRange<T> { type: string; min: T; max: T; start: T; end: T; } interface DateFacetRange extends FacetRange<Date> { type: 'date'; } interface NumericFacetRange extends FacetRange<number> { type: 'numeric'; }
interface Facet { id: number;
type:
FacetType;
title:
string;
values?:
Array<FacetValue>;
field:
collapsible:
boolean;
collapsed?:
range?:
DateFacetRange | NumericFacetRange; searchable?: boolean; searchWithin?: string; tooltip?: string; truncateThreshold?: number; visible: boolean; }
interface PaginationOption { title: string; pageSize: number; selected: boolean; default: boolean; }
interface Pagination { page: number; pageSize: number; totalPages: number; totalResults: number; maxPageLinks?: number; displayFirstLink: boolean; displayLastLink: boolean; options: Array<PaginationOption>; }
interface Redirect { url: string; target?: string; }
export interface SelectedFacetValue { title: string; value: string; excluded: boolean; }
interface SelectedFacet { field: string; title: string; values: Array<SelectedFacetValue>; }
type SearchResultsItemType = 'content' | 'product';
interface SearchResultsItem {
attributes?:
{
[key: string]:
Array<string>;
};
description?:
id:
string; imageUrl?: string;
pinned:
price?:
number;
salePrice?: number;
score: number;
title: string;
type: SearchResultsItemType;
url: string
;
visible: boolean; }
interface SortingOption { title: string; value: string; default: boolean; selected: boolean; }
interface Sorting { value?: string; options: Array<SortingOption>; }
interface SearchResponse { contentZones?: ContentZones; facets?: Array<Facet>; modifiedQuery?: string; pagination?: Pagination; query?: string; querySuggestions?: Array<string>; redirect?: Redirect; results?: Array<SearchResultsItem>; selectedFacets?: Array<SelectedFacet>; sorting?: Sorting; success: boolean; trackingId: string; }
type SelectedFacets = { [key: string]: Array<string> | undefined; };
interface SearchRequest { disableSpellcheck?: boolean; facets?: SelectedFacets; newRequest: boolean; pageSize?: number; page?: number; query?: string; searchWithin?: string; sort?: string; }