instantsearch.js 4.39.1 → 4.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import type { SendEventForFacet } from '../../lib/utils';
2
+ import type { SearchResults } from 'algoliasearch-helper';
2
3
  import type { Connector, CreateURL, TransformItems, SortBy, WidgetRenderState } from '../../types';
3
4
  export declare type HierarchicalMenuItem = {
4
5
  /**
@@ -58,7 +59,7 @@ export declare type HierarchicalMenuConnectorParams = {
58
59
  *
59
60
  * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed
60
61
  */
61
- sortBy?: SortBy<HierarchicalMenuItem>;
62
+ sortBy?: SortBy<SearchResults.HierarchicalFacet>;
62
63
  /**
63
64
  * Function to transform the items passed to the templates.
64
65
  */
@@ -1,3 +1,4 @@
1
+ import type { SearchResults } from 'algoliasearch-helper';
1
2
  import type { SendEventForFacet } from '../../lib/utils';
2
3
  import type { Connector, CreateURL, SortBy, TransformItems, WidgetRenderState } from '../../types';
3
4
  export declare type MenuItem = {
@@ -42,7 +43,7 @@ export declare type MenuConnectorParams = {
42
43
  *
43
44
  * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed
44
45
  */
45
- sortBy?: SortBy<MenuItem>;
46
+ sortBy?: SortBy<SearchResults.HierarchicalFacet>;
46
47
  /**
47
48
  * Function to transform the items passed to the templates.
48
49
  */
@@ -1,3 +1,4 @@
1
+ import type { SearchResults } from 'algoliasearch-helper';
1
2
  import type { SendEventForFacet } from '../../lib/utils';
2
3
  import type { Connector, TransformItems, SortBy, CreateURL, WidgetRenderState } from '../../types';
3
4
  export declare type RefinementListItem = {
@@ -52,7 +53,7 @@ export declare type RefinementListConnectorParams = {
52
53
  *
53
54
  * If a facetOrdering is set in the index settings, it is used when sortBy isn't passed
54
55
  */
55
- sortBy?: SortBy<RefinementListItem>;
56
+ sortBy?: SortBy<SearchResults.FacetValue>;
56
57
  /**
57
58
  * Escapes the content of the facet values.
58
59
  */
@@ -1,2 +1,2 @@
1
- declare const _default: "4.39.1";
1
+ declare const _default: "4.39.2";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.39.1';
1
+ export default '4.39.2';
@@ -136,10 +136,11 @@ export declare type TransformItemsMetadata = {
136
136
  * Transforms the given items.
137
137
  */
138
138
  export declare type TransformItems<TItem, TMetadata = TransformItemsMetadata> = (items: TItem[], metadata: TMetadata) => TItem[];
139
+ declare type SortByDirection<TCriterion extends string> = TCriterion | `${TCriterion}:asc` | `${TCriterion}:desc`;
139
140
  /**
140
141
  * Transforms the given items.
141
142
  */
142
- export declare type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<'count' | 'isRefined' | 'name:asc' | 'name:desc'>;
143
+ export declare type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<SortByDirection<'count' | 'name' | 'isRefined'>>;
143
144
  /**
144
145
  * Creates the URL for the given value.
145
146
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.39.1",
3
+ "version": "4.39.2",
4
4
  "description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
5
5
  "homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
6
6
  "types": "es/index.d.ts",