Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
nameFacet
Code Block
languagetypescript
type FacetType =
    | 'checkbox'
    | 'color'
    | 'date-range'
    | 'link'
    | 'numeric-range'
    | 'range-slider'
    | 'recent-searches'
    | 'related-searches'
    | 'search'
    | 'size'
    | 'tabs'
    | 'unsupported';

Code Block
languagetypescript
interface FacetValueColor {
    name: string;
    hex?: string;
    imageUrl?: string;
}

Code Block
languagetypescript
interface FacetValue {
    title: string;
    imageUrl?: string;
    value?: string;
    color?: FacetValueColor;
    count?: number;
    level?: number;
    selected?: boolean;
    excluded?: boolean;
    children?: Array<FacetValue>;
}

Code Block
languagetypescript
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';
}

Code Block
languagetypescript
interface Facet {
    id: number;
    type: FacetType;
    title: string;
    values?: Array<FacetValue>;
    field?: string;
    collapsible: boolean;
    collapsed?: boolean;
    range?: DateFacetRange | NumericFacetRange;
    searchable?: boolean;
    searchWithin?: string;
    tooltip?: string;
    truncateThreshold?: number;
    visible: boolean;
}

...