instantsearch.js 4.50.0 → 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 (153) hide show
  1. package/cjs/lib/templating/prepareTemplateProps.js +1 -2
  2. package/cjs/lib/version.js +1 -1
  3. package/cjs/widgets/hits/hits.js +3 -4
  4. package/cjs/widgets/infinite-hits/infinite-hits.js +3 -4
  5. package/dist/instantsearch.development.d.ts +1 -1
  6. package/dist/instantsearch.development.js +25 -18
  7. package/dist/instantsearch.development.js.map +1 -1
  8. package/dist/instantsearch.production.d.ts +1 -1
  9. package/dist/instantsearch.production.min.d.ts +1 -1
  10. package/dist/instantsearch.production.min.js +2 -2
  11. package/dist/instantsearch.production.min.js.map +1 -1
  12. package/es/components/Answers/Answers.d.ts +3 -3
  13. package/es/components/Breadcrumb/Breadcrumb.d.ts +3 -3
  14. package/es/components/ClearRefinements/ClearRefinements.d.ts +3 -3
  15. package/es/components/CurrentRefinements/CurrentRefinements.d.ts +2 -2
  16. package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
  17. package/es/components/GeoSearchControls/GeoSearchControls.d.ts +1 -1
  18. package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
  19. package/es/components/Highlight/Highlight.d.ts +2 -2
  20. package/es/components/Hits/Hits.d.ts +3 -3
  21. package/es/components/InfiniteHits/InfiniteHits.d.ts +3 -3
  22. package/es/components/MenuSelect/MenuSelect.d.ts +4 -4
  23. package/es/components/Pagination/Pagination.d.ts +3 -3
  24. package/es/components/Panel/Panel.d.ts +3 -3
  25. package/es/components/PoweredBy/PoweredBy.d.ts +2 -2
  26. package/es/components/QueryRuleCustomData/QueryRuleCustomData.d.ts +3 -3
  27. package/es/components/RangeInput/RangeInput.d.ts +3 -3
  28. package/es/components/RefinementList/RefinementList.d.ts +7 -7
  29. package/es/components/RefinementList/RefinementListItem.d.ts +1 -1
  30. package/es/components/RelevantSort/RelevantSort.d.ts +3 -3
  31. package/es/components/ReverseHighlight/ReverseHighlight.d.ts +2 -2
  32. package/es/components/ReverseSnippet/ReverseSnippet.d.ts +2 -2
  33. package/es/components/SearchBox/SearchBox.d.ts +5 -5
  34. package/es/components/Selector/Selector.d.ts +3 -3
  35. package/es/components/Slider/Rheostat.d.ts +6 -6
  36. package/es/components/Slider/Slider.d.ts +2 -2
  37. package/es/components/Snippet/Snippet.d.ts +2 -2
  38. package/es/components/Stats/Stats.d.ts +3 -3
  39. package/es/components/Template/Template.d.ts +1 -1
  40. package/es/components/ToggleRefinement/ToggleRefinement.d.ts +3 -3
  41. package/es/components/VoiceSearch/VoiceSearch.d.ts +3 -3
  42. package/es/connectors/answers/connectAnswers.d.ts +4 -4
  43. package/es/connectors/autocomplete/connectAutocomplete.d.ts +4 -4
  44. package/es/connectors/breadcrumb/connectBreadcrumb.d.ts +5 -5
  45. package/es/connectors/clear-refinements/connectClearRefinements.d.ts +4 -4
  46. package/es/connectors/configure/connectConfigure.d.ts +5 -5
  47. package/es/connectors/configure-related-items/connectConfigureRelatedItems.d.ts +5 -5
  48. package/es/connectors/current-refinements/connectCurrentRefinements.d.ts +6 -6
  49. package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +4 -4
  50. package/es/connectors/geo-search/connectGeoSearch.d.ts +6 -6
  51. package/es/connectors/hierarchical-menu/connectHierarchicalMenu.d.ts +5 -5
  52. package/es/connectors/hits/connectHits.d.ts +4 -4
  53. package/es/connectors/hits-per-page/connectHitsPerPage.d.ts +6 -6
  54. package/es/connectors/infinite-hits/connectInfiniteHits.d.ts +8 -8
  55. package/es/connectors/menu/connectMenu.d.ts +5 -5
  56. package/es/connectors/numeric-menu/connectNumericMenu.d.ts +6 -6
  57. package/es/connectors/pagination/connectPagination.d.ts +4 -4
  58. package/es/connectors/powered-by/connectPoweredBy.d.ts +4 -4
  59. package/es/connectors/query-rules/connectQueryRules.d.ts +7 -7
  60. package/es/connectors/range/connectRange.d.ts +8 -8
  61. package/es/connectors/rating-menu/connectRatingMenu.d.ts +6 -6
  62. package/es/connectors/refinement-list/connectRefinementList.d.ts +5 -5
  63. package/es/connectors/relevant-sort/connectRelevantSort.d.ts +5 -5
  64. package/es/connectors/search-box/connectSearchBox.d.ts +4 -4
  65. package/es/connectors/sort-by/connectSortBy.d.ts +5 -5
  66. package/es/connectors/stats/connectStats.d.ts +4 -4
  67. package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +9 -9
  68. package/es/connectors/toggle-refinement/types.d.ts +5 -5
  69. package/es/connectors/voice-search/connectVoiceSearch.d.ts +4 -4
  70. package/es/helpers/components/Highlight.d.ts +1 -1
  71. package/es/helpers/components/ReverseHighlight.d.ts +1 -1
  72. package/es/helpers/components/ReverseSnippet.d.ts +1 -1
  73. package/es/helpers/components/Snippet.d.ts +1 -1
  74. package/es/helpers/highlight.d.ts +1 -1
  75. package/es/helpers/reverseHighlight.d.ts +1 -1
  76. package/es/helpers/reverseSnippet.d.ts +1 -1
  77. package/es/helpers/snippet.d.ts +1 -1
  78. package/es/index.d.ts +1 -1
  79. package/es/lib/InstantSearch.d.ts +3 -3
  80. package/es/lib/createHelpers.d.ts +1 -1
  81. package/es/lib/insights/listener.d.ts +1 -1
  82. package/es/lib/routers/history.d.ts +3 -3
  83. package/es/lib/suit.d.ts +2 -2
  84. package/es/lib/templating/prepareTemplateProps.d.ts +2 -2
  85. package/es/lib/templating/prepareTemplateProps.js +1 -2
  86. package/es/lib/utils/checkIndexUiState.d.ts +1 -1
  87. package/es/lib/utils/createConcurrentSafePromise.d.ts +2 -2
  88. package/es/lib/utils/createSendEventForFacet.d.ts +4 -4
  89. package/es/lib/utils/createSendEventForHits.d.ts +6 -6
  90. package/es/lib/utils/debounce.d.ts +2 -2
  91. package/es/lib/utils/defer.d.ts +2 -2
  92. package/es/lib/utils/documentation.d.ts +2 -2
  93. package/es/lib/utils/escapeFacetValue.d.ts +1 -1
  94. package/es/lib/utils/geo-search.d.ts +1 -1
  95. package/es/lib/utils/getRefinements.d.ts +6 -6
  96. package/es/lib/utils/logger.d.ts +2 -2
  97. package/es/lib/utils/range.d.ts +1 -1
  98. package/es/lib/utils/safelyRunOnBrowser.d.ts +2 -2
  99. package/es/lib/utils/toArray.d.ts +1 -1
  100. package/es/lib/version.d.ts +1 -1
  101. package/es/lib/version.js +1 -1
  102. package/es/lib/voiceSearchHelper/types.d.ts +5 -5
  103. package/es/middlewares/createInsightsMiddleware.d.ts +3 -3
  104. package/es/middlewares/createRouterMiddleware.d.ts +1 -1
  105. package/es/types/component.d.ts +1 -1
  106. package/es/types/connector.d.ts +4 -4
  107. package/es/types/insights.d.ts +5 -5
  108. package/es/types/middleware.d.ts +4 -4
  109. package/es/types/render-state.d.ts +5 -5
  110. package/es/types/results.d.ts +16 -16
  111. package/es/types/router.d.ts +2 -2
  112. package/es/types/templates.d.ts +5 -5
  113. package/es/types/ui-state.d.ts +4 -4
  114. package/es/types/utils.d.ts +6 -6
  115. package/es/types/widget-factory.d.ts +2 -2
  116. package/es/types/widget.d.ts +23 -23
  117. package/es/widgets/analytics/analytics.d.ts +4 -4
  118. package/es/widgets/answers/answers.d.ts +4 -4
  119. package/es/widgets/breadcrumb/breadcrumb.d.ts +4 -4
  120. package/es/widgets/clear-refinements/clear-refinements.d.ts +4 -4
  121. package/es/widgets/configure/configure.d.ts +2 -2
  122. package/es/widgets/configure-related-items/configure-related-items.d.ts +2 -2
  123. package/es/widgets/current-refinements/current-refinements.d.ts +3 -3
  124. package/es/widgets/dynamic-widgets/dynamic-widgets.d.ts +2 -2
  125. package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -1
  126. package/es/widgets/geo-search/geo-search.d.ts +7 -7
  127. package/es/widgets/hierarchical-menu/hierarchical-menu.d.ts +6 -6
  128. package/es/widgets/hits/hits.d.ts +4 -4
  129. package/es/widgets/hits/hits.js +3 -4
  130. package/es/widgets/hits-per-page/hits-per-page.d.ts +3 -3
  131. package/es/widgets/index/index.d.ts +5 -5
  132. package/es/widgets/infinite-hits/infinite-hits.d.ts +4 -4
  133. package/es/widgets/infinite-hits/infinite-hits.js +3 -4
  134. package/es/widgets/menu/menu.d.ts +6 -6
  135. package/es/widgets/menu-select/menu-select.d.ts +4 -4
  136. package/es/widgets/numeric-menu/numeric-menu.d.ts +6 -6
  137. package/es/widgets/pagination/pagination.d.ts +4 -4
  138. package/es/widgets/panel/panel.d.ts +9 -9
  139. package/es/widgets/places/places.d.ts +6 -6
  140. package/es/widgets/powered-by/powered-by.d.ts +3 -3
  141. package/es/widgets/query-rule-context/query-rule-context.d.ts +2 -2
  142. package/es/widgets/query-rule-custom-data/query-rule-custom-data.d.ts +4 -4
  143. package/es/widgets/range-input/range-input.d.ts +4 -4
  144. package/es/widgets/range-slider/range-slider.d.ts +4 -4
  145. package/es/widgets/rating-menu/rating-menu.d.ts +6 -6
  146. package/es/widgets/refinement-list/refinement-list.d.ts +10 -10
  147. package/es/widgets/relevant-sort/relevant-sort.d.ts +4 -4
  148. package/es/widgets/search-box/search-box.d.ts +4 -4
  149. package/es/widgets/sort-by/sort-by.d.ts +4 -4
  150. package/es/widgets/stats/stats.d.ts +5 -5
  151. package/es/widgets/toggle-refinement/toggle-refinement.d.ts +4 -4
  152. package/es/widgets/voice-search/voice-search.d.ts +5 -5
  153. package/package.json +6 -5
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { ClearRefinementsConnectorParams, ClearRefinementsWidgetDescription } from '../../connectors/clear-refinements/connectClearRefinements';
3
3
  import type { WidgetFactory, Template } from '../../types';
