instantsearch.js 4.33.2 → 4.37.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.
- package/CHANGELOG.md +42 -0
- package/README.md +2 -1
- package/cjs/components/Answers/Answers.js +1 -1
- package/cjs/components/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/components/ClearRefinements/ClearRefinements.js +1 -1
- package/cjs/components/CurrentRefinements/CurrentRefinements.js +3 -3
- package/cjs/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/cjs/components/Hits/Hits.js +1 -1
- package/cjs/components/InfiniteHits/InfiniteHits.js +1 -1
- package/cjs/components/MenuSelect/MenuSelect.js +3 -3
- package/cjs/components/Pagination/Pagination.js +71 -161
- package/cjs/components/Pagination/PaginationLink.js +26 -13
- package/cjs/components/Panel/Panel.js +1 -1
- package/cjs/components/QueryRuleCustomData/QueryRuleCustomData.js +1 -1
- package/cjs/components/RangeInput/RangeInput.js +1 -1
- package/cjs/components/RefinementList/RefinementList.js +6 -6
- package/cjs/components/RefinementList/RefinementListItem.js +1 -1
- package/cjs/components/RelevantSort/RelevantSort.js +1 -1
- package/cjs/components/SearchBox/SearchBox.js +9 -10
- package/cjs/components/Slider/Slider.js +5 -5
- package/cjs/components/Stats/Stats.js +1 -1
- package/cjs/components/Template/Template.js +3 -3
- package/cjs/components/ToggleRefinement/ToggleRefinement.js +1 -1
- package/cjs/components/VoiceSearch/VoiceSearch.js +1 -1
- package/cjs/connectors/answers/connectAnswers.js +10 -10
- package/cjs/connectors/autocomplete/connectAutocomplete.js +11 -10
- package/cjs/connectors/breadcrumb/connectBreadcrumb.js +5 -5
- package/cjs/connectors/clear-refinements/connectClearRefinements.js +9 -9
- package/cjs/connectors/configure/connectConfigure.js +8 -8
- package/cjs/connectors/configure-related-items/connectConfigureRelatedItems.js +5 -5
- package/cjs/connectors/current-refinements/connectCurrentRefinements.js +6 -6
- package/cjs/connectors/dynamic-widgets/connectDynamicWidgets.js +35 -10
- package/cjs/connectors/geo-search/connectGeoSearch.js +11 -11
- package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +6 -6
- package/cjs/connectors/hits/connectHits.js +11 -11
- package/cjs/connectors/hits/connectHitsWithInsights.js +3 -3
- package/cjs/connectors/hits-per-page/connectHitsPerPage.js +6 -6
- package/cjs/connectors/index.js +31 -31
- package/cjs/connectors/infinite-hits/connectInfiniteHits.js +13 -13
- package/cjs/connectors/infinite-hits/connectInfiniteHitsWithInsights.js +3 -3
- package/cjs/connectors/menu/connectMenu.js +5 -5
- package/cjs/connectors/numeric-menu/connectNumericMenu.js +7 -7
- package/cjs/connectors/pagination/Paginator.js +3 -3
- package/cjs/connectors/pagination/connectPagination.js +8 -8
- package/cjs/connectors/powered-by/connectPoweredBy.js +5 -5
- package/cjs/connectors/query-rules/connectQueryRules.js +7 -7
- package/cjs/connectors/range/connectRange.js +27 -27
- package/cjs/connectors/rating-menu/connectRatingMenu.js +6 -6
- package/cjs/connectors/refinement-list/connectRefinementList.js +8 -8
- package/cjs/connectors/relevant-sort/connectRelevantSort.js +3 -3
- package/cjs/connectors/search-box/connectSearchBox.js +8 -7
- package/cjs/connectors/sort-by/connectSortBy.js +8 -7
- package/cjs/connectors/stats/connectStats.js +8 -8
- package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +12 -12
- package/cjs/connectors/voice-search/connectVoiceSearch.js +6 -6
- package/cjs/helpers/get-insights-anonymous-user-token.js +2 -2
- package/cjs/helpers/highlight.js +4 -4
- package/cjs/helpers/index.js +6 -6
- package/cjs/helpers/insights.js +4 -4
- package/cjs/helpers/reverseHighlight.js +5 -5
- package/cjs/helpers/reverseSnippet.js +5 -5
- package/cjs/helpers/snippet.js +4 -4
- package/cjs/index.js +9 -9
- package/cjs/lib/InstantSearch.js +44 -23
- package/cjs/lib/createHelpers.js +6 -6
- package/cjs/lib/infiniteHitsCache/index.js +1 -1
- package/cjs/lib/infiniteHitsCache/sessionStorage.js +4 -4
- package/cjs/lib/insights/client.js +5 -5
- package/cjs/lib/insights/index.js +2 -2
- package/cjs/lib/insights/listener.js +3 -3
- package/cjs/lib/routers/history.js +6 -6
- package/cjs/lib/routers/index.js +1 -1
- package/cjs/lib/stateMappings/index.js +2 -2
- package/cjs/lib/utils/checkIndexUiState.js +3 -3
- package/cjs/lib/utils/checkRendering.js +1 -1
- package/cjs/lib/utils/concatHighlightedParts.js +1 -1
- package/cjs/lib/utils/createSendEventForFacet.js +1 -1
- package/cjs/lib/utils/createSendEventForHits.js +1 -1
- package/cjs/lib/utils/detect-insights-client.js +1 -1
- package/cjs/lib/utils/escape-highlight.js +2 -2
- package/cjs/lib/utils/getContainerNode.js +1 -1
- package/cjs/lib/utils/getHighlightFromSiblings.js +1 -1
- package/cjs/lib/utils/getHighlightedParts.js +1 -1
- package/cjs/lib/utils/getRefinements.js +2 -2
- package/cjs/lib/utils/index.js +48 -48
- package/cjs/lib/utils/logger.js +1 -1
- package/cjs/lib/utils/mergeSearchParameters.js +2 -2
- package/cjs/lib/utils/prepareTemplateProps.js +1 -1
- package/cjs/lib/utils/reverseHighlightedParts.js +1 -1
- package/cjs/lib/version.js +1 -1
- package/cjs/middlewares/createInsightsMiddleware.js +11 -11
- package/cjs/middlewares/createMetadataMiddleware.js +2 -2
- package/cjs/middlewares/createRouterMiddleware.js +4 -4
- package/cjs/middlewares/index.js +3 -3
- package/cjs/types/index.js +14 -14
- package/cjs/widgets/analytics/analytics.js +3 -3
- package/cjs/widgets/answers/answers.js +8 -8
- package/cjs/widgets/breadcrumb/breadcrumb.js +8 -8
- package/cjs/widgets/clear-refinements/clear-refinements.js +8 -8
- package/cjs/widgets/configure/configure.js +3 -3
- package/cjs/widgets/configure-related-items/configure-related-items.js +3 -3
- package/cjs/widgets/current-refinements/current-refinements.js +6 -6
- package/cjs/widgets/dynamic-widgets/dynamic-widgets.js +14 -11
- package/cjs/widgets/geo-search/GeoSearchRenderer.js +3 -3
- package/cjs/widgets/geo-search/geo-search.js +9 -9
- package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +8 -8
- package/cjs/widgets/hits/hits.js +11 -11
- package/cjs/widgets/hits-per-page/hits-per-page.js +7 -7
- package/cjs/widgets/index/index.js +26 -8
- package/cjs/widgets/index.js +36 -36
- package/cjs/widgets/infinite-hits/infinite-hits.js +11 -11
- package/cjs/widgets/menu/menu.js +8 -8
- package/cjs/widgets/menu-select/menu-select.js +8 -8
- package/cjs/widgets/numeric-menu/numeric-menu.js +8 -8
- package/cjs/widgets/pagination/pagination.js +7 -7
- package/cjs/widgets/panel/panel.js +7 -7
- package/cjs/widgets/powered-by/powered-by.js +6 -6
- package/cjs/widgets/query-rule-context/query-rule-context.js +4 -4
- package/cjs/widgets/query-rule-custom-data/query-rule-custom-data.js +6 -6
- package/cjs/widgets/range-input/range-input.js +7 -7
- package/cjs/widgets/range-slider/range-slider.js +6 -6
- package/cjs/widgets/rating-menu/rating-menu.js +8 -8
- package/cjs/widgets/refinement-list/refinement-list.js +10 -10
- package/cjs/widgets/relevant-sort/relevant-sort.js +7 -7
- package/cjs/widgets/search-box/search-box.js +7 -7
- package/cjs/widgets/sort-by/sort-by.js +6 -6
- package/cjs/widgets/stats/defaultTemplates.js +1 -1
- package/cjs/widgets/stats/stats.js +7 -7
- package/cjs/widgets/toggle-refinement/toggle-refinement.js +8 -8
- package/cjs/widgets/voice-search/voice-search.js +7 -7
- package/dist/instantsearch.development.d.ts +23 -2
- package/dist/instantsearch.development.js +383 -376
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.development.min.d.ts +23 -2
- package/dist/instantsearch.production.d.ts +23 -2
- package/dist/instantsearch.production.min.d.ts +23 -2
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.js +1 -1
- package/es/components/Breadcrumb/Breadcrumb.js +1 -1
- package/es/components/ClearRefinements/ClearRefinements.js +1 -1
- package/es/components/CurrentRefinements/CurrentRefinements.js +1 -1
- package/es/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/es/components/Hits/Hits.js +1 -1
- package/es/components/InfiniteHits/InfiniteHits.js +1 -1
- package/es/components/MenuSelect/MenuSelect.js +2 -2
- package/es/components/Pagination/Pagination.d.ts +4 -11
- package/es/components/Pagination/Pagination.js +72 -162
- package/es/components/Pagination/PaginationLink.d.ts +10 -11
- package/es/components/Pagination/PaginationLink.js +23 -13
- package/es/components/Panel/Panel.js +1 -1
- package/es/components/QueryRuleCustomData/QueryRuleCustomData.js +1 -1
- package/es/components/RangeInput/RangeInput.js +1 -1
- package/es/components/RefinementList/RefinementList.js +4 -4
- package/es/components/RefinementList/RefinementListItem.js +1 -1
- package/es/components/RelevantSort/RelevantSort.js +1 -1
- package/es/components/SearchBox/SearchBox.js +5 -6
- package/es/components/Slider/Slider.js +3 -3
- package/es/components/Stats/Stats.js +1 -1
- package/es/components/Template/Template.js +1 -1
- package/es/components/ToggleRefinement/ToggleRefinement.js +1 -1
- package/es/components/VoiceSearch/VoiceSearch.js +1 -1
- package/es/connectors/answers/connectAnswers.js +1 -1
- package/es/connectors/autocomplete/connectAutocomplete.js +3 -2
- package/es/connectors/breadcrumb/connectBreadcrumb.js +1 -1
- package/es/connectors/clear-refinements/connectClearRefinements.js +1 -1
- package/es/connectors/configure/connectConfigure.js +1 -1
- package/es/connectors/configure-related-items/connectConfigureRelatedItems.js +2 -2
- package/es/connectors/current-refinements/connectCurrentRefinements.js +1 -1
- package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +14 -0
- package/es/connectors/dynamic-widgets/connectDynamicWidgets.js +31 -6
- package/es/connectors/geo-search/connectGeoSearch.js +1 -1
- package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +1 -1
- package/es/connectors/hits/connectHits.js +1 -1
- package/es/connectors/hits/connectHitsWithInsights.js +2 -2
- package/es/connectors/hits-per-page/connectHitsPerPage.js +1 -1
- package/es/connectors/index.js +30 -30
- package/es/connectors/infinite-hits/connectInfiniteHits.js +2 -2
- package/es/connectors/infinite-hits/connectInfiniteHitsWithInsights.js +2 -2
- package/es/connectors/menu/connectMenu.js +1 -1
- package/es/connectors/numeric-menu/connectNumericMenu.js +1 -1
- package/es/connectors/pagination/Paginator.js +1 -1
- package/es/connectors/pagination/connectPagination.js +5 -5
- package/es/connectors/powered-by/connectPoweredBy.js +1 -1
- package/es/connectors/query-rules/connectQueryRules.js +1 -1
- package/es/connectors/range/connectRange.js +1 -1
- package/es/connectors/rating-menu/connectRatingMenu.js +1 -1
- package/es/connectors/refinement-list/connectRefinementList.js +1 -1
- package/es/connectors/relevant-sort/connectRelevantSort.js +1 -1
- package/es/connectors/search-box/connectSearchBox.js +5 -4
- package/es/connectors/sort-by/connectSortBy.js +3 -2
- package/es/connectors/stats/connectStats.js +5 -5
- package/es/connectors/toggle-refinement/connectToggleRefinement.js +2 -2
- package/es/connectors/voice-search/connectVoiceSearch.js +2 -2
- package/es/helpers/get-insights-anonymous-user-token.js +1 -1
- package/es/helpers/highlight.js +2 -2
- package/es/helpers/index.js +10 -10
- package/es/helpers/insights.js +1 -1
- package/es/helpers/reverseHighlight.js +2 -2
- package/es/helpers/reverseSnippet.js +2 -2
- package/es/helpers/snippet.js +2 -2
- package/es/index.js +6 -6
- package/es/lib/InstantSearch.d.ts +3 -3
- package/es/lib/InstantSearch.js +29 -8
- package/es/lib/createHelpers.js +1 -1
- package/es/lib/infiniteHitsCache/index.js +1 -1
- package/es/lib/infiniteHitsCache/sessionStorage.js +1 -1
- package/es/lib/insights/client.js +1 -1
- package/es/lib/insights/index.js +2 -2
- package/es/lib/insights/listener.js +2 -2
- package/es/lib/routers/history.js +1 -1
- package/es/lib/routers/index.js +1 -1
- package/es/lib/stateMappings/index.js +2 -2
- package/es/lib/utils/checkIndexUiState.js +3 -3
- package/es/lib/utils/checkRendering.js +1 -1
- package/es/lib/utils/concatHighlightedParts.js +1 -1
- package/es/lib/utils/createSendEventForFacet.js +1 -1
- package/es/lib/utils/createSendEventForHits.js +1 -1
- package/es/lib/utils/detect-insights-client.js +1 -1
- package/es/lib/utils/escape-highlight.js +2 -2
- package/es/lib/utils/getContainerNode.js +1 -1
- package/es/lib/utils/getHighlightFromSiblings.js +1 -1
- package/es/lib/utils/getHighlightedParts.js +1 -1
- package/es/lib/utils/getRefinements.js +2 -2
- package/es/lib/utils/index.js +48 -48
- package/es/lib/utils/logger.js +1 -1
- package/es/lib/utils/mergeSearchParameters.js +2 -2
- package/es/lib/utils/prepareTemplateProps.js +1 -1
- package/es/lib/utils/reverseHighlightedParts.js +1 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/middlewares/createInsightsMiddleware.js +3 -3
- package/es/middlewares/createMetadataMiddleware.js +1 -1
- package/es/middlewares/createRouterMiddleware.js +3 -3
- package/es/middlewares/index.js +3 -3
- package/es/package.json +1 -0
- package/es/types/index.js +14 -14
- package/es/types/results.d.ts +7 -0
- package/es/widgets/analytics/analytics.js +1 -1
- package/es/widgets/answers/answers.js +5 -5
- package/es/widgets/breadcrumb/breadcrumb.js +5 -5
- package/es/widgets/clear-refinements/clear-refinements.js +5 -5
- package/es/widgets/configure/configure.js +2 -2
- package/es/widgets/configure-related-items/configure-related-items.js +2 -2
- package/es/widgets/current-refinements/current-refinements.js +4 -4
- package/es/widgets/dynamic-widgets/dynamic-widgets.js +11 -8
- package/es/widgets/geo-search/GeoSearchRenderer.js +2 -2
- package/es/widgets/geo-search/geo-search.js +6 -6
- package/es/widgets/hierarchical-menu/hierarchical-menu.js +5 -5
- package/es/widgets/hits/hits.js +6 -6
- package/es/widgets/hits-per-page/hits-per-page.js +4 -4
- package/es/widgets/index/index.js +21 -3
- package/es/widgets/index.js +34 -34
- package/es/widgets/infinite-hits/infinite-hits.js +6 -6
- package/es/widgets/menu/menu.js +5 -5
- package/es/widgets/menu-select/menu-select.js +5 -5
- package/es/widgets/numeric-menu/numeric-menu.js +5 -5
- package/es/widgets/pagination/pagination.js +4 -4
- package/es/widgets/panel/panel.js +3 -3
- package/es/widgets/powered-by/powered-by.js +4 -4
- package/es/widgets/query-rule-context/query-rule-context.js +2 -2
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +4 -4
- package/es/widgets/range-input/range-input.js +4 -4
- package/es/widgets/range-slider/range-slider.js +4 -4
- package/es/widgets/rating-menu/rating-menu.js +5 -5
- package/es/widgets/refinement-list/refinement-list.js +6 -6
- package/es/widgets/relevant-sort/relevant-sort.js +5 -5
- package/es/widgets/search-box/search-box.js +5 -5
- package/es/widgets/sort-by/sort-by.js +4 -4
- package/es/widgets/stats/defaultTemplates.js +1 -1
- package/es/widgets/stats/stats.js +4 -4
- package/es/widgets/toggle-refinement/toggle-refinement.js +5 -5
- package/es/widgets/voice-search/voice-search.js +5 -5
- package/package.json +10 -6
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
2
|
|
|
4
3
|
import type algoliasearch from 'algoliasearch/lite';
|
|
5
4
|
import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
|
|
6
5
|
import type * as ClientSearch from '@algolia/client-search';
|
|
7
|
-
import EventEmitter from 'events';
|
|
6
|
+
import EventEmitter from '@algolia/events';
|
|
8
7
|
import type { InsightsClient as InsightsClient_2 } from 'search-insights';
|
|
9
8
|
import type { InsightsMethodMap } from 'search-insights';
|
|
10
9
|
import type * as Places from 'places.js';
|
|
@@ -1102,6 +1101,20 @@ declare type DynamicWidgetsConnectorParams = {
|
|
|
1102
1101
|
transformItems?(items: string[], metadata: {
|
|
1103
1102
|
results: SearchResults;
|
|
1104
1103
|
}): string[];
|
|
1104
|
+
/**
|
|
1105
|
+
* To prevent unneeded extra network requests when widgets mount or unmount,
|
|
1106
|
+
* we request all facet values.
|
|
1107
|
+
*
|
|
1108
|
+
* @default ['*']
|
|
1109
|
+
*/
|
|
1110
|
+
facets?: ['*'] | never[];
|
|
1111
|
+
/**
|
|
1112
|
+
* If you have more than 20 facet values pinned, you need to increase the
|
|
1113
|
+
* maxValuesPerFacet to at least that value.
|
|
1114
|
+
*
|
|
1115
|
+
* @default 20
|
|
1116
|
+
*/
|
|
1117
|
+
maxValuesPerFacet?: number;
|
|
1105
1118
|
};
|
|
1106
1119
|
|
|
1107
1120
|
declare type DynamicWidgetsRenderState = {
|
|
@@ -2194,6 +2207,13 @@ declare type InfiniteHitsWidgetParams = {
|
|
|
2194
2207
|
cache?: InfiniteHitsCache;
|
|
2195
2208
|
};
|
|
2196
2209
|
|
|
2210
|
+
declare type InitialResult = {
|
|
2211
|
+
state: PlainSearchParameters;
|
|
2212
|
+
results: SearchResults['_rawResults'];
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
declare type InitialResults = Record<string, InitialResult>;
|
|
2216
|
+
|
|
2197
2217
|
declare type InitOptions = SharedRenderOptions & {
|
|
2198
2218
|
uiState: UiState;
|
|
2199
2219
|
results?: undefined;
|
|
@@ -2258,6 +2278,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2258
2278
|
_searchStalledTimer: any;
|
|
2259
2279
|
_isSearchStalled: boolean;
|
|
2260
2280
|
_initialUiState: UiState;
|
|
2281
|
+
_initialResults: InitialResults | null;
|
|
2261
2282
|
_createURL: CreateURL<UiState>;
|
|
2262
2283
|
_searchFunction?: InstantSearchOptions['searchFunction'];
|
|
2263
2284
|
_mainHelperSearch?: AlgoliaSearchHelper['search'];
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
2
|
|
|
4
3
|
import type algoliasearch from 'algoliasearch/lite';
|
|
5
4
|
import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
|
|
6
5
|
import type * as ClientSearch from '@algolia/client-search';
|
|
7
|
-
import EventEmitter from 'events';
|
|
6
|
+
import EventEmitter from '@algolia/events';
|
|
8
7
|
import type { InsightsClient as InsightsClient_2 } from 'search-insights';
|
|
9
8
|
import type { InsightsMethodMap } from 'search-insights';
|
|
10
9
|
import type * as Places from 'places.js';
|
|
@@ -1102,6 +1101,20 @@ declare type DynamicWidgetsConnectorParams = {
|
|
|
1102
1101
|
transformItems?(items: string[], metadata: {
|
|
1103
1102
|
results: SearchResults;
|
|
1104
1103
|
}): string[];
|
|
1104
|
+
/**
|
|
1105
|
+
* To prevent unneeded extra network requests when widgets mount or unmount,
|
|
1106
|
+
* we request all facet values.
|
|
1107
|
+
*
|
|
1108
|
+
* @default ['*']
|
|
1109
|
+
*/
|
|
1110
|
+
facets?: ['*'] | never[];
|
|
1111
|
+
/**
|
|
1112
|
+
* If you have more than 20 facet values pinned, you need to increase the
|
|
1113
|
+
* maxValuesPerFacet to at least that value.
|
|
1114
|
+
*
|
|
1115
|
+
* @default 20
|
|
1116
|
+
*/
|
|
1117
|
+
maxValuesPerFacet?: number;
|
|
1105
1118
|
};
|
|
1106
1119
|
|
|
1107
1120
|
declare type DynamicWidgetsRenderState = {
|
|
@@ -2194,6 +2207,13 @@ declare type InfiniteHitsWidgetParams = {
|
|
|
2194
2207
|
cache?: InfiniteHitsCache;
|
|
2195
2208
|
};
|
|
2196
2209
|
|
|
2210
|
+
declare type InitialResult = {
|
|
2211
|
+
state: PlainSearchParameters;
|
|
2212
|
+
results: SearchResults['_rawResults'];
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
declare type InitialResults = Record<string, InitialResult>;
|
|
2216
|
+
|
|
2197
2217
|
declare type InitOptions = SharedRenderOptions & {
|
|
2198
2218
|
uiState: UiState;
|
|
2199
2219
|
results?: undefined;
|
|
@@ -2258,6 +2278,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2258
2278
|
_searchStalledTimer: any;
|
|
2259
2279
|
_isSearchStalled: boolean;
|
|
2260
2280
|
_initialUiState: UiState;
|
|
2281
|
+
_initialResults: InitialResults | null;
|
|
2261
2282
|
_createURL: CreateURL<UiState>;
|
|
2262
2283
|
_searchFunction?: InstantSearchOptions['searchFunction'];
|
|
2263
2284
|
_mainHelperSearch?: AlgoliaSearchHelper['search'];
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
2
|
|
|
4
3
|
import type algoliasearch from 'algoliasearch/lite';
|
|
5
4
|
import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
|
|
6
5
|
import type * as ClientSearch from '@algolia/client-search';
|
|
7
|
-
import EventEmitter from 'events';
|
|
6
|
+
import EventEmitter from '@algolia/events';
|
|
8
7
|
import type { InsightsClient as InsightsClient_2 } from 'search-insights';
|
|
9
8
|
import type { InsightsMethodMap } from 'search-insights';
|
|
10
9
|
import type * as Places from 'places.js';
|
|
@@ -1102,6 +1101,20 @@ declare type DynamicWidgetsConnectorParams = {
|
|
|
1102
1101
|
transformItems?(items: string[], metadata: {
|
|
1103
1102
|
results: SearchResults;
|
|
1104
1103
|
}): string[];
|
|
1104
|
+
/**
|
|
1105
|
+
* To prevent unneeded extra network requests when widgets mount or unmount,
|
|
1106
|
+
* we request all facet values.
|
|
1107
|
+
*
|
|
1108
|
+
* @default ['*']
|
|
1109
|
+
*/
|
|
1110
|
+
facets?: ['*'] | never[];
|
|
1111
|
+
/**
|
|
1112
|
+
* If you have more than 20 facet values pinned, you need to increase the
|
|
1113
|
+
* maxValuesPerFacet to at least that value.
|
|
1114
|
+
*
|
|
1115
|
+
* @default 20
|
|
1116
|
+
*/
|
|
1117
|
+
maxValuesPerFacet?: number;
|
|
1105
1118
|
};
|
|
1106
1119
|
|
|
1107
1120
|
declare type DynamicWidgetsRenderState = {
|
|
@@ -2194,6 +2207,13 @@ declare type InfiniteHitsWidgetParams = {
|
|
|
2194
2207
|
cache?: InfiniteHitsCache;
|
|
2195
2208
|
};
|
|
2196
2209
|
|
|
2210
|
+
declare type InitialResult = {
|
|
2211
|
+
state: PlainSearchParameters;
|
|
2212
|
+
results: SearchResults['_rawResults'];
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
declare type InitialResults = Record<string, InitialResult>;
|
|
2216
|
+
|
|
2197
2217
|
declare type InitOptions = SharedRenderOptions & {
|
|
2198
2218
|
uiState: UiState;
|
|
2199
2219
|
results?: undefined;
|
|
@@ -2258,6 +2278,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2258
2278
|
_searchStalledTimer: any;
|
|
2259
2279
|
_isSearchStalled: boolean;
|
|
2260
2280
|
_initialUiState: UiState;
|
|
2281
|
+
_initialResults: InitialResults | null;
|
|
2261
2282
|
_createURL: CreateURL<UiState>;
|
|
2262
2283
|
_searchFunction?: InstantSearchOptions['searchFunction'];
|
|
2263
2284
|
_mainHelperSearch?: AlgoliaSearchHelper['search'];
|