instantsearch.js 4.83.0 → 4.84.0

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.
@@ -309,7 +309,17 @@ declare type AutocompleteRenderState = {
309
309
  refine: (query: string) => void;
310
310
  };
311
311
 
312
- declare type AutocompleteTemplates<TItem extends BaseHit> = Partial<Record<string, TItem>>;
312
+ declare type AutocompleteSearchParameters = Omit<PlainSearchParameters, 'index'>;
313
+
314
+ declare type AutocompleteTemplates = {
315
+ /**
316
+ * Template to use for the panel.
317
+ */
318
+ panel?: Template<{
319
+ elements: PanelElements;
320
+ indices: AutocompleteRenderState['indices'];
321
+ }>;
322
+ };
313
323
 
314
324
  declare type AutocompleteWidgetDescription = {
315
325
  $$type: 'ais.autocomplete';
@@ -355,12 +365,16 @@ declare type AutocompleteWidgetParams<TItem extends BaseHit> = {
355
365
  }>;
356
366
  }>;
357
367
  };
368
+ /**
369
+ * Search parameters to apply to the autocomplete indices.
370
+ */
371
+ searchParameters?: AutocompleteSearchParameters;
358
372
  getSearchPageURL?: (nextUiState: IndexUiState) => string;
359
373
  onSelect?: AutocompleteIndexConfig<TItem>['onSelect'];
360
374
  /**
361
375
  * Templates to use for the widget.
362
376
  */
363
- templates?: AutocompleteTemplates<TItem>;
377
+ templates?: AutocompleteTemplates;
364
378
  /**
365
379
  * CSS classes to add.
366
380
  */
@@ -4887,6 +4901,10 @@ declare type IndexConfig<TItem extends BaseHit> = AutocompleteIndexConfig<TItem>
4887
4901
  onSelect: () => void;
4888
4902
  }>;
4889
4903
  }>;
4904
+ /**
4905
+ * Search parameters to apply to this index.
4906
+ */
4907
+ searchParameters?: AutocompleteSearchParameters;
4890
4908
  cssClasses?: Partial<AutocompleteIndexClassNames>;
4891
4909
  };
4892
4910
 
@@ -4947,6 +4965,11 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
4947
4965
  * @private
4948
4966
  */
4949
4967
  _isolated: boolean;
4968
+ /**
4969
+ * Schedules a search for this index only.
4970
+ * @private
4971
+ */
4972
+ scheduleLocalSearch: () => void;
4950
4973
  };
4951
4974
 
4952
4975
  declare type IndexWidgetDescription = {
@@ -6350,6 +6373,8 @@ declare type PanelCSSClasses = Partial<{
6350
6373
  footer: string | string[];
6351
6374
  }>;
6352
6375
 
6376
+ declare type PanelElements = Partial<Record<'recent' | 'suggestions' | (string & {}), preact.JSX.Element>>;
6377
+
6353
6378
  declare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;
6354
6379
 
6355
6380
  declare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{
@@ -309,7 +309,17 @@ declare type AutocompleteRenderState = {
309
309
  refine: (query: string) => void;
310
310
  };
311
311
 
312
- declare type AutocompleteTemplates<TItem extends BaseHit> = Partial<Record<string, TItem>>;
312
+ declare type AutocompleteSearchParameters = Omit<PlainSearchParameters, 'index'>;
313
+
314
+ declare type AutocompleteTemplates = {
315
+ /**
316
+ * Template to use for the panel.
317
+ */
318
+ panel?: Template<{
319
+ elements: PanelElements;
320
+ indices: AutocompleteRenderState['indices'];
321
+ }>;
322
+ };
313
323
 
314
324
  declare type AutocompleteWidgetDescription = {
315
325
  $$type: 'ais.autocomplete';
@@ -355,12 +365,16 @@ declare type AutocompleteWidgetParams<TItem extends BaseHit> = {
355
365
  }>;
356
366
  }>;
357
367
  };
368
+ /**
369
+ * Search parameters to apply to the autocomplete indices.
370
+ */
371
+ searchParameters?: AutocompleteSearchParameters;
358
372
  getSearchPageURL?: (nextUiState: IndexUiState) => string;
359
373
  onSelect?: AutocompleteIndexConfig<TItem>['onSelect'];
360
374
  /**
361
375
  * Templates to use for the widget.
362
376
  */
363
- templates?: AutocompleteTemplates<TItem>;
377
+ templates?: AutocompleteTemplates;
364
378
  /**
365
379
  * CSS classes to add.
366
380
  */
@@ -4887,6 +4901,10 @@ declare type IndexConfig<TItem extends BaseHit> = AutocompleteIndexConfig<TItem>
4887
4901
  onSelect: () => void;
4888
4902
  }>;
4889
4903
  }>;
4904
+ /**
4905
+ * Search parameters to apply to this index.
4906
+ */
4907
+ searchParameters?: AutocompleteSearchParameters;
4890
4908
  cssClasses?: Partial<AutocompleteIndexClassNames>;
4891
4909
  };
4892
4910
 
@@ -4947,6 +4965,11 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
4947
4965
  * @private
4948
4966
  */
4949
4967
  _isolated: boolean;
4968
+ /**
4969
+ * Schedules a search for this index only.
4970
+ * @private
4971
+ */
4972
+ scheduleLocalSearch: () => void;
4950
4973
  };
4951
4974
 
4952
4975
  declare type IndexWidgetDescription = {
@@ -6350,6 +6373,8 @@ declare type PanelCSSClasses = Partial<{
6350
6373
  footer: string | string[];
6351
6374
  }>;
6352
6375
 
6376
+ declare type PanelElements = Partial<Record<'recent' | 'suggestions' | (string & {}), preact.JSX.Element>>;
6377
+
6353
6378
  declare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;
6354
6379
 
6355
6380
  declare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{