instantsearch.js 4.49.4 → 4.50.1

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.
Files changed (167) hide show
  1. package/cjs/components/Pagination/Pagination.js +1 -1
  2. package/cjs/connectors/hits/connectHits.js +2 -1
  3. package/cjs/connectors/infinite-hits/connectInfiniteHits.js +3 -2
  4. package/cjs/lib/InstantSearch.js +3 -7
  5. package/cjs/lib/templating/prepareTemplateProps.js +1 -2
  6. package/cjs/lib/templating/renderTemplate.js +3 -0
  7. package/cjs/lib/utils/createSendEventForHits.js +6 -5
  8. package/cjs/lib/version.js +1 -1
  9. package/cjs/widgets/hits/hits.js +3 -4
  10. package/cjs/widgets/index/index.js +18 -1
  11. package/cjs/widgets/infinite-hits/infinite-hits.js +3 -4
  12. package/dist/instantsearch.development.d.ts +11 -3
  13. package/dist/instantsearch.development.js +89 -37
  14. package/dist/instantsearch.development.js.map +1 -1
  15. package/dist/instantsearch.production.d.ts +11 -3
  16. package/dist/instantsearch.production.min.d.ts +11 -3
  17. package/dist/instantsearch.production.min.js +2 -2
  18. package/dist/instantsearch.production.min.js.map +1 -1
  19. package/es/components/Answers/Answers.d.ts +3 -3
  20. package/es/components/Breadcrumb/Breadcrumb.d.ts +3 -3
  21. package/es/components/ClearRefinements/ClearRefinements.d.ts +3 -3
  22. package/es/components/CurrentRefinements/CurrentRefinements.d.ts +2 -2
  23. package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
  24. package/es/components/GeoSearchControls/GeoSearchControls.d.ts +1 -1
  25. package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
  26. package/es/components/Highlight/Highlight.d.ts +2 -2
  27. package/es/components/Hits/Hits.d.ts +3 -3
  28. package/es/components/InfiniteHits/InfiniteHits.d.ts +3 -3
  29. package/es/components/MenuSelect/MenuSelect.d.ts +4 -4
  30. package/es/components/Pagination/Pagination.d.ts +3 -3
  31. package/es/components/Pagination/Pagination.js +1 -1
  32. package/es/components/Panel/Panel.d.ts +3 -3
  33. package/es/components/PoweredBy/PoweredBy.d.ts +2 -2
  34. package/es/components/QueryRuleCustomData/QueryRuleCustomData.d.ts +3 -3
  35. package/es/components/RangeInput/RangeInput.d.ts +3 -3
  36. package/es/components/RefinementList/RefinementList.d.ts +7 -7
  37. package/es/components/RefinementList/RefinementListItem.d.ts +1 -1
  38. package/es/components/RelevantSort/RelevantSort.d.ts +3 -3
  39. package/es/components/ReverseHighlight/ReverseHighlight.d.ts +2 -2
  40. package/es/components/ReverseSnippet/ReverseSnippet.d.ts +2 -2
  41. package/es/components/SearchBox/SearchBox.d.ts +5 -5
  42. package/es/components/Selector/Selector.d.ts +3 -3
  43. package/es/components/Slider/Rheostat.d.ts +6 -6
  44. package/es/components/Slider/Slider.d.ts +2 -2
  45. package/es/components/Snippet/Snippet.d.ts +2 -2
  46. package/es/components/Stats/Stats.d.ts +3 -3
  47. package/es/components/Template/Template.d.ts +1 -1
  48. package/es/components/ToggleRefinement/ToggleRefinement.d.ts +3 -3
  49. package/es/components/VoiceSearch/VoiceSearch.d.ts +3 -3
  50. package/es/connectors/answers/connectAnswers.d.ts +4 -4
  51. package/es/connectors/autocomplete/connectAutocomplete.d.ts +4 -4
  52. package/es/connectors/breadcrumb/connectBreadcrumb.d.ts +5 -5
  53. package/es/connectors/clear-refinements/connectClearRefinements.d.ts +4 -4
  54. package/es/connectors/configure/connectConfigure.d.ts +5 -5
  55. package/es/connectors/configure-related-items/connectConfigureRelatedItems.d.ts +5 -5
  56. package/es/connectors/current-refinements/connectCurrentRefinements.d.ts +6 -6
  57. package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +4 -4
  58. package/es/connectors/geo-search/connectGeoSearch.d.ts +6 -6
  59. package/es/connectors/hierarchical-menu/connectHierarchicalMenu.d.ts +5 -5
  60. package/es/connectors/hits/connectHits.d.ts +4 -4
  61. package/es/connectors/hits/connectHits.js +2 -1
  62. package/es/connectors/hits-per-page/connectHitsPerPage.d.ts +6 -6
  63. package/es/connectors/infinite-hits/connectInfiniteHits.d.ts +8 -8
  64. package/es/connectors/infinite-hits/connectInfiniteHits.js +3 -2
  65. package/es/connectors/menu/connectMenu.d.ts +5 -5
  66. package/es/connectors/numeric-menu/connectNumericMenu.d.ts +6 -6
  67. package/es/connectors/pagination/connectPagination.d.ts +4 -4
  68. package/es/connectors/powered-by/connectPoweredBy.d.ts +4 -4
  69. package/es/connectors/query-rules/connectQueryRules.d.ts +7 -7
  70. package/es/connectors/range/connectRange.d.ts +8 -8
  71. package/es/connectors/rating-menu/connectRatingMenu.d.ts +6 -6
  72. package/es/connectors/refinement-list/connectRefinementList.d.ts +5 -5
  73. package/es/connectors/relevant-sort/connectRelevantSort.d.ts +5 -5
  74. package/es/connectors/search-box/connectSearchBox.d.ts +4 -4
  75. package/es/connectors/sort-by/connectSortBy.d.ts +5 -5
  76. package/es/connectors/stats/connectStats.d.ts +4 -4
  77. package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +9 -9
  78. package/es/connectors/toggle-refinement/types.d.ts +5 -5
  79. package/es/connectors/voice-search/connectVoiceSearch.d.ts +4 -4
  80. package/es/helpers/components/Highlight.d.ts +1 -1
  81. package/es/helpers/components/ReverseHighlight.d.ts +1 -1
  82. package/es/helpers/components/ReverseSnippet.d.ts +1 -1
  83. package/es/helpers/components/Snippet.d.ts +1 -1
  84. package/es/helpers/highlight.d.ts +1 -1
  85. package/es/helpers/reverseHighlight.d.ts +1 -1
  86. package/es/helpers/reverseSnippet.d.ts +1 -1
  87. package/es/helpers/snippet.d.ts +1 -1
  88. package/es/index.d.ts +1 -1
  89. package/es/lib/InstantSearch.d.ts +3 -3
  90. package/es/lib/InstantSearch.js +3 -7
  91. package/es/lib/createHelpers.d.ts +1 -1
  92. package/es/lib/insights/listener.d.ts +1 -1
  93. package/es/lib/routers/history.d.ts +3 -3
  94. package/es/lib/suit.d.ts +2 -2
  95. package/es/lib/templating/prepareTemplateProps.d.ts +2 -2
  96. package/es/lib/templating/prepareTemplateProps.js +1 -2
  97. package/es/lib/templating/renderTemplate.js +3 -0
  98. package/es/lib/utils/checkIndexUiState.d.ts +1 -1
  99. package/es/lib/utils/createConcurrentSafePromise.d.ts +2 -2
  100. package/es/lib/utils/createSendEventForFacet.d.ts +4 -4
  101. package/es/lib/utils/createSendEventForHits.d.ts +8 -7
  102. package/es/lib/utils/createSendEventForHits.js +6 -5
  103. package/es/lib/utils/debounce.d.ts +2 -2
  104. package/es/lib/utils/defer.d.ts +2 -2
  105. package/es/lib/utils/documentation.d.ts +2 -2
  106. package/es/lib/utils/escapeFacetValue.d.ts +1 -1
  107. package/es/lib/utils/geo-search.d.ts +1 -1
  108. package/es/lib/utils/getRefinements.d.ts +6 -6
  109. package/es/lib/utils/logger.d.ts +2 -2
  110. package/es/lib/utils/range.d.ts +1 -1
  111. package/es/lib/utils/safelyRunOnBrowser.d.ts +2 -2
  112. package/es/lib/utils/toArray.d.ts +1 -1
  113. package/es/lib/version.d.ts +1 -1
  114. package/es/lib/version.js +1 -1
  115. package/es/lib/voiceSearchHelper/types.d.ts +5 -5
  116. package/es/middlewares/createInsightsMiddleware.d.ts +3 -3
  117. package/es/middlewares/createRouterMiddleware.d.ts +1 -1
  118. package/es/types/component.d.ts +1 -1
  119. package/es/types/connector.d.ts +4 -4
  120. package/es/types/insights.d.ts +5 -5
  121. package/es/types/middleware.d.ts +4 -4
  122. package/es/types/render-state.d.ts +5 -5
  123. package/es/types/results.d.ts +16 -16
  124. package/es/types/router.d.ts +2 -2
  125. package/es/types/templates.d.ts +14 -6
  126. package/es/types/ui-state.d.ts +4 -4
  127. package/es/types/utils.d.ts +6 -6
  128. package/es/types/widget-factory.d.ts +2 -2
  129. package/es/types/widget.d.ts +23 -23
  130. package/es/widgets/analytics/analytics.d.ts +4 -4
  131. package/es/widgets/answers/answers.d.ts +4 -4
  132. package/es/widgets/breadcrumb/breadcrumb.d.ts +4 -4
  133. package/es/widgets/clear-refinements/clear-refinements.d.ts +4 -4
  134. package/es/widgets/configure/configure.d.ts +2 -2
  135. package/es/widgets/configure-related-items/configure-related-items.d.ts +2 -2
  136. package/es/widgets/current-refinements/current-refinements.d.ts +3 -3
  137. package/es/widgets/dynamic-widgets/dynamic-widgets.d.ts +2 -2
  138. package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -1
  139. package/es/widgets/geo-search/geo-search.d.ts +7 -7
  140. package/es/widgets/hierarchical-menu/hierarchical-menu.d.ts +6 -6
  141. package/es/widgets/hits/hits.d.ts +4 -4
  142. package/es/widgets/hits/hits.js +3 -4
  143. package/es/widgets/hits-per-page/hits-per-page.d.ts +3 -3
  144. package/es/widgets/index/index.d.ts +5 -5
  145. package/es/widgets/index/index.js +18 -1
  146. package/es/widgets/infinite-hits/infinite-hits.d.ts +4 -4
  147. package/es/widgets/infinite-hits/infinite-hits.js +3 -4
  148. package/es/widgets/menu/menu.d.ts +6 -6
  149. package/es/widgets/menu-select/menu-select.d.ts +4 -4
  150. package/es/widgets/numeric-menu/numeric-menu.d.ts +6 -6
  151. package/es/widgets/pagination/pagination.d.ts +4 -4
  152. package/es/widgets/panel/panel.d.ts +9 -9
  153. package/es/widgets/places/places.d.ts +6 -6
  154. package/es/widgets/powered-by/powered-by.d.ts +3 -3
  155. package/es/widgets/query-rule-context/query-rule-context.d.ts +2 -2
  156. package/es/widgets/query-rule-custom-data/query-rule-custom-data.d.ts +4 -4
  157. package/es/widgets/range-input/range-input.d.ts +4 -4
  158. package/es/widgets/range-slider/range-slider.d.ts +4 -4
  159. package/es/widgets/rating-menu/rating-menu.d.ts +6 -6
  160. package/es/widgets/refinement-list/refinement-list.d.ts +10 -10
  161. package/es/widgets/relevant-sort/relevant-sort.d.ts +4 -4
  162. package/es/widgets/search-box/search-box.d.ts +4 -4
  163. package/es/widgets/sort-by/sort-by.d.ts +4 -4
  164. package/es/widgets/stats/stats.d.ts +5 -5
  165. package/es/widgets/toggle-refinement/toggle-refinement.d.ts +4 -4
  166. package/es/widgets/voice-search/voice-search.d.ts +5 -5
  167. package/package.json +7 -5
