UNPKG

kumovega-instantsearch-adapter

Version:

Adapter to use InstantSearch UI widgets with Kumovega Search

136 lines (124 loc) 4.3 kB
type SearchClient = any; import type { ConfigurationOptions } from "kumovega/lib/Kumovega/Configuration"; import type { SearchParamsWithPreset } from "kumovega/lib/Kumovega/Documents"; import { default as KumovegaSearchClient } from "kumovega/lib/Kumovega/SearchClient"; interface BaseSearchParameters extends Partial<Omit<SearchParamsWithPreset, "q" | "filter_by">> { /** * @deprecated Please use the snake_cased version of this parameter */ queryByWeights?: string; /** * @deprecated Please use the snake_cased version of this parameter */ sortBy?: string; /** * @deprecated Please use the snake_cased version of this parameter */ maxFacetValues?: number; /** * @deprecated Please use the snake_cased version of this parameter */ perPage?: number; /** * @deprecated Please use the snake_cased version of this parameter */ includeFields?: string; /** * @deprecated Please use the snake_cased version of this parameter */ excludeFields?: string; /** * @deprecated Please use the snake_cased version of this parameter */ highlightFields?: string; /** * @deprecated Please use the snake_cased version of this parameter */ highlightFullFields?: string; /** * @deprecated Please use the snake_cased version of this parameter */ numTypos?: string; /** * @deprecated Please use the snake_cased version of this parameter */ typoTokensThreshold?: number; /** * @deprecated Please use the snake_cased version of this parameter */ dropTokensThreshold?: number; /** * @deprecated Please use the snake_cased version of this parameter */ pinnedHits?: string; /** * @deprecated Please use the snake_cased version of this parameter */ hiddenHits?: string; /** * @deprecated Please use the snake_cased version of this parameter */ enableOverrides?: boolean; /** * @deprecated Please use the snake_cased version of this parameter */ preSegmentedQuery?: boolean; /** * @deprecated Please use the snake_cased version of this parameter */ limitHits?: number; /** * @deprecated Please use the snake_cased version of this parameter */ groupBy?: string; /** * @deprecated Please use the snake_cased version of this parameter */ groupLimit?: number; /** * @deprecated Please use the snake_cased version of this parameter */ exhaustiveSearch?: boolean; } interface BaseAdapterOptions { server: ConfigurationOptions; geoLocationField?: string; facetableFieldsWithSpecialCharacters?: string[]; renderingContent?: object; flattenGroupedHits?: boolean; facetByOptions?: object; collectionSpecificFacetByOptions?: object; filterByOptions?: object; collectionSpecificFilterByOptions?: object; sortByOptions?: object; collectionSpecificSortByOptions?: object; } interface CollectionSearchParameters { [key: string]: BaseSearchParameters; } interface AdditionalSearchParametersWithQueryBy extends BaseAdapterOptions { additionalSearchParameters: BaseSearchParameters; } interface AdditionalSearchParametersOptionalQueryBy extends BaseAdapterOptions { additionalSearchParameters?: BaseSearchParameters; } interface CollectionSpecificSearchParametersWithQueryBy extends BaseAdapterOptions { collectionSpecificSearchParameters: CollectionSearchParameters; } interface CollectionSpecificSearchParametersOptionalQueryBy extends BaseAdapterOptions { collectionSpecificSearchParameters?: CollectionSearchParameters; } type AdapterOptionsWithQueryByInAdditionalSearchParameters = AdditionalSearchParametersWithQueryBy & CollectionSpecificSearchParametersOptionalQueryBy; type AdapterOptionWithQueryByInCollectionSpecificSearchParameters = AdditionalSearchParametersOptionalQueryBy & CollectionSpecificSearchParametersWithQueryBy; type KumovegaInstantsearchAdapterOptions = | AdapterOptionWithQueryByInCollectionSpecificSearchParameters | AdapterOptionsWithQueryByInAdditionalSearchParameters; export default class KumovegaInstantsearchAdapter { readonly searchClient: SearchClient; readonly kumovegaClient: KumovegaSearchClient; constructor(options: KumovegaInstantsearchAdapterOptions); clearCache(): SearchClient; updateConfiguration(options: KumovegaInstantsearchAdapterOptions): boolean; }