instantsearch.js 4.71.1 → 4.72.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.
@@ -2,6 +2,7 @@
2
2
  /// <reference types="googlemaps" />
3
3
 
4
4
  import { AlgoliaSearchHelper } from 'algoliasearch-helper';
5
+ import { Banner } from 'algoliasearch-helper';
5
6
  import EventEmitter from '@algolia/events';
6
7
  import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';
7
8
  import type { FrequentlyBoughtTogetherProps } from 'instantsearch-ui-components';
@@ -311,8 +312,6 @@ declare type AutocompleteWidgetDescription = {
311
312
  };
312
313
  };
313
314
 
314
- declare type Banner = NonNullable<NonNullable<Required<SearchResults<Hit>['renderingContent']>>['widgets']['banners']>[number];
315
-
316
315
  declare type BaseHit = Record<string, any>;
317
316
 
318
317
  declare type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;
@@ -893,18 +892,7 @@ declare const connectHitsWithInsights: <TWidgetParams>(renderFn: Renderer<HitsRe
893
892
  hits: Hit<BaseHit>[] | Hit<THit>[];
894
893
  items: Hit<BaseHit>[] | Hit<THit>[];
895
894
  results: SearchResults<any>;
896
- banner: {
897
- image: {
898
- urls: {
899
- url: string;
900
- }[];
901
- title?: string | undefined;
902
- };
903
- link?: {
904
- url: string;
905
- target?: "_blank" | "_self" | undefined;
906
- } | undefined;
907
- } | undefined;
895
+ banner: Banner | undefined;
908
896
  sendEvent: SendEventForHits;
909
897
  bindEvent: BindEventForHits;
910
898
  widgetParams: TWidgetParams & HitsConnectorParams<THit>;
@@ -1077,6 +1065,7 @@ declare const connectInfiniteHitsWithInsights: <TWidgetParams extends object>(re
1077
1065
  currentPageHits: Hit<THit>[];
1078
1066
  sendEvent: SendEventForHits;
1079
1067
  bindEvent: BindEventForHits;
1068
+ banner: Banner | undefined;
1080
1069
  results: SearchResults<any> | undefined;
1081
1070
  showPrevious: () => void;
1082
1071
  showMore: () => void;
@@ -1613,18 +1602,7 @@ declare const _default: <TWidgetParams>(renderFn: Renderer<HitsRenderState<BaseH
1613
1602
  hits: Hit<BaseHit>[] | Hit<THit>[];
1614
1603
  items: Hit<BaseHit>[] | Hit<THit>[];
1615
1604
  results: SearchResults<any>;
1616
- banner: {
1617
- image: {
1618
- urls: {
1619
- url: string;
1620
- }[];
1621
- title?: string | undefined;
1622
- };
1623
- link?: {
1624
- url: string;
1625
- target?: "_blank" | "_self" | undefined;
1626
- } | undefined;
1627
- } | undefined;
1605
+ banner: Banner | undefined;
1628
1606
  sendEvent: SendEventForHits;
1629
1607
  bindEvent: BindEventForHits;
1630
1608
  widgetParams: TWidgetParams & HitsConnectorParams<THit>;
@@ -1803,6 +1781,7 @@ declare const _default_10: <THit extends object = BaseHit>(widgetParams: Infinit
1803
1781
  currentPageHits: Hit<THit>[];
1804
1782
  sendEvent: SendEventForHits;
1805
1783
  bindEvent: BindEventForHits;
1784
+ banner: Banner | undefined;
1806
1785
  results: SearchResults<any> | undefined;
1807
1786
  showPrevious: () => void;
1808
1787
  showMore: () => void;
@@ -3185,6 +3164,7 @@ declare const _default_2: <TWidgetParams extends object>(renderFn: Renderer<Infi
3185
3164
  currentPageHits: Hit<THit>[];
3186
3165
  sendEvent: SendEventForHits;
3187
3166
  bindEvent: BindEventForHits;
3167
+ banner: Banner | undefined;
3188
3168
  results: SearchResults<any> | undefined;
3189
3169
  showPrevious: () => void;
3190
3170
  showMore: () => void;
@@ -5192,11 +5172,7 @@ declare const _default_9: <THit extends object = BaseHit>(widgetParams: HitsWidg
5192
5172
  getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {
5193
5173
  hits: never[];
5194
5174
  items: never[];
5195
- results: undefined; /**
5196
- * Template to use for each result. This template will receive an object containing a single record.
5197
- *
5198
- * @default ''
5199
- */
5175
+ results: undefined;
5200
5176
  banner: undefined;
5201
5177
  sendEvent: SendEventForHits;
5202
5178
  bindEvent: BindEventForHits;
@@ -5205,22 +5181,11 @@ declare const _default_9: <THit extends object = BaseHit>(widgetParams: HitsWidg
5205
5181
  hits: Hit<BaseHit>[] | Hit<THit>[];
5206
5182
  items: Hit<BaseHit>[] | Hit<THit>[];
5207
5183
  results: SearchResults<any>;
5184
+ banner: Banner | undefined;
5185
+ sendEvent: SendEventForHits;
5208
5186
  /**
5209
- * CSS classes to add.
5187
+ * Templates to use for the widget.
5210
5188
  */
5211
- banner: {
5212
- image: {
5213
- urls: {
5214
- url: string;
5215
- }[];
5216
- title?: string | undefined;
5217
- };
5218
- link?: {
5219
- url: string;
5220
- target?: "_blank" | "_self" | undefined;
5221
- } | undefined;
5222
- } | undefined;
5223
- sendEvent: SendEventForHits;
5224
5189
  bindEvent: BindEventForHits;
5225
5190
  widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;
5226
5191
  };
@@ -6451,6 +6416,10 @@ declare type InfiniteHitsRenderState<THit extends NonNullable<object> = BaseHit>
6451
6416
  * The response from the Algolia API.
6452
6417
  */
6453
6418
  results?: SearchResults<Hit<THit>>;
6419
+ /**
6420
+ * The banner to display above the hits.
6421
+ */
6422
+ banner?: Banner;
6454
6423
  };
6455
6424
 
6456
6425
  declare type InfiniteHitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{
@@ -2,6 +2,7 @@
2
2
  /// <reference types="googlemaps" />
3
3
 
4
4
  import { AlgoliaSearchHelper } from 'algoliasearch-helper';
5
+ import { Banner } from 'algoliasearch-helper';
5
6
  import EventEmitter from '@algolia/events';
6
7
  import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';
7
8
  import type { FrequentlyBoughtTogetherProps } from 'instantsearch-ui-components';
@@ -311,8 +312,6 @@ declare type AutocompleteWidgetDescription = {
311
312
  };
312
313
  };
313
314
 
314
- declare type Banner = NonNullable<NonNullable<Required<SearchResults<Hit>['renderingContent']>>['widgets']['banners']>[number];
315
-
316
315
  declare type BaseHit = Record<string, any>;
317
316
 
318
317
  declare type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;
@@ -893,18 +892,7 @@ declare const connectHitsWithInsights: <TWidgetParams>(renderFn: Renderer<HitsRe
893
892
  hits: Hit<BaseHit>[] | Hit<THit>[];
894
893
  items: Hit<BaseHit>[] | Hit<THit>[];
895
894
  results: SearchResults<any>;
896
- banner: {
897
- image: {
898
- urls: {
899
- url: string;
900
- }[];
901
- title?: string | undefined;
902
- };
903
- link?: {
904
- url: string;
905
- target?: "_blank" | "_self" | undefined;
906
- } | undefined;
907
- } | undefined;
895
+ banner: Banner | undefined;
908
896
  sendEvent: SendEventForHits;
909
897
  bindEvent: BindEventForHits;
910
898
  widgetParams: TWidgetParams & HitsConnectorParams<THit>;
@@ -1077,6 +1065,7 @@ declare const connectInfiniteHitsWithInsights: <TWidgetParams extends object>(re
1077
1065
  currentPageHits: Hit<THit>[];
1078
1066
  sendEvent: SendEventForHits;
1079
1067
  bindEvent: BindEventForHits;
1068
+ banner: Banner | undefined;
1080
1069
  results: SearchResults<any> | undefined;
1081
1070
  showPrevious: () => void;
1082
1071
  showMore: () => void;
@@ -1613,18 +1602,7 @@ declare const _default: <TWidgetParams>(renderFn: Renderer<HitsRenderState<BaseH
1613
1602
  hits: Hit<BaseHit>[] | Hit<THit>[];
1614
1603
  items: Hit<BaseHit>[] | Hit<THit>[];
1615
1604
  results: SearchResults<any>;
1616
- banner: {
1617
- image: {
1618
- urls: {
1619
- url: string;
1620
- }[];
1621
- title?: string | undefined;
1622
- };
1623
- link?: {
1624
- url: string;
1625
- target?: "_blank" | "_self" | undefined;
1626
- } | undefined;
1627
- } | undefined;
1605
+ banner: Banner | undefined;
1628
1606
  sendEvent: SendEventForHits;
1629
1607
  bindEvent: BindEventForHits;
1630
1608
  widgetParams: TWidgetParams & HitsConnectorParams<THit>;
@@ -1803,6 +1781,7 @@ declare const _default_10: <THit extends object = BaseHit>(widgetParams: Infinit
1803
1781
  currentPageHits: Hit<THit>[];
1804
1782
  sendEvent: SendEventForHits;
1805
1783
  bindEvent: BindEventForHits;
1784
+ banner: Banner | undefined;
1806
1785
  results: SearchResults<any> | undefined;
1807
1786
  showPrevious: () => void;
1808
1787
  showMore: () => void;
@@ -3185,6 +3164,7 @@ declare const _default_2: <TWidgetParams extends object>(renderFn: Renderer<Infi
3185
3164
  currentPageHits: Hit<THit>[];
3186
3165
  sendEvent: SendEventForHits;
3187
3166
  bindEvent: BindEventForHits;
3167
+ banner: Banner | undefined;
3188
3168
  results: SearchResults<any> | undefined;
3189
3169
  showPrevious: () => void;
3190
3170
  showMore: () => void;
@@ -5192,11 +5172,7 @@ declare const _default_9: <THit extends object = BaseHit>(widgetParams: HitsWidg
5192
5172
  getWidgetRenderState({ results, helper, instantSearchInstance }: InitOptions | RenderOptions): {
5193
5173
  hits: never[];
5194
5174
  items: never[];
5195
- results: undefined; /**
5196
- * Template to use for each result. This template will receive an object containing a single record.
5197
- *
5198
- * @default ''
5199
- */
5175
+ results: undefined;
5200
5176
  banner: undefined;
5201
5177
  sendEvent: SendEventForHits;
5202
5178
  bindEvent: BindEventForHits;
@@ -5205,22 +5181,11 @@ declare const _default_9: <THit extends object = BaseHit>(widgetParams: HitsWidg
5205
5181
  hits: Hit<BaseHit>[] | Hit<THit>[];
5206
5182
  items: Hit<BaseHit>[] | Hit<THit>[];
5207
5183
  results: SearchResults<any>;
5184
+ banner: Banner | undefined;
5185
+ sendEvent: SendEventForHits;
5208
5186
  /**
5209
- * CSS classes to add.
5187
+ * Templates to use for the widget.
5210
5188
  */
5211
- banner: {
5212
- image: {
5213
- urls: {
5214
- url: string;
5215
- }[];
5216
- title?: string | undefined;
5217
- };
5218
- link?: {
5219
- url: string;
5220
- target?: "_blank" | "_self" | undefined;
5221
- } | undefined;
5222
- } | undefined;
5223
- sendEvent: SendEventForHits;
5224
5189
  bindEvent: BindEventForHits;
5225
5190
  widgetParams: Partial<HitsWidgetParams<BaseHit>> & HitsConnectorParams<THit>;
5226
5191
  };
@@ -6451,6 +6416,10 @@ declare type InfiniteHitsRenderState<THit extends NonNullable<object> = BaseHit>
6451
6416
  * The response from the Algolia API.
6452
6417
  */
6453
6418
  results?: SearchResults<Hit<THit>>;
6419
+ /**
6420
+ * The banner to display above the hits.
6421
+ */
6422
+ banner?: Banner;
6454
6423
  };
6455
6424
 
6456
6425
  declare type InfiniteHitsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{