@@ -3,21 +3,21 @@ import type { Connector, WidgetRenderState } from '../../types';
3
3
  /**
4
4
  * Refine the given search parameters.
5
5
  */
6
- declare type Refine = (searchParameters: PlainSearchParameters) => void;
7
- export declare type ConfigureConnectorParams = {
6
+ type Refine = (searchParameters: PlainSearchParameters) => void;
7
+ export type ConfigureConnectorParams = {
8
8
  /**
9
9
  * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)
10
10
  * to enable when the widget mounts.
11
11
  */
12
12
  searchParameters: PlainSearchParameters;
13
13
  };
14
- export declare type ConfigureRenderState = {
14
+ export type ConfigureRenderState = {
15
15
  /**
16
16
  * Refine the given search parameters.
17
17
  */
18
18
  refine: Refine;
19
19
  };
20
- export declare type ConfigureWidgetDescription = {
20
+ export type ConfigureWidgetDescription = {
21
21
  $$type: 'ais.configure';
22
22
  renderState: ConfigureRenderState;
23
23
  indexRenderState: {
@@ -27,6 +27,6 @@ export declare type ConfigureWidgetDescription = {
27
27
  configure: PlainSearchParameters;
28
28
  };
29
29
  };
30
- export declare type ConfigureConnector = Connector<ConfigureWidgetDescription, ConfigureConnectorParams>;
30
+ export type ConfigureConnector = Connector<ConfigureWidgetDescription, ConfigureConnectorParams>;
31
31
  declare const connectConfigure: ConfigureConnector;
32
32
  export default connectConfigure;
@@ -1,7 +1,7 @@
1
1
  import type { SearchParameters, PlainSearchParameters } from 'algoliasearch-helper';
2
2
  import type { AlgoliaHit, Connector } from '../../types';
3
3
  import type { ConfigureWidgetDescription } from '../configure/connectConfigure';
4
- export declare type MatchingPatterns = {
4
+ export type MatchingPatterns = {
5
5
  [attribute: string]: {
6
6
  /**
7
7
  * The score of the optional filter.
@@ -11,8 +11,8 @@ export declare type MatchingPatterns = {
11
11
  score: number;
12
12
  };
13
13
  };
14
- export declare type TransformSearchParameters = (searchParameters: SearchParameters) => PlainSearchParameters;
15
- export declare type ConfigureRelatedItemsConnectorParams = {
14
+ export type TransformSearchParameters = (searchParameters: SearchParameters) => PlainSearchParameters;
15
+ export type ConfigureRelatedItemsConnectorParams = {
16
16
  /**
17
17
  * The reference hit to extract the filters from.
18
18
  */
@@ -27,9 +27,9 @@ export declare type ConfigureRelatedItemsConnectorParams = {
27
27
  */
28
28
  transformSearchParameters?: TransformSearchParameters;
29
29
  };
30
- export declare type ConfigureRelatedItemsWidgetDescription = {
30
+ export type ConfigureRelatedItemsWidgetDescription = {
31
31
  $$type: 'ais.configureRelatedItems';
32
32
  } & Omit<ConfigureWidgetDescription, '$$type'>;
33
- export declare type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;
33
+ export type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;
34
34
  declare const connectConfigureRelatedItems: ConfigureRelatedItemsConnector;
35
35
  export default connectConfigureRelatedItems;
@@ -1,5 +1,5 @@
1
1
  import type { Connector, TransformItems, CreateURL, WidgetRenderState } from '../../types';
2
- export declare type CurrentRefinementsConnectorParamsRefinement = {
2
+ export type CurrentRefinementsConnectorParamsRefinement = {
3
3
  /**
4
4
  * The attribute on which the refinement is applied.
5
5
  */
@@ -29,7 +29,7 @@ export declare type CurrentRefinementsConnectorParamsRefinement = {
29
29
  */
30
30
  exhaustive?: boolean;
31
31
  };
32
- export declare type CurrentRefinementsConnectorParamsItem = {
32
+ export type CurrentRefinementsConnectorParamsItem = {
33
33
  /**
34
34
  * The index name.
35
35
  */
@@ -51,7 +51,7 @@ export declare type CurrentRefinementsConnectorParamsItem = {
51
51
  */
52
52
  refine(refinement: CurrentRefinementsConnectorParamsRefinement): void;
53
53
  };
54
- export declare type CurrentRefinementsConnectorParams = {
54
+ export type CurrentRefinementsConnectorParams = {
55
55
  /**
56
56
  * The attributes to include in the widget (all by default).
57
57
  * Cannot be used with `excludedAttributes`.
@@ -71,7 +71,7 @@ export declare type CurrentRefinementsConnectorParams = {
71
71
  */
72
72
  transformItems?: TransformItems<CurrentRefinementsConnectorParamsItem>;
73
73
  };
74
- export declare type CurrentRefinementsRenderState = {
74
+ export type CurrentRefinementsRenderState = {
75
75
  /**
76
76
  * All the currently refined items, grouped by attribute.
77
77
  */
@@ -89,13 +89,13 @@ export declare type CurrentRefinementsRenderState = {
89
89
  */
90
90
  createURL: CreateURL<CurrentRefinementsConnectorParamsRefinement>;
91
91
  };
92
- export declare type CurrentRefinementsWidgetDescription = {
92
+ export type CurrentRefinementsWidgetDescription = {
93
93
  $$type: 'ais.currentRefinements';
94
94
  renderState: CurrentRefinementsRenderState;
95
95
  indexRenderState: {
96
96
  currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;
97
97
  };
98
98
  };
99
- export declare type CurrentRefinementsConnector = Connector<CurrentRefinementsWidgetDescription, CurrentRefinementsConnectorParams>;
99
+ export type CurrentRefinementsConnector = Connector<CurrentRefinementsWidgetDescription, CurrentRefinementsConnectorParams>;
100
100
  declare const connectCurrentRefinements: CurrentRefinementsConnector;
101
101
  export default connectCurrentRefinements;
@@ -1,8 +1,8 @@
1
1
  import type { Connector, TransformItems, TransformItemsMetadata, Widget } from '../../types';
2
- export declare type DynamicWidgetsRenderState = {
2
+ export type DynamicWidgetsRenderState = {
3
3
  attributesToRender: string[];
4
4
  };
5
- export declare type DynamicWidgetsConnectorParams = {
5
+ export type DynamicWidgetsConnectorParams = {
6
6
  /**
7
7
  * An array of widgets, displayed in the order defined by `facetOrdering`.
8
8
  */
@@ -37,13 +37,13 @@ export declare type DynamicWidgetsConnectorParams = {
37
37
  */
38
38
  maxValuesPerFacet?: number;
39
39
  };
40
- export declare type DynamicWidgetsWidgetDescription = {
40
+ export type DynamicWidgetsWidgetDescription = {
41
41
  $$type: 'ais.dynamicWidgets';
42
42
  renderState: DynamicWidgetsRenderState;
43
43
  indexRenderState: {
44
44
  dynamicWidgets: DynamicWidgetsRenderState;
45
45
  };
46
46
  };
47
- export declare type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;
47
+ export type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;
48
48
  declare const connectDynamicWidgets: DynamicWidgetsConnector;
49
49
  export default connectDynamicWidgets;
@@ -1,7 +1,7 @@
1
1
  import type { SendEventForHits } from '../../lib/utils';
2
2
  import type { BaseHit, Connector, GeoLoc, Hit, TransformItems, WidgetRenderState } from '../../types';
3
- export declare type GeoHit<THit extends BaseHit = Record<string, any>> = Hit<THit> & Required<Pick<Hit, '_geoloc'>>;
4
- declare type Bounds = {
3
+ export type GeoHit<THit extends BaseHit = Record<string, any>> = Hit<THit> & Required<Pick<Hit, '_geoloc'>>;
4
+ type Bounds = {
5
5
  /**
6
6
  * The top right corner of the map view.
7
7
  */
@@ -11,7 +11,7 @@ declare type Bounds = {
11
11
  */
12
12
  southWest: GeoLoc;
13
13
  };
14
- export declare type GeoSearchRenderState<THit extends BaseHit = Record<string, any>> = {
14
+ export type GeoSearchRenderState<THit extends BaseHit = Record<string, any>> = {
15
15
  /**
16
16
  * Reset the current bounding box refinement.
17
17
  */
@@ -59,7 +59,7 @@ export declare type GeoSearchRenderState<THit extends BaseHit = Record<string, a
59
59
  */
60
60
  toggleRefineOnMapMove(): void;
61
61
  };
62
- export declare type GeoSearchConnectorParams<THit extends BaseHit = Record<string, any>> = {
62
+ export type GeoSearchConnectorParams<THit extends BaseHit = Record<string, any>> = {
63
63
  /**
64
64
  * If true, refine will be triggered as you move the map.
65
65
  * @default true
@@ -71,7 +71,7 @@ export declare type GeoSearchConnectorParams<THit extends BaseHit = Record<strin
71
71
  */
72
72
  transformItems?: TransformItems<GeoHit<THit>>;
73
73
  };
74
- export declare type GeoSearchWidgetDescription<THit extends BaseHit = Record<string, any>> = {
74
+ export type GeoSearchWidgetDescription<THit extends BaseHit = Record<string, any>> = {
75
75
  $$type: 'ais.geoSearch';
76
76
  renderState: GeoSearchRenderState<THit>;
77
77
  indexRenderState: {
@@ -90,7 +90,7 @@ export declare type GeoSearchWidgetDescription<THit extends BaseHit = Record<str
90
90
  };
91
91
  };
92
92
  };
93
- export declare type GeoSearchConnector<THit extends BaseHit = Record<string, any>> = Connector<GeoSearchWidgetDescription<THit>, GeoSearchConnectorParams<THit>>;
93
+ export type GeoSearchConnector<THit extends BaseHit = Record<string, any>> = Connector<GeoSearchWidgetDescription<THit>, GeoSearchConnectorParams<THit>>;
94
94
  /**
95
95
  * The **GeoSearch** connector provides the logic to build a widget that will display the results on a map. It also provides a way to search for results based on their position. The connector provides functions to manage the search experience (search on map interaction or control the interaction for example).
96
96
  *
@@ -1,7 +1,7 @@
1
1
  import type { SendEventForFacet } from '../../lib/utils';
2
2
  import type { SearchResults } from 'algoliasearch-helper';
3
3
  import type { Connector, CreateURL, TransformItems, SortBy, WidgetRenderState } from '../../types';
4
- export declare type HierarchicalMenuItem = {
4
+ export type HierarchicalMenuItem = {
5
5
  /**
6
6
  * Value of the menu item.
7
7
  */
@@ -23,7 +23,7 @@ export declare type HierarchicalMenuItem = {
23
23
  */
24
24
  data: HierarchicalMenuItem[] | null;
25
25
  };
26
- export declare type HierarchicalMenuConnectorParams = {
26
+ export type HierarchicalMenuConnectorParams = {
27
27
  /**
28
28
  * Attributes to use to generate the hierarchy of the menu.
29
29
  */
@@ -65,7 +65,7 @@ export declare type HierarchicalMenuConnectorParams = {
65
65
  */
66
66
  transformItems?: TransformItems<HierarchicalMenuItem>;
67
67
  };
68
- export declare type HierarchicalMenuRenderState = {
68
+ export type HierarchicalMenuRenderState = {
69
69
  /**
70
70
  * Creates an url for the next state for a clicked item.
71
71
  */
@@ -100,7 +100,7 @@ export declare type HierarchicalMenuRenderState = {
100
100
  */
101
101
  sendEvent: SendEventForFacet;
102
102
  };
103
- export declare type HierarchicalMenuWidgetDescription = {
103
+ export type HierarchicalMenuWidgetDescription = {
104
104
  $$type: 'ais.hierarchicalMenu';
105
105
  renderState: HierarchicalMenuRenderState;
106
106
  indexRenderState: {
@@ -114,7 +114,7 @@ export declare type HierarchicalMenuWidgetDescription = {
114
114
  };
115
115
  };
116
116
  };
117
- export declare type HierarchicalMenuConnector = Connector<HierarchicalMenuWidgetDescription, HierarchicalMenuConnectorParams>;
117
+ export type HierarchicalMenuConnector = Connector<HierarchicalMenuWidgetDescription, HierarchicalMenuConnectorParams>;
118
118
  /**
119
119
  * **HierarchicalMenu** connector provides the logic to build a custom widget
120
120
  * that will give the user the ability to explore facets in a tree-like structure.
@@ -1,7 +1,7 @@
1
1
  import type { SendEventForHits, BindEventForHits } from '../../lib/utils';
2
2
  import type { TransformItems, Connector, Hit, WidgetRenderState, BaseHit } from '../../types';
3
3
  import type { SearchResults } from 'algoliasearch-helper';
4
- export declare type HitsRenderState<THit extends BaseHit = BaseHit> = {
4
+ export type HitsRenderState<THit extends BaseHit = BaseHit> = {
5
5
  /**
6
6
  * The matched hits from Algolia API.
7
7
  */
@@ -19,7 +19,7 @@ export declare type HitsRenderState<THit extends BaseHit = BaseHit> = {
19
19
  */
20
20
  bindEvent: BindEventForHits;
21
21
  };
22
- export declare type HitsConnectorParams<THit extends BaseHit = BaseHit> = {
22
+ export type HitsConnectorParams<THit extends BaseHit = BaseHit> = {
23
23
  /**
24
24
  * Whether to escape HTML tags from hits string values.
25
25
  *
@@ -31,13 +31,13 @@ export declare type HitsConnectorParams<THit extends BaseHit = BaseHit> = {
31
31
  */
32
32
  transformItems?: TransformItems<Hit<THit>>;
33
33
  };
34
- export declare type HitsWidgetDescription<THit extends BaseHit = BaseHit> = {
34
+ export type HitsWidgetDescription<THit extends BaseHit = BaseHit> = {
35
35
  $$type: 'ais.hits';
36
36
  renderState: HitsRenderState<THit>;
37
37
  indexRenderState: {
38
38
  hits: WidgetRenderState<HitsRenderState<THit>, HitsConnectorParams<THit>>;
39
39
  };
40
40
  };
41
- export declare type HitsConnector<THit extends BaseHit = BaseHit> = Connector<HitsWidgetDescription<THit>, HitsConnectorParams<THit>>;
41
+ export type HitsConnector<THit extends BaseHit = BaseHit> = Connector<HitsWidgetDescription<THit>, HitsConnectorParams<THit>>;
42
42
  declare const connectHits: HitsConnector;
43
43
  export default connectHits;
@@ -55,7 +55,8 @@ var connectHits = function connectHits(renderFn) {
55
55
  if (!bindEvent) {
56
56
  bindEvent = createBindEventForHits({
57
57
  index: helper.getIndex(),
58
- widgetType: this.$$type
58
+ widgetType: this.$$type,
59
+ instantSearchInstance: instantSearchInstance
59
60
  });
60
61
  }
61
62
  if (!results) {
@@ -1,5 +1,5 @@
1
1
  import type { Connector, TransformItems, WidgetRenderState } from '../../types';
2
- export declare type HitsPerPageRenderStateItem = {
2
+ export type HitsPerPageRenderStateItem = {
3
3
  /**
4
4
  * Label to display in the option.
5
5
  */
@@ -13,7 +13,7 @@ export declare type HitsPerPageRenderStateItem = {
13
13
  */
14
14
  isRefined: boolean;
15
15
  };
16
- export declare type HitsPerPageConnectorParamsItem = {
16
+ export type HitsPerPageConnectorParamsItem = {
17
17
  /**
18
18
  * Label to display in the option.
19
19
  */
@@ -29,7 +29,7 @@ export declare type HitsPerPageConnectorParamsItem = {
29
29
  */
30
30
  default?: boolean;
31
31
  };
32
- export declare type HitsPerPageConnectorParams = {
32
+ export type HitsPerPageConnectorParams = {
33
33
  /**
34
34
  * Array of objects defining the different values and labels.
35
35
  */
@@ -39,7 +39,7 @@ export declare type HitsPerPageConnectorParams = {
39
39
  */
40
40
  transformItems?: TransformItems<HitsPerPageRenderStateItem>;
41
41
  };
42
- export declare type HitsPerPageRenderState = {
42
+ export type HitsPerPageRenderState = {
43
43
  /**
44
44
  * Array of objects defining the different values and labels.
45
45
  */
@@ -58,7 +58,7 @@ export declare type HitsPerPageRenderState = {
58
58
  */
59
59
  canRefine: boolean;
60
60
  };
61
- export declare type HitsPerPageWidgetDescription = {
61
+ export type HitsPerPageWidgetDescription = {
62
62
  $$type: 'ais.hitsPerPage';
63
63
  renderState: HitsPerPageRenderState;
64
64
  indexRenderState: {
@@ -68,6 +68,6 @@ export declare type HitsPerPageWidgetDescription = {
68
68
  hitsPerPage: number;
69
69
  };
70
70
  };
71
- export declare type HitsPerPageConnector = Connector<HitsPerPageWidgetDescription, HitsPerPageConnectorParams>;
71
+ export type HitsPerPageConnector = Connector<HitsPerPageWidgetDescription, HitsPerPageConnectorParams>;
72
72
  declare const connectHitsPerPage: HitsPerPageConnector;
73
73
  export default connectHitsPerPage;
@@ -1,21 +1,21 @@
1
1
  import type { PlainSearchParameters, SearchResults } from 'algoliasearch-helper';
2
2
  import type { Connector, TransformItems, Hit, WidgetRenderState, BaseHit } from '../../types';
3
3
  import type { SendEventForHits, BindEventForHits } from '../../lib/utils';
4
- export declare type InfiniteHitsCachedHits<THit extends BaseHit> = {
4
+ export type InfiniteHitsCachedHits<THit extends BaseHit> = {
5
5
  [page: number]: Array<Hit<THit>>;
6
6
  };
7
- declare type Read<THit extends BaseHit> = ({ state, }: {
7
+ type Read<THit extends BaseHit> = ({ state, }: {
8
8
  state: PlainSearchParameters;
9
9
  }) => InfiniteHitsCachedHits<THit> | null;
10
- declare type Write<THit extends BaseHit> = ({ state, hits, }: {
10
+ type Write<THit extends BaseHit> = ({ state, hits, }: {
11
11
  state: PlainSearchParameters;
12
12
  hits: InfiniteHitsCachedHits<THit>;
13
13
  }) => void;
14
- export declare type InfiniteHitsCache<THit extends BaseHit = BaseHit> = {
14
+ export type InfiniteHitsCache<THit extends BaseHit = BaseHit> = {
15
15
  read: Read<THit>;
16
16
  write: Write<THit>;
17
17
  };
18
- export declare type InfiniteHitsConnectorParams<THit extends BaseHit = BaseHit> = {
18
+ export type InfiniteHitsConnectorParams<THit extends BaseHit = BaseHit> = {
19
19
  /**
20
20
  * Escapes HTML entities from hits string values.
21
21
  *
@@ -40,7 +40,7 @@ export declare type InfiniteHitsConnectorParams<THit extends BaseHit = BaseHit>
40
40
  */
41
41
  cache?: InfiniteHitsCache<THit>;
42
42
  };
43
- export declare type InfiniteHitsRenderState<THit extends BaseHit = BaseHit> = {
43
+ export type InfiniteHitsRenderState<THit extends BaseHit = BaseHit> = {
44
44
  /**
45
45
  * Loads the previous results.
46
46
  */
@@ -78,7 +78,7 @@ export declare type InfiniteHitsRenderState<THit extends BaseHit = BaseHit> = {
78
78
  */
79
79
  results?: SearchResults<Hit<THit>>;
80
80
  };
81
- export declare type InfiniteHitsWidgetDescription<THit extends BaseHit = BaseHit> = {
81
+ export type InfiniteHitsWidgetDescription<THit extends BaseHit = BaseHit> = {
82
82
  $$type: 'ais.infiniteHits';
83
83
  renderState: InfiniteHitsRenderState<THit>;
84
84
  indexRenderState: {
@@ -88,6 +88,6 @@ export declare type InfiniteHitsWidgetDescription<THit extends BaseHit = BaseHit
88
88
  page: number;
89
89
  };
90
90
  };
91
- export declare type InfiniteHitsConnector<THit extends BaseHit = BaseHit> = Connector<InfiniteHitsWidgetDescription<THit>, InfiniteHitsConnectorParams<THit>>;
91
+ export type InfiniteHitsConnector<THit extends BaseHit = BaseHit> = Connector<InfiniteHitsWidgetDescription<THit>, InfiniteHitsConnectorParams<THit>>;
92
92
  declare const connectInfiniteHits: InfiniteHitsConnector;
93
93
  export default connectInfiniteHits;
@@ -145,7 +145,8 @@ var connectInfiniteHits = function connectInfiniteHits(renderFn) {
145
145
  });
146
146
  bindEvent = createBindEventForHits({
147
147
  index: helper.getIndex(),
148
- widgetType: this.$$type
148
+ widgetType: this.$$type,
149
+ instantSearchInstance: instantSearchInstance
149
150
  });
150
151
  isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;
151
152
  } else {
@@ -159,7 +160,7 @@ var connectInfiniteHits = function connectInfiniteHits(renderFn) {
159
160
  var transformedHits = transformItems(hitsWithAbsolutePositionAndQueryID, {
160
161
  results: results
161
162
  });
162
- if (cachedHits[_page] === undefined && !results.__isArtificial) {
163
+ if (cachedHits[_page] === undefined && !results.__isArtificial && instantSearchInstance.status === 'idle') {
163
164
  cachedHits[_page] = transformedHits;
164
165
  cache.write({
165
166
  state: state,
@@ -1,7 +1,7 @@
1
1
  import type { SearchResults } from 'algoliasearch-helper';
2
2
  import type { SendEventForFacet } from '../../lib/utils';
3
3
  import type { Connector, CreateURL, SortBy, TransformItems, WidgetRenderState } from '../../types';
4
- export declare type MenuItem = {
4
+ export type MenuItem = {
5
5
  /**
6
6
  * The value of the menu item.
7
7
  */
@@ -19,7 +19,7 @@ export declare type MenuItem = {
19
19
  */
20
20
  isRefined: boolean;
21
21
  };
22
- export declare type MenuConnectorParams = {
22
+ export type MenuConnectorParams = {
23
23
  /**
24
24
  * Name of the attribute for faceting (eg. "free_shipping").
25
25
  */
@@ -49,7 +49,7 @@ export declare type MenuConnectorParams = {
49
49
  */
50
50
  transformItems?: TransformItems<MenuItem>;
51
51
  };
52
- export declare type MenuRenderState = {
52
+ export type MenuRenderState = {
53
53
  /**
54
54
  * The elements that can be refined for the current search results.
55
55
  */
@@ -84,7 +84,7 @@ export declare type MenuRenderState = {
84
84
  */
85
85
  sendEvent: SendEventForFacet;
86
86
  };
87
- export declare type MenuWidgetDescription = {
87
+ export type MenuWidgetDescription = {
88
88
  $$type: 'ais.menu';
89
89
  renderState: MenuRenderState;
90
90
  indexRenderState: {
@@ -98,7 +98,7 @@ export declare type MenuWidgetDescription = {
98
98
  };
99
99
  };
100
100
  };
101
- export declare type MenuConnector = Connector<MenuWidgetDescription, MenuConnectorParams>;
101
+ export type MenuConnector = Connector<MenuWidgetDescription, MenuConnectorParams>;
102
102
  /**
103
103
  * **Menu** connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. The typical usage of menu is for navigation in categories.
104
104
  *
@@ -1,6 +1,6 @@
1
1
  import type { SendEventForFacet } from '../../lib/utils';
2
2
  import type { Connector, CreateURL, TransformItems, WidgetRenderState } from '../../types';
3
- export declare type NumericMenuConnectorParamsItem = {
3
+ export type NumericMenuConnectorParamsItem = {
4
4
  /**
5
5
  * Name of the option
6
6
  */
@@ -14,7 +14,7 @@ export declare type NumericMenuConnectorParamsItem = {
14
14
  */
15
15
  end?: number;
16
16
  };
17
- export declare type NumericMenuRenderStateItem = {
17
+ export type NumericMenuRenderStateItem = {
18
18
  /**
19
19
  * Name of the option.
20
20
  */
@@ -31,7 +31,7 @@ export declare type NumericMenuRenderStateItem = {
31
31
  */
32
32
  isRefined: boolean;
33
33
  };
34
- export declare type NumericMenuConnectorParams = {
34
+ export type NumericMenuConnectorParams = {
35
35
  /**
36
36
  * Name of the attribute for filtering
37
37
  */
@@ -45,7 +45,7 @@ export declare type NumericMenuConnectorParams = {
45
45
  */
46
46
  transformItems?: TransformItems<NumericMenuRenderStateItem>;
47
47
  };
48
- export declare type NumericMenuRenderState = {
48
+ export type NumericMenuRenderState = {
49
49
  /**
50
50
  * The list of available choices
51
51
  */
@@ -75,7 +75,7 @@ export declare type NumericMenuRenderState = {
75
75
  */
76
76
  sendEvent: SendEventForFacet;
77
77
  };
78
- export declare type NumericMenuWidgetDescription = {
78
+ export type NumericMenuWidgetDescription = {
79
79
  $$type: 'ais.numericMenu';
80
80
  renderState: NumericMenuRenderState;
81
81
  indexRenderState: {
@@ -89,6 +89,6 @@ export declare type NumericMenuWidgetDescription = {
89
89
  };
90
90
  };
91
91
  };
92
- export declare type NumericMenuConnector = Connector<NumericMenuWidgetDescription, NumericMenuConnectorParams>;
92
+ export type NumericMenuConnector = Connector<NumericMenuWidgetDescription, NumericMenuConnectorParams>;
93
93
  declare const connectNumericMenu: NumericMenuConnector;
94
94
  export default connectNumericMenu;
@@ -1,5 +1,5 @@
1
1
  import type { Connector, CreateURL, WidgetRenderState } from '../../types';
2
- export declare type PaginationConnectorParams = {
2
+ export type PaginationConnectorParams = {
3
3
  /**
4
4
  * The total number of pages to browse.
5
5
  */
@@ -10,7 +10,7 @@ export declare type PaginationConnectorParams = {
10
10
  */
11
11
  padding?: number;
12
12
  };
13
- export declare type PaginationRenderState = {
13
+ export type PaginationRenderState = {
14
14
  /** Creates URLs for the next state, the number is the page to generate the URL for. */
15
15
  createURL: CreateURL<number>;
16
16
  /** Sets the current page and triggers a search. */
@@ -30,7 +30,7 @@ export declare type PaginationRenderState = {
30
30
  /** true if the current page is also the last page. */
31
31
  isLastPage: boolean;
32
32
  };
33
- export declare type PaginationWidgetDescription = {
33
+ export type PaginationWidgetDescription = {
34
34
  $$type: 'ais.pagination';
35
35
  renderState: PaginationRenderState;
36
36
  indexRenderState: {
@@ -40,7 +40,7 @@ export declare type PaginationWidgetDescription = {
40
40
  page: number;
41
41
  };
42
42
  };
43
- export declare type PaginationConnector = Connector<PaginationWidgetDescription, PaginationConnectorParams>;
43
+ export type PaginationConnector = Connector<PaginationWidgetDescription, PaginationConnectorParams>;
44
44
  /**
45
45
  * **Pagination** connector provides the logic to build a widget that will let the user
46
46
  * choose the current page of the results.
@@ -1,20 +1,20 @@
1
1
  import type { Connector, WidgetRenderState } from '../../types';
2
- export declare type PoweredByRenderState = {
2
+ export type PoweredByRenderState = {
3
3
  /** the url to redirect to on click */
4
4
  url: string;
5
5
  };
6
- export declare type PoweredByConnectorParams = {
6
+ export type PoweredByConnectorParams = {
7
7
  /** the url to redirect to on click */
8
8
  url?: string;
9
9
  };
10
- export declare type PoweredByWidgetDescription = {
10
+ export type PoweredByWidgetDescription = {
11
11
  $$type: 'ais.poweredBy';
12
12
  renderState: PoweredByRenderState;
13
13
  indexRenderState: {
14
14
  poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;
15
15
  };
16
16
  };
17
- export declare type PoweredByConnector = Connector<PoweredByWidgetDescription, PoweredByConnectorParams>;
17
+ export type PoweredByConnector = Connector<PoweredByWidgetDescription, PoweredByConnectorParams>;
18
18
  /**
19
19
  * **PoweredBy** connector provides the logic to build a custom widget that will displays
20
20
  * the logo to redirect to Algolia.
@@ -1,24 +1,24 @@
1
1
  import type { Connector, TransformItems, WidgetRenderState } from '../../types';
2
- declare type TrackedFilterRefinement = string | number | boolean;
3
- export declare type ParamTrackedFilters = {
2
+ type TrackedFilterRefinement = string | number | boolean;
3
+ export type ParamTrackedFilters = {
4
4
  [facetName: string]: (facetValues: TrackedFilterRefinement[]) => TrackedFilterRefinement[];
5
5
  };
6
- export declare type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];
7
- export declare type QueryRulesConnectorParams = {
6
+ export type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];
7
+ export type QueryRulesConnectorParams = {
8
8
  trackedFilters?: ParamTrackedFilters;
9
9
  transformRuleContexts?: ParamTransformRuleContexts;
10
10
  transformItems?: TransformItems<any>;
11
11
  };
12
- export declare type QueryRulesRenderState = {
12
+ export type QueryRulesRenderState = {
13
13
  items: any[];
14
14
  };
15
- export declare type QueryRulesWidgetDescription = {
15
+ export type QueryRulesWidgetDescription = {
16
16
  $$type: 'ais.queryRules';
17
17
  renderState: QueryRulesRenderState;
18
18
  indexRenderState: {
19
19
  queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;
20
20
  };
21
21
  };
22
- export declare type QueryRulesConnector = Connector<QueryRulesWidgetDescription, QueryRulesConnectorParams>;
22
+ export type QueryRulesConnector = Connector<QueryRulesWidgetDescription, QueryRulesConnectorParams>;
23
23
  declare const connectQueryRules: QueryRulesConnector;
24
24
  export default connectQueryRules;
@@ -1,13 +1,13 @@
1
1
  import type { SendEventForFacet } from '../../lib/utils';
2
2
  import type { Connector, WidgetRenderState } from '../../types';
3
- export declare type RangeMin = number | undefined;
4
- export declare type RangeMax = number | undefined;
5
- export declare type RangeBoundaries = [RangeMin, RangeMax];
6
- export declare type Range = {
3
+ export type RangeMin = number | undefined;
4
+ export type RangeMax = number | undefined;
5
+ export type RangeBoundaries = [RangeMin, RangeMax];
6
+ export type Range = {
7
7
  min: RangeMin;
8
8
  max: RangeMax;
9
9
  };
10
- export declare type RangeRenderState = {
10
+ export type RangeRenderState = {
11
11
  /**
12
12
  * Sets a range to filter the results on. Both values
13
13
  * are optional, and will default to the higher and lower bounds. You can use `undefined` to remove a
@@ -40,7 +40,7 @@ export declare type RangeRenderState = {
40
40
  to(toValue: number): string;
41
41
  };
42
42
  };
43
- export declare type RangeConnectorParams = {
43
+ export type RangeConnectorParams = {
44
44
  /**
45
45
  * Name of the attribute for faceting.
46
46
  */
@@ -58,7 +58,7 @@ export declare type RangeConnectorParams = {
58
58
  */
59
59
  precision?: number;
60
60
  };
61
- export declare type RangeWidgetDescription = {
61
+ export type RangeWidgetDescription = {
62
62
  $$type: 'ais.range';
63
63
  renderState: RangeRenderState;
64
64
  indexRenderState: {
@@ -72,7 +72,7 @@ export declare type RangeWidgetDescription = {
72
72
  };
73
73
  };
74
74
  };
75
- export declare type RangeConnector = Connector<RangeWidgetDescription, RangeConnectorParams>;
75
+ export type RangeConnector = Connector<RangeWidgetDescription, RangeConnectorParams>;
76
76
  /**
77
77
  * **Range** connector provides the logic to create custom widget that will let
78
78
  * the user refine results using a numeric range.