4
- export declare type ClearRefinementsCSSClasses = Partial<{
4
+ export type ClearRefinementsCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS class to add to the wrapper element.
7
7
  */
@@ -15,7 +15,7 @@ export declare type ClearRefinementsCSSClasses = Partial<{
15
15
  */
16
16
  disabledButton: string | string[];
17
17
  }>;
18
- export declare type ClearRefinementsTemplates = Partial<{
18
+ export type ClearRefinementsTemplates = Partial<{
19
19
  /**
20
20
  * Template for the content of the button
21
21
  */
@@ -23,7 +23,7 @@ export declare type ClearRefinementsTemplates = Partial<{
23
23
  hasRefinements: boolean;
24
24
  }>;
25
25
  }>;
26
- export declare type ClearRefinementsWidgetParams = {
26
+ export type ClearRefinementsWidgetParams = {
27
27
  /**
28
28
  * CSS Selector or HTMLElement to insert the widget.
29
29
  */
@@ -37,7 +37,7 @@ export declare type ClearRefinementsWidgetParams = {
37
37
  */
38
38
  cssClasses?: ClearRefinementsCSSClasses;
39
39
  };
40
- export declare type ClearRefinementsWidget = WidgetFactory<ClearRefinementsWidgetDescription & {
40
+ export type ClearRefinementsWidget = WidgetFactory<ClearRefinementsWidgetDescription & {
41
41
  $$widgetType: 'ais.clearRefinements';
42
42
  }, ClearRefinementsConnectorParams, ClearRefinementsWidgetParams>;
43
43
  declare const clearRefinements: ClearRefinementsWidget;
@@ -4,8 +4,8 @@ import type { Widget } from '../../types';
4
4
  * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)
5
5
  * to enable when the widget mounts.
6
6
  */
7
- export declare type ConfigureWidgetParams = ConfigureConnectorParams['searchParameters'];
8
- export declare type ConfigureWidget = (widgetParams: ConfigureWidgetParams) => Widget<ConfigureWidgetDescription & {
7
+ export type ConfigureWidgetParams = ConfigureConnectorParams['searchParameters'];
8
+ export type ConfigureWidget = (widgetParams: ConfigureWidgetParams) => Widget<ConfigureWidgetDescription & {
9
9
  $$widgetType: 'ais.configure';
10
10
  widgetParams: ConfigureConnectorParams;
11
11
  }>;
@@ -1,9 +1,9 @@
1
1
  import type { PlainSearchParameters } from 'algoliasearch-helper';
2
2
  import type { ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetDescription } from '../../connectors/configure-related-items/connectConfigureRelatedItems';
3
3
  import type { WidgetFactory } from '../../types';
4
- export declare type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {
4
+ export type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {
5
5
  $$widgetType: 'ais.configureRelatedItems';
6
6
  }, ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetParams>;
7
- export declare type ConfigureRelatedItemsWidgetParams = PlainSearchParameters;
7
+ export type ConfigureRelatedItemsWidgetParams = PlainSearchParameters;
8
8
  declare const configureRelatedItems: ConfigureRelatedItemsWidget;
9
9
  export default configureRelatedItems;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { CurrentRefinementsConnectorParams, CurrentRefinementsWidgetDescription } from '../../connectors/current-refinements/connectCurrentRefinements';
3
3
  import type { WidgetFactory } from '../../types';
4
- export declare type CurrentRefinementsCSSClasses = Partial<{
4
+ export type CurrentRefinementsCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS class to add to the root element.
7
7
  */
@@ -35,7 +35,7 @@ export declare type CurrentRefinementsCSSClasses = Partial<{
35
35
  */
36
36
  delete: string | string[];
37
37
  }>;
38
- export declare type CurrentRefinementsWidgetParams = {
38
+ export type CurrentRefinementsWidgetParams = {
39
39
  /**
40
40
  * The CSS Selector or `HTMLElement` to insert the widget into.
41
41
  */
@@ -45,7 +45,7 @@ export declare type CurrentRefinementsWidgetParams = {
45
45
  */
46
46
  cssClasses?: CurrentRefinementsCSSClasses;
47
47
  };
48
- export declare type CurrentRefinementsWidget = WidgetFactory<CurrentRefinementsWidgetDescription & {
48
+ export type CurrentRefinementsWidget = WidgetFactory<CurrentRefinementsWidgetDescription & {
49
49
  $$widgetType: 'ais.currentRefinements';
50
50
  }, CurrentRefinementsConnectorParams, CurrentRefinementsWidgetParams>;
51
51
  declare const currentRefinements: CurrentRefinementsWidget;
@@ -1,6 +1,6 @@
1
1
  import type { DynamicWidgetsConnectorParams, DynamicWidgetsWidgetDescription } from '../../connectors/dynamic-widgets/connectDynamicWidgets';
2
2
  import type { Widget, WidgetFactory } from '../../types';
3
- export declare type DynamicWidgetsWidgetParams = {
3
+ export type DynamicWidgetsWidgetParams = {
4
4
  /**
5
5
  * CSS Selector or HTMLElement to insert the widget.
6
6
  */
@@ -21,7 +21,7 @@ export declare type DynamicWidgetsWidgetParams = {
21
21
  container: HTMLElement;
22
22
  }): Widget;
23
23
  };
24
- export declare type DynamicWidgetsWidget = WidgetFactory<DynamicWidgetsWidgetDescription & {
24
+ export type DynamicWidgetsWidget = WidgetFactory<DynamicWidgetsWidgetDescription & {
25
25
  $$widgetType: 'ais.dynamicWidgets';
26
26
  }, Omit<DynamicWidgetsConnectorParams, 'widgets' | 'fallbackWidget'>, DynamicWidgetsWidgetParams>;
27
27
  declare const dynamicWidgets: DynamicWidgetsWidget;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="google.maps" />
2
2
  /// <reference types="googlemaps" />
3
3
  import type { renderTemplate } from '../../lib/templating';
4
- export declare type HTMLMarkerArguments = {
4
+ export type HTMLMarkerArguments = {
5
5
  __id: string;
6
6
  position: google.maps.LatLngLiteral;
7
7
  map: google.maps.Map;
@@ -3,11 +3,11 @@
3
3
  import type { GeoSearchConnectorParams, GeoSearchWidgetDescription, GeoHit } from '../../connectors/geo-search/connectGeoSearch';
4
4
  import type { HTMLMarkerArguments } from './createHTMLMarker';
5
5
  import type { GeoLoc, Template, WidgetFactory } from '../../types';
6
- export declare type CreateMarker = (args: {
6
+ export type CreateMarker = (args: {
7
7
  item: GeoHit;
8
8
  map: google.maps.Map;
9
9
  }) => google.maps.OverlayView | google.maps.Marker;
10
- export declare type GeoSearchTemplates = Partial<{
10
+ export type GeoSearchTemplates = Partial<{
11
11
  /** Template to use for the marker. */
12
12
  HTMLMarker: Template<GeoHit>;
13
13
  /** Template for the reset button. */
@@ -17,8 +17,8 @@ export declare type GeoSearchTemplates = Partial<{
17
17
  /** Template for the redo button. */
18
18
  redo: Template;
19
19
  }>;
20
- export declare type GeoSearchComponentTemplates = Required<GeoSearchTemplates>;
21
- export declare type GeoSearchCSSClasses = Partial<{
20
+ export type GeoSearchComponentTemplates = Required<GeoSearchTemplates>;
21
+ export type GeoSearchCSSClasses = Partial<{
22
22
  /** The root div of the widget. */
23
23
  root: string | string[];
24
24
  /** The map container of the widget. */
@@ -38,7 +38,7 @@ export declare type GeoSearchCSSClasses = Partial<{
38
38
  /** The reset refinement button. */
39
39
  reset: string | string[];
40
40
  }>;
41
- export declare type GeoSearchMarker<TOptions> = {
41
+ export type GeoSearchMarker<TOptions> = {
42
42
  /**
43
43
  * Function used to create the options passed to the Google Maps marker.
44
44
  * See the documentation for more information:
@@ -59,7 +59,7 @@ export declare type GeoSearchMarker<TOptions> = {
59
59
  }) => void;
60
60
  };
61
61
  };
62
- export declare type GeoSearchWidgetParams = {
62
+ export type GeoSearchWidgetParams = {
63
63
  /**
64
64
  * By default the map will set the zoom accordingly to the markers displayed on it.
65
65
  * When we refine it may happen that the results are empty. For those situations we
@@ -122,7 +122,7 @@ export declare type GeoSearchWidgetParams = {
122
122
  */
123
123
  googleReference: typeof window['google'];
124
124
  };
125
- export declare type GeoSearchWidget = WidgetFactory<GeoSearchWidgetDescription & {
125
+ export type GeoSearchWidget = WidgetFactory<GeoSearchWidgetDescription & {
126
126
  $$widgetType: 'ais.geoSearch';
127
127
  }, GeoSearchConnectorParams, GeoSearchWidgetParams>;
128
128
  /**
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { HierarchicalMenuItem, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetDescription } from '../../connectors/hierarchical-menu/connectHierarchicalMenu';
3
3
  import type { TransformItems, Template, WidgetFactory, SortBy, ComponentCSSClasses } from '../../types';
4
- declare type HierarchicalMenuTemplates = Partial<{
4
+ type HierarchicalMenuTemplates = Partial<{
5
5
  /**
6
6
  * Item template, provided with `name`, `count`, `isRefined`, `url` data properties.
7
7
  */
@@ -20,7 +20,7 @@ declare type HierarchicalMenuTemplates = Partial<{
20
20
  isShowingMore: boolean;
21
21
  }>;
22
22
  }>;
23
- export declare type HierarchicalMenuCSSClasses = Partial<{
23
+ export type HierarchicalMenuCSSClasses = Partial<{
24
24
  /**
25
25
  * CSS class to add to the root element.
26
26
  */
@@ -74,9 +74,9 @@ export declare type HierarchicalMenuCSSClasses = Partial<{
74
74
  */
75
75
  disabledShowMore: string | string[];
76
76
  }>;
77
- export declare type HierarchicalMenuComponentCSSClasses = ComponentCSSClasses<HierarchicalMenuCSSClasses>;
78
- export declare type HierarchicalMenuComponentTemplates = Required<HierarchicalMenuTemplates>;
79
- export declare type HierarchicalMenuWidgetParams = {
77
+ export type HierarchicalMenuComponentCSSClasses = ComponentCSSClasses<HierarchicalMenuCSSClasses>;
78
+ export type HierarchicalMenuComponentTemplates = Required<HierarchicalMenuTemplates>;
79
+ export type HierarchicalMenuWidgetParams = {
80
80
  /**
81
81
  * CSS Selector or HTMLElement to insert the widget.
82
82
  */
@@ -197,7 +197,7 @@ export declare type HierarchicalMenuWidgetParams = {
197
197
  * })
198
198
  * ]);
199
199
  */
200
- export declare type HierarchicalMenuWidget = WidgetFactory<HierarchicalMenuWidgetDescription & {
200
+ export type HierarchicalMenuWidget = WidgetFactory<HierarchicalMenuWidgetDescription & {
201
201
  $$widgetType: 'ais.hierarchicalMenu';
202
202
  }, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetParams>;
203
203
  declare const hierarchicalMenu: HierarchicalMenuWidget;
@@ -2,7 +2,7 @@
2
2
  import type { HitsConnectorParams, HitsWidgetDescription } from '../../connectors/hits/connectHits';
3
3
  import type { Template, TemplateWithBindEvent, Hit, WidgetFactory } from '../../types';
4
4
  import type { SearchResults } from 'algoliasearch-helper';
5
- export declare type HitsCSSClasses = Partial<{
5
+ export type HitsCSSClasses = Partial<{
6
6
  /**
7
7
  * CSS class to add to the wrapping element.
8
8
  */
@@ -20,7 +20,7 @@ export declare type HitsCSSClasses = Partial<{
20
20
  */
21
21
  item: string | string[];
22
22
  }>;
23
- export declare type HitsTemplates = Partial<{
23
+ export type HitsTemplates = Partial<{
24
24
  /**
25
25
  * Template to use when there are no results.
26
26
  *
@@ -36,7 +36,7 @@ export declare type HitsTemplates = Partial<{
36
36
  __hitIndex: number;
37
37
  }>;
38
38
  }>;
39
- export declare type HitsWidgetParams = {
39
+ export type HitsWidgetParams = {
40
40
  /**
41
41
  * CSS Selector or HTMLElement to insert the widget.
42
42
  */
@@ -50,7 +50,7 @@ export declare type HitsWidgetParams = {
50
50
  */
51
51
  cssClasses?: HitsCSSClasses;
52
52
  };
53
- export declare type HitsWidget = WidgetFactory<HitsWidgetDescription & {
53
+ export type HitsWidget = WidgetFactory<HitsWidgetDescription & {
54
54
  $$widgetType: 'ais.hits';
55
55
  }, HitsConnectorParams, HitsWidgetParams>;
56
56
  declare const hits: HitsWidget;
@@ -28,7 +28,8 @@ var renderer = function renderer(_ref) {
28
28
  results = _ref2.results,
29
29
  instantSearchInstance = _ref2.instantSearchInstance,
30
30
  insights = _ref2.insights,
31
- bindEvent = _ref2.bindEvent;
31
+ bindEvent = _ref2.bindEvent,
32
+ sendEvent = _ref2.sendEvent;
32
33
  if (isFirstRendering) {
33
34
  renderState.templateProps = prepareTemplateProps({
34
35
  defaultTemplates: defaultTemplates,
@@ -43,9 +44,7 @@ var renderer = function renderer(_ref) {
43
44
  results: results,
44
45
  templateProps: renderState.templateProps,
45
46
  insights: insights,
46
- sendEvent: function sendEvent(event) {
47
- instantSearchInstance.sendEventToInsights(event);
48
- },
47
+ sendEvent: sendEvent,
49
48
  bindEvent: bindEvent
50
49
  }), containerNode);
51
50
  };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { HitsPerPageConnectorParams, HitsPerPageWidgetDescription } from '../../connectors/hits-per-page/connectHitsPerPage';
3
3
  import type { WidgetFactory } from '../../types';
4
- export declare type HitsPerPageCSSClasses = Partial<{
4
+ export type HitsPerPageCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS classes added to the outer `<div>`.
7
7
  */
@@ -15,7 +15,7 @@ export declare type HitsPerPageCSSClasses = Partial<{
15
15
  */
16
16
  option: string | string[];
17
17
  }>;
18
- export declare type HitsPerPageWidgetParams = {
18
+ export type HitsPerPageWidgetParams = {
19
19
  /**
20
20
  * CSS Selector or HTMLElement to insert the widget.
21
21
  */
@@ -25,7 +25,7 @@ export declare type HitsPerPageWidgetParams = {
25
25
  */
26
26
  cssClasses?: HitsPerPageCSSClasses;
27
27
  };
28
- export declare type HitsPerPageWidget = WidgetFactory<HitsPerPageWidgetDescription & {
28
+ export type HitsPerPageWidget = WidgetFactory<HitsPerPageWidgetDescription & {
29
29
  $$widgetType: 'ais.hitsPerPage';
30
30
  }, HitsPerPageConnectorParams, HitsPerPageWidgetParams>;
31
31
  declare const hitsPerPage: HitsPerPageWidget;
@@ -1,22 +1,22 @@
1
1
  import type { AlgoliaSearchHelper as Helper, SearchParameters, SearchResults } from 'algoliasearch-helper';
2
2
  import type { InstantSearch, UiState, IndexUiState, Widget, ScopedResult } from '../../types';
3
- export declare type IndexWidgetParams = {
3
+ export type IndexWidgetParams = {
4
4
  indexName: string;
5
5
  indexId?: string;
6
6
  };
7
- export declare type IndexInitOptions = {
7
+ export type IndexInitOptions = {
8
8
  instantSearchInstance: InstantSearch;
9
9
  parent: IndexWidget | null;
10
10
  uiState: UiState;
11
11
  };
12
- export declare type IndexRenderOptions = {
12
+ export type IndexRenderOptions = {
13
13
  instantSearchInstance: InstantSearch;
14
14
  };
15
- export declare type IndexWidgetDescription = {
15
+ export type IndexWidgetDescription = {
16
16
  $$type: 'ais.index';
17
17
  $$widgetType: 'ais.index';
18
18
  };
19
- export declare type IndexWidget = Omit<Widget<IndexWidgetDescription & {
19
+ export type IndexWidget = Omit<Widget<IndexWidgetDescription & {
20
20
  widgetParams: IndexWidgetParams;
21
21
  }>, 'getWidgetUiState' | 'getWidgetState'> & {
22
22
  getIndexName(): string;
@@ -2,7 +2,7 @@
2
2
  import type { SearchResults } from 'algoliasearch-helper';
3
3
  import type { InfiniteHitsConnectorParams, InfiniteHitsCache, InfiniteHitsWidgetDescription } from '../../connectors/infinite-hits/connectInfiniteHits';
4
4
  import type { WidgetFactory, Template, TemplateWithBindEvent, Hit } from '../../types';
5
- export declare type InfiniteHitsCSSClasses = Partial<{
5
+ export type InfiniteHitsCSSClasses = Partial<{
6
6
  /**
7
7
  * The root element of the widget.
8
8
  */
@@ -36,7 +36,7 @@ export declare type InfiniteHitsCSSClasses = Partial<{
36
36
  */
37
37
  disabledLoadMore: string | string[];
38
38
  }>;
39
- export declare type InfiniteHitsTemplates = Partial<{
39
+ export type InfiniteHitsTemplates = Partial<{
40
40
  /**
41
41
  * The template to use when there are no results.
42
42
  */
@@ -56,7 +56,7 @@ export declare type InfiniteHitsTemplates = Partial<{
56
56
  __hitIndex: number;
57
57
  }>;
58
58
  }>;
59
- export declare type InfiniteHitsWidgetParams = {
59
+ export type InfiniteHitsWidgetParams = {
60
60
  /**
61
61
  * The CSS Selector or `HTMLElement` to insert the widget into.
62
62
  */
@@ -76,7 +76,7 @@ export declare type InfiniteHitsWidgetParams = {
76
76
  */
77
77
  cache?: InfiniteHitsCache;
78
78
  };
79
- export declare type InfiniteHitsWidget = WidgetFactory<InfiniteHitsWidgetDescription & {
79
+ export type InfiniteHitsWidget = WidgetFactory<InfiniteHitsWidgetDescription & {
80
80
  $$widgetType: 'ais.infiniteHits';
81
81
  }, InfiniteHitsConnectorParams, InfiniteHitsWidgetParams>;
82
82
  declare const infiniteHits: InfiniteHitsWidget;
@@ -33,7 +33,8 @@ var renderer = function renderer(_ref) {
33
33
  isLastPage = _ref2.isLastPage,
34
34
  instantSearchInstance = _ref2.instantSearchInstance,
35
35
  insights = _ref2.insights,
36
- bindEvent = _ref2.bindEvent;
36
+ bindEvent = _ref2.bindEvent,
37
+ sendEvent = _ref2.sendEvent;
37
38
  if (isFirstRendering) {
38
39
  renderState.templateProps = prepareTemplateProps({
39
40
  defaultTemplates: defaultTemplates,
@@ -53,9 +54,7 @@ var renderer = function renderer(_ref) {
53
54
  isFirstPage: isFirstPage,
54
55
  isLastPage: isLastPage,
55
56
  insights: insights,
56
- sendEvent: function sendEvent(event) {
57
- instantSearchInstance.sendEventToInsights(event);
58
- },
57
+ sendEvent: sendEvent,
59
58
  bindEvent: bindEvent
60
59
  }), containerNode);
61
60
  };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { MenuConnectorParams, MenuWidgetDescription } from '../../connectors/menu/connectMenu';
3
3
  import type { ComponentCSSClasses, Template, WidgetFactory } from '../../types';
4
- export declare type MenuCSSClasses = Partial<{
4
+ export type MenuCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS class to add to the root element.
7
7
  */
@@ -43,7 +43,7 @@ export declare type MenuCSSClasses = Partial<{
43
43
  */
44
44
  disabledShowMore: string | string[];
45
45
  }>;
46
- export declare type MenuTemplates = Partial<{
46
+ export type MenuTemplates = Partial<{
47
47
  /**
48
48
  * Item template. The string template gets the same values as the function.
49
49
  */
@@ -62,9 +62,9 @@ export declare type MenuTemplates = Partial<{
62
62
  isShowingMore: boolean;
63
63
  }>;
64
64
  }>;
65
- export declare type MenuComponentCSSClasses = ComponentCSSClasses<MenuCSSClasses>;
66
- export declare type MenuComponentTemplates = Required<MenuTemplates>;
67
- export declare type MenuWidgetParams = {
65
+ export type MenuComponentCSSClasses = ComponentCSSClasses<MenuCSSClasses>;
66
+ export type MenuComponentTemplates = Required<MenuTemplates>;
67
+ export type MenuWidgetParams = {
68
68
  /**
69
69
  * CSS Selector or HTMLElement to insert the widget.
70
70
  */
@@ -78,7 +78,7 @@ export declare type MenuWidgetParams = {
78
78
  */
79
79
  cssClasses?: MenuCSSClasses;
80
80
  };
81
- export declare type MenuWidget = WidgetFactory<MenuWidgetDescription & {
81
+ export type MenuWidget = WidgetFactory<MenuWidgetDescription & {
82
82
  $$widgetType: 'ais.menu';
83
83
  }, MenuConnectorParams, MenuWidgetParams>;
84
84
  declare const menu: MenuWidget;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { MenuConnectorParams, MenuWidgetDescription } from '../../connectors/menu/connectMenu';
3
3
  import type { Template, WidgetFactory } from '../../types';
4
- export declare type MenuSelectCSSClasses = Partial<{
4
+ export type MenuSelectCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS class to add to the root element.
7
7
  */
@@ -19,7 +19,7 @@ export declare type MenuSelectCSSClasses = Partial<{
19
19
  */
20
20
  option: string | string[];
21
21
  }>;
22
- export declare type MenuSelectTemplates = Partial<{
22
+ export type MenuSelectTemplates = Partial<{
23
23
  /**
24
24
  * Item template, provided with `label`, `count`, `isRefined` and `value` data properties.
25
25
  */
@@ -34,7 +34,7 @@ export declare type MenuSelectTemplates = Partial<{
34
34
  */
35
35
  defaultOption: Template;
36
36
  }>;
37
- export declare type MenuSelectWidgetParams = {
37
+ export type MenuSelectWidgetParams = {
38
38
  /**
39
39
  * CSS Selector or HTMLElement to insert the widget.
40
40
  */
@@ -48,7 +48,7 @@ export declare type MenuSelectWidgetParams = {
48
48
  */
49
49
  cssClasses?: MenuSelectCSSClasses;
50
50
  };
51
- export declare type MenuSelectWidget = WidgetFactory<MenuWidgetDescription & {
51
+ export type MenuSelectWidget = WidgetFactory<MenuWidgetDescription & {
52
52
  $$widgetType: 'ais.menuSelect';
53
53
  }, MenuConnectorParams, MenuSelectWidgetParams>;
54
54
  declare const menuSelect: MenuSelectWidget;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { NumericMenuConnectorParams, NumericMenuWidgetDescription } from '../../connectors/numeric-menu/connectNumericMenu';
3
3
  import type { ComponentCSSClasses, Template, WidgetFactory } from '../../types';
4
- export declare type NumericMenuCSSClasses = Partial<{
4
+ export type NumericMenuCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS class to add to the root element.
7
7
  */
@@ -35,8 +35,8 @@ export declare type NumericMenuCSSClasses = Partial<{
35
35
  */
36
36
  radio: string | string[];
37
37
  }>;
38
- export declare type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;
39
- export declare type NumericMenuTemplates = Partial<{
38
+ export type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;
39
+ export type NumericMenuTemplates = Partial<{
40
40
  /**
41
41
  * Item template, provided with `label` (the name in the configuration), `isRefined`, `url`, `value` (the setting for the filter) data properties.
42
42
  */
@@ -70,8 +70,8 @@ export declare type NumericMenuTemplates = Partial<{
70
70
  cssClasses: NumericMenuComponentCSSClasses;
71
71
  }>;
72
72
  }>;
73
- export declare type NumericMenuComponentTemplates = Required<NumericMenuTemplates>;
74
- export declare type NumericMenuWidgetParams = {
73
+ export type NumericMenuComponentTemplates = Required<NumericMenuTemplates>;
74
+ export type NumericMenuWidgetParams = {
75
75
  /**
76
76
  * CSS Selector or HTMLElement to insert the widget.
77
77
  */
@@ -85,7 +85,7 @@ export declare type NumericMenuWidgetParams = {
85
85
  */
86
86
  cssClasses?: NumericMenuCSSClasses;
87
87
  };
88
- export declare type NumericMenuWidget = WidgetFactory<NumericMenuWidgetDescription & {
88
+ export type NumericMenuWidget = WidgetFactory<NumericMenuWidgetDescription & {
89
89
  $$widgetType: 'ais.numericMenu';
90
90
  }, NumericMenuConnectorParams, NumericMenuWidgetParams>;
91
91
  declare const numericMenu: NumericMenuWidget;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { PaginationConnectorParams, PaginationWidgetDescription } from '../../connectors/pagination/connectPagination';
3
3
  import type { WidgetFactory } from '../../types';
4
- export declare type PaginationCSSClasses = Partial<{
4
+ export type PaginationCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS classes added to the root element of the widget.
7
7
  */
@@ -51,7 +51,7 @@ export declare type PaginationCSSClasses = Partial<{
51
51
  */
52
52
  link: string | string[];
53
53
  }>;
54
- export declare type PaginationTemplates = Partial<{
54
+ export type PaginationTemplates = Partial<{
55
55
  /**
56
56
  * Label for the Previous link.
57
57
  */
@@ -69,7 +69,7 @@ export declare type PaginationTemplates = Partial<{
69
69
  */
70
70
  last: string;
71
71
  }>;
72
- export declare type PaginationWidgetParams = {
72
+ export type PaginationWidgetParams = {
73
73
  /**
74
74
  * CSS Selector or HTMLElement to insert the widget.
75
75
  */
@@ -117,7 +117,7 @@ export declare type PaginationWidgetParams = {
117
117
  */
118
118
  cssClasses?: PaginationCSSClasses;
119
119
  };
120
- export declare type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {
120
+ export type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {
121
121
  $$widgetType: 'ais.pagination';
122
122
  }, PaginationConnectorParams, PaginationWidgetParams>;
123
123
  declare const pagination: PaginationWidget;
@@ -1,6 +1,6 @@
1
1
 
2
2
  import type { Template, RenderOptions, WidgetFactory, InitOptions, Widget } from '../../types';
3
- export declare type PanelCSSClasses = Partial<{
3
+ export type PanelCSSClasses = Partial<{
4
4
  /**
5
5
  * CSS classes to add to the root element of the widget.
6
6
  */
@@ -38,10 +38,10 @@ export declare type PanelCSSClasses = Partial<{
38
38
  */
39
39
  footer: string | string[];
40
40
  }>;
41
- declare type AnyWidgetFactory = WidgetFactory<{
41
+ type AnyWidgetFactory = WidgetFactory<{
42
42
  $$type: string;
43
43
  }, Record<string, any>, any>;
44
- export declare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{
44
+ export type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{
45
45
  /**
46
46
  * Template to use for the header.
47
47
  */
@@ -57,10 +57,10 @@ export declare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{
57
57
  collapsed: boolean;
58
58
  }>;
59
59
  }>;
60
- declare type GetWidgetRenderState<TWidgetFactory extends AnyWidgetFactory> = ReturnType<TWidgetFactory>['getWidgetRenderState'] extends (renderOptions: any) => infer TRenderState ? TRenderState extends Record<string, unknown> ? TRenderState : never : Record<string, unknown>;
61
- export declare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;
62
- export declare type PanelSharedOptions<TWidgetFactory extends AnyWidgetFactory> = (InitOptions | RenderOptions) & GetWidgetRenderState<TWidgetFactory>;
63
- export declare type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {
60
+ type GetWidgetRenderState<TWidgetFactory extends AnyWidgetFactory> = ReturnType<TWidgetFactory>['getWidgetRenderState'] extends (renderOptions: any) => infer TRenderState ? TRenderState extends Record<string, unknown> ? TRenderState : never : Record<string, unknown>;
61
+ export type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;
62
+ export type PanelSharedOptions<TWidgetFactory extends AnyWidgetFactory> = (InitOptions | RenderOptions) & GetWidgetRenderState<TWidgetFactory>;
63
+ export type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {
64
64
  /**
65
65
  * A function that is called on each render to determine if the
66
66
  * panel should be hidden based on the render options.
@@ -80,8 +80,8 @@ export declare type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> =
80
80
  */
81
81
  cssClasses?: PanelCSSClasses;
82
82
  };
83
- declare type AugmentedWidget<TWidgetFactory extends AnyWidgetFactory, TOverriddenKeys extends keyof Widget = 'init' | 'render' | 'dispose'> = Omit<ReturnType<TWidgetFactory>, TOverriddenKeys> & Pick<Required<Widget>, TOverriddenKeys>;
84
- export declare type PanelWidget = <TWidgetFactory extends AnyWidgetFactory>(panelWidgetParams?: PanelWidgetParams<TWidgetFactory>) => (widgetFactory: TWidgetFactory) => (widgetParams: Parameters<TWidgetFactory>[0]) => AugmentedWidget<TWidgetFactory>;
83
+ type AugmentedWidget<TWidgetFactory extends AnyWidgetFactory, TOverriddenKeys extends keyof Widget = 'init' | 'render' | 'dispose'> = Omit<ReturnType<TWidgetFactory>, TOverriddenKeys> & Pick<Required<Widget>, TOverriddenKeys>;
84
+ export type PanelWidget = <TWidgetFactory extends AnyWidgetFactory>(panelWidgetParams?: PanelWidgetParams<TWidgetFactory>) => (widgetFactory: TWidgetFactory) => (widgetParams: Parameters<TWidgetFactory>[0]) => AugmentedWidget<TWidgetFactory>;
85
85
  /**
86
86
  * The panel widget wraps other widgets in a consistent panel design.
87
87
  * It also reacts, indicates and sets CSS classes when widgets are no longer relevant for refining.
@@ -1,10 +1,10 @@
1
1
  // @ts-ignore
2
2
  import type * as Places from 'places.js';
3
3
  import type { WidgetFactory, WidgetRenderState } from '../../types';
4
- declare type StaticOptions = Places.StaticOptions;
5
- declare type PlacesInstance = Places.PlacesInstance;
6
- declare type ReconfigurableOptions = Places.ReconfigurableOptions;
7
- export declare type PlacesWidgetParams = {
4
+ type StaticOptions = Places.StaticOptions;
5
+ type PlacesInstance = Places.PlacesInstance;
6
+ type ReconfigurableOptions = Places.ReconfigurableOptions;
7
+ export type PlacesWidgetParams = {
8
8
  /**
9
9
  * The Algolia Places reference to use.
10
10
  *
@@ -16,7 +16,7 @@ export declare type PlacesWidgetParams = {
16
16
  */
17
17
  defaultPosition?: string[];
18
18
  } & StaticOptions;
19
- export declare type PlacesWidgetDescription = {
19
+ export type PlacesWidgetDescription = {
20
20
  $$type: 'ais.places';
21
21
  $$widgetType: 'ais.places';
22
22
  renderState: Record<string, unknown>;
@@ -30,7 +30,7 @@ export declare type PlacesWidgetDescription = {
30
30
  };
31
31
  };
32
32
  };
33
- export declare type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;
33
+ export type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;
34
34
  /**
35
35
  * This widget sets the geolocation value for the search based on the selected
36
36
  * result in the Algolia Places autocomplete.
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { PoweredByConnectorParams, PoweredByWidgetDescription } from '../../connectors/powered-by/connectPoweredBy';
3
3
  import type { WidgetFactory } from '../../types';
4
- export declare type PoweredByCSSClasses = Partial<{
4
+ export type PoweredByCSSClasses = Partial<{
5
5
  /**
6
6
  * CSS class to add to the wrapping element.
7
7
  */
@@ -15,7 +15,7 @@ export declare type PoweredByCSSClasses = Partial<{
15
15
  */
16
16
  logo: string | string[];
17
17
  }>;
18
- export declare type PoweredByWidgetParams = {
18
+ export type PoweredByWidgetParams = {
19
19
  /**
20
20
  * CSS Selector or HTMLElement to insert the widget.
21
21
  */
@@ -30,7 +30,7 @@ export declare type PoweredByWidgetParams = {
30
30
  */
31
31
  cssClasses?: PoweredByCSSClasses;
32
32
  };
33
- export declare type PoweredByWidget = WidgetFactory<PoweredByWidgetDescription & {
33
+ export type PoweredByWidget = WidgetFactory<PoweredByWidgetDescription & {
34
34
  $$widgetType: 'ais.poweredBy';
35
35
  }, PoweredByConnectorParams, PoweredByWidgetParams>;
36
36
  declare const poweredBy: PoweredByWidget;
@@ -1,10 +1,10 @@
1
1
  import type { WidgetFactory } from '../../types';
2
2
  import type { ParamTrackedFilters, ParamTransformRuleContexts, QueryRulesConnectorParams, QueryRulesWidgetDescription } from '../../connectors/query-rules/connectQueryRules';
3
- export declare type QueryRuleContextWidgetParams = {
3
+ export type QueryRuleContextWidgetParams = {
4
4
  trackedFilters: ParamTrackedFilters;
5
5
  transformRuleContexts?: ParamTransformRuleContexts;
6
6
  };
7
- export declare type QueryRuleContextWidget = WidgetFactory<QueryRulesWidgetDescription & {
7
+ export type QueryRuleContextWidget = WidgetFactory<QueryRulesWidgetDescription & {
8
8
  $$widgetType: 'ais.queryRuleContext';
9
9
  }, QueryRulesConnectorParams, QueryRuleContextWidgetParams>;
10
10
  declare const queryRuleContext: QueryRuleContextWidget;