From 298f8db4c1386133887953cf1c055f71b487e049 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 10 Jun 2021 17:06:46 +0200 Subject: [PATCH] feat(ts): document renderingContent (algolia/algoliasearch-helper-js#823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(ts): document renderingContent Note: while the format will not change, it's not yet live * Apply suggestions from code review Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com> Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com> --- packages/algoliasearch-helper/index.d.ts | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/packages/algoliasearch-helper/index.d.ts b/packages/algoliasearch-helper/index.d.ts index e740477975..937da49cd5 100644 --- a/packages/algoliasearch-helper/index.d.ts +++ b/packages/algoliasearch-helper/index.d.ts @@ -1234,6 +1234,45 @@ declare namespace algoliasearchHelper { */ userData: any[]; + /** + * Content defining how the search interface should be rendered. + * This is set via the settings for a default value and can be overridden via rules + */ + renderingContent?: { + /** + * defining how facets should be ordered + */ + facetOrdering?: { + /** + * the ordering of facets (widgets) + */ + facet?: { + /** + * Ordered facet lists + */ + order: string[]; + }; + /** + * the ordering of facet values, within an individual list + */ + values?: { + [facet: string]: { + /** + * Ordered facet values + */ + order: string[]; + /** + * How to display the remaining items. + * - facet count (descending) + * - alphabetical (ascending) + * - hidden (show only pinned values) + */ + sortRemainingBy: 'count' | 'alpha' | 'hidden'; + }; + }; + }; + }; + /** * queryID is the unique identifier of the query used to generate the current search results. * This value is only available if the `clickAnalytics` search parameter is set to `true`.