Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Facet<Value> Abstract

Class representing facet and its state. Handles facet updates and fetching its own options.

Can be extended to create custom facet.

Type parameters

  • Value = unknown

Hierarchy

Index

Constructors

Properties

_sfsApi: undefined | SfsApi

This property is set by SfsApi class if it is passed to it on construction. _sfsApi is used to construct this facet's queries and to access event stream. Without setting this property, this facet cannot function properly.

_value: undefined | Value
id: string
isFetching: boolean = false

True if this facet is currently fetching options.

labelPredicates: string[]
optionCountVariable: string
optionLabelVariable: string
optionValueVariable: string
options: FacetOption[]

Current facet options.

predicate: string

Accessors

  • get value(): undefined | Value
  • set value(newValue: undefined | Value): void

Methods

  • buildOptionsQuery(): Query
  • Abstract method for building query used for fetching this facet options from current state. State of SfsApi should be accounted too. This method is implemented in individual facet types.

    Returns Query

    options query

  • getFacetConstraints(): undefined | Pattern[]
  • Facet constraints are patterns which this method represents for other Facets or SfsApi.

    Returns undefined | Pattern[]

    facet constraints

  • isActive(): boolean
  • Returns if this facet is active. Active facets are facets with a value and thus should be accounted in SfsApi all constraints.

    Returns boolean

  • processOptionsBindingsStream(stream: ReadableStream): Promise<FacetOption[]>

Generated using TypeDoc