From 4b4bbb91456062c8d29d17bdac741ca5ac26ae6b Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Fri, 4 Jun 2021 15:46:58 +0200 Subject: [PATCH 1/2] feat(ts): document renderingContent Note: while the format will not change, it's not yet live --- index.d.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/index.d.ts b/index.d.ts index e74047797..41878f5b3 100644 --- a/index.d.ts +++ b/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?: { + /** + * pinned order of facet lists + */ + order: string[]; + }; + /** + * the ordering of facet values, within an individual list + */ + values?: { + [facet: string]: { + /** + * pinned order of 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`. From 669737ba5cca8780d9ea9edd8ff532ac89ef5122 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 10 Jun 2021 13:21:52 +0200 Subject: [PATCH 2/2] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com> --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 41878f5b3..937da49cd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1248,7 +1248,7 @@ declare namespace algoliasearchHelper { */ facet?: { /** - * pinned order of facet lists + * Ordered facet lists */ order: string[]; }; @@ -1258,7 +1258,7 @@ declare namespace algoliasearchHelper { values?: { [facet: string]: { /** - * pinned order of facet values + * Ordered facet values */ order: string[]; /**