instantsearch.js 4.79.2 → 4.80.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.
@@ -4758,8 +4758,8 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
4758
4758
  getParent: () => IndexWidget | null;
4759
4759
  getWidgets: () => Array<Widget | IndexWidget>;
4760
4760
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
4761
- addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
4762
- removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
4761
+ addWidgets: (widgets: Array<Widget | IndexWidget | Widget[]>) => IndexWidget;
4762
+ removeWidgets: (widgets: Array<Widget | IndexWidget | Widget[]>) => IndexWidget;
4763
4763
  init: (options: IndexInitOptions) => void;
4764
4764
  render: (options: IndexRenderOptions) => void;
4765
4765
  dispose: () => void;
@@ -4782,6 +4782,12 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
4782
4782
  * Can only be called after `init`.
4783
4783
  */
4784
4784
  setIndexUiState: (indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])) => void;
4785
+ /**
4786
+ * This index is isolated, meaning it will not be merged with the main
4787
+ * helper's state.
4788
+ * @private
4789
+ */
4790
+ _isolated: boolean;
4785
4791
  };
4786
4792
 
4787
4793
  declare type IndexWidgetDescription = {
@@ -4790,7 +4796,45 @@ declare type IndexWidgetDescription = {
4790
4796
  };
4791
4797
 
4792
4798
  declare type IndexWidgetParams = {
4799
+ /**
4800
+ * The index or composition id to target.
4801
+ */
4793
4802
  indexName: string;
4803
+ /**
4804
+ * Id to use for the index if there are multiple indices with the same name.
4805
+ * This will be used to create the URL and the render state.
4806
+ */
4807
+ indexId?: string;
4808
+ /**
4809
+ * If `true`, the index will not be merged with the main helper's state.
4810
+ * This means that the index will not be part of the main search request.
4811
+ *
4812
+ * @default false
4813
+ */
4814
+ EXPERIMENTAL_isolated?: false;
4815
+ } | {
4816
+ /**
4817
+ * If `true`, the index will not be merged with the main helper's state.
4818
+ * This means that the index will not be part of the main search request.
4819
+ *
4820
+ * This option is EXPERIMENTAL, and implementation details may change in the future.
4821
+ * Things that could change are:
4822
+ * - which widgets get rendered when a change happens
4823
+ * - whether the index searches automatically
4824
+ * - whether the index is included in the URL / UiState
4825
+ * - whether the index is included in server-side rendering
4826
+ *
4827
+ * @default false
4828
+ */
4829
+ EXPERIMENTAL_isolated: true;
4830
+ /**
4831
+ * The index or composition id to target.
4832
+ */
4833
+ indexName?: string;
4834
+ /**
4835
+ * Id to use for the index if there are multiple indices with the same name.
4836
+ * This will be used to create the URL and the render state.
4837
+ */
4794
4838
  indexId?: string;
4795
4839
  };
4796
4840
 
@@ -5125,7 +5169,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
5125
5169
  * Widgets can be added either before or after InstantSearch has started.
5126
5170
  * @param widgets The array of widgets to add to InstantSearch.
5127
5171
  */
5128
- addWidgets(widgets: Array<Widget | IndexWidget>): this;
5172
+ addWidgets(widgets: Array<Widget | IndexWidget | Widget[]>): this;
5129
5173
  /**
5130
5174
  * Removes a widget from the search instance.
5131
5175
  * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`
@@ -5140,7 +5184,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
5140
5184
  *
5141
5185
  * The widgets must implement a `dispose()` method to clear their states.
5142
5186
  */
5143
- removeWidgets(widgets: Array<Widget | IndexWidget>): this;
5187
+ removeWidgets(widgets: Array<Widget | IndexWidget | Widget[]>): this;
5144
5188
  /**
5145
5189
  * Ends the initialization of InstantSearch.js and triggers the
5146
5190
  * first search.
@@ -4758,8 +4758,8 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
4758
4758
  getParent: () => IndexWidget | null;
4759
4759
  getWidgets: () => Array<Widget | IndexWidget>;
4760
4760
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
4761
- addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
4762
- removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
4761
+ addWidgets: (widgets: Array<Widget | IndexWidget | Widget[]>) => IndexWidget;
4762
+ removeWidgets: (widgets: Array<Widget | IndexWidget | Widget[]>) => IndexWidget;
4763
4763
  init: (options: IndexInitOptions) => void;
4764
4764
  render: (options: IndexRenderOptions) => void;
4765
4765
  dispose: () => void;
@@ -4782,6 +4782,12 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
4782
4782
  * Can only be called after `init`.
4783
4783
  */
4784
4784
  setIndexUiState: (indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])) => void;
4785
+ /**
4786
+ * This index is isolated, meaning it will not be merged with the main
4787
+ * helper's state.
4788
+ * @private
4789
+ */
4790
+ _isolated: boolean;
4785
4791
  };
4786
4792
 
4787
4793
  declare type IndexWidgetDescription = {
@@ -4790,7 +4796,45 @@ declare type IndexWidgetDescription = {
4790
4796
  };
4791
4797
 
4792
4798
  declare type IndexWidgetParams = {
4799
+ /**
4800
+ * The index or composition id to target.
4801
+ */
4793
4802
  indexName: string;
4803
+ /**
4804
+ * Id to use for the index if there are multiple indices with the same name.
4805
+ * This will be used to create the URL and the render state.
4806
+ */
4807
+ indexId?: string;
4808
+ /**
4809
+ * If `true`, the index will not be merged with the main helper's state.
4810
+ * This means that the index will not be part of the main search request.
4811
+ *
4812
+ * @default false
4813
+ */
4814
+ EXPERIMENTAL_isolated?: false;
4815
+ } | {
4816
+ /**
4817
+ * If `true`, the index will not be merged with the main helper's state.
4818
+ * This means that the index will not be part of the main search request.
4819
+ *
4820
+ * This option is EXPERIMENTAL, and implementation details may change in the future.
4821
+ * Things that could change are:
4822
+ * - which widgets get rendered when a change happens
4823
+ * - whether the index searches automatically
4824
+ * - whether the index is included in the URL / UiState
4825
+ * - whether the index is included in server-side rendering
4826
+ *
4827
+ * @default false
4828
+ */
4829
+ EXPERIMENTAL_isolated: true;
4830
+ /**
4831
+ * The index or composition id to target.
4832
+ */
4833
+ indexName?: string;
4834
+ /**
4835
+ * Id to use for the index if there are multiple indices with the same name.
4836
+ * This will be used to create the URL and the render state.
4837
+ */
4794
4838
  indexId?: string;
4795
4839
  };
4796
4840
 
@@ -5125,7 +5169,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
5125
5169
  * Widgets can be added either before or after InstantSearch has started.
5126
5170
  * @param widgets The array of widgets to add to InstantSearch.
5127
5171
  */
5128
- addWidgets(widgets: Array<Widget | IndexWidget>): this;
5172
+ addWidgets(widgets: Array<Widget | IndexWidget | Widget[]>): this;
5129
5173
  /**
5130
5174
  * Removes a widget from the search instance.
5131
5175
  * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`
@@ -5140,7 +5184,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
5140
5184
  *
5141
5185
  * The widgets must implement a `dispose()` method to clear their states.
5142
5186
  */
5143
- removeWidgets(widgets: Array<Widget | IndexWidget>): this;
5187
+ removeWidgets(widgets: Array<Widget | IndexWidget | Widget[]>): this;
5144
5188
  /**
5145
5189
  * Ends the initialization of InstantSearch.js and triggers the
5146
5190
  * first search.