instantsearch.js 4.49.4 → 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.
- package/cjs/components/Pagination/Pagination.js +1 -1
- package/cjs/connectors/hits/connectHits.js +2 -1
- package/cjs/connectors/infinite-hits/connectInfiniteHits.js +3 -2
- package/cjs/lib/InstantSearch.js +3 -7
- package/cjs/lib/templating/prepareTemplateProps.js +1 -2
- package/cjs/lib/templating/renderTemplate.js +3 -0
- package/cjs/lib/utils/createSendEventForHits.js +6 -5
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/hits/hits.js +3 -4
- package/cjs/widgets/index/index.js +18 -1
- package/cjs/widgets/infinite-hits/infinite-hits.js +3 -4
- package/dist/instantsearch.development.d.ts +11 -3
- package/dist/instantsearch.development.js +89 -37
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +11 -3
- package/dist/instantsearch.production.min.d.ts +11 -3
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.d.ts +3 -3
- package/es/components/Breadcrumb/Breadcrumb.d.ts +3 -3
- package/es/components/ClearRefinements/ClearRefinements.d.ts +3 -3
- package/es/components/CurrentRefinements/CurrentRefinements.d.ts +2 -2
- package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
- package/es/components/GeoSearchControls/GeoSearchControls.d.ts +1 -1
- package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
- package/es/components/Highlight/Highlight.d.ts +2 -2
- package/es/components/Hits/Hits.d.ts +3 -3
- package/es/components/InfiniteHits/InfiniteHits.d.ts +3 -3
- package/es/components/MenuSelect/MenuSelect.d.ts +4 -4
- package/es/components/Pagination/Pagination.d.ts +3 -3
- package/es/components/Pagination/Pagination.js +1 -1
- package/es/components/Panel/Panel.d.ts +3 -3
- package/es/components/PoweredBy/PoweredBy.d.ts +2 -2
- package/es/components/QueryRuleCustomData/QueryRuleCustomData.d.ts +3 -3
- package/es/components/RangeInput/RangeInput.d.ts +3 -3
- package/es/components/RefinementList/RefinementList.d.ts +7 -7
- package/es/components/RefinementList/RefinementListItem.d.ts +1 -1
- package/es/components/RelevantSort/RelevantSort.d.ts +3 -3
- package/es/components/ReverseHighlight/ReverseHighlight.d.ts +2 -2
- package/es/components/ReverseSnippet/ReverseSnippet.d.ts +2 -2
- package/es/components/SearchBox/SearchBox.d.ts +5 -5
- package/es/components/Selector/Selector.d.ts +3 -3
- package/es/components/Slider/Rheostat.d.ts +6 -6
- package/es/components/Slider/Slider.d.ts +2 -2
- package/es/components/Snippet/Snippet.d.ts +2 -2
- package/es/components/Stats/Stats.d.ts +3 -3
- package/es/components/Template/Template.d.ts +1 -1
- package/es/components/ToggleRefinement/ToggleRefinement.d.ts +3 -3
- package/es/components/VoiceSearch/VoiceSearch.d.ts +3 -3
- package/es/connectors/answers/connectAnswers.d.ts +4 -4
- package/es/connectors/autocomplete/connectAutocomplete.d.ts +4 -4
- package/es/connectors/breadcrumb/connectBreadcrumb.d.ts +5 -5
- package/es/connectors/clear-refinements/connectClearRefinements.d.ts +4 -4
- package/es/connectors/configure/connectConfigure.d.ts +5 -5
- package/es/connectors/configure-related-items/connectConfigureRelatedItems.d.ts +5 -5
- package/es/connectors/current-refinements/connectCurrentRefinements.d.ts +6 -6
- package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +4 -4
- package/es/connectors/geo-search/connectGeoSearch.d.ts +6 -6
- package/es/connectors/hierarchical-menu/connectHierarchicalMenu.d.ts +5 -5
- package/es/connectors/hits/connectHits.d.ts +4 -4
- package/es/connectors/hits/connectHits.js +2 -1
- package/es/connectors/hits-per-page/connectHitsPerPage.d.ts +6 -6
- package/es/connectors/infinite-hits/connectInfiniteHits.d.ts +8 -8
- package/es/connectors/infinite-hits/connectInfiniteHits.js +3 -2
- package/es/connectors/menu/connectMenu.d.ts +5 -5
- package/es/connectors/numeric-menu/connectNumericMenu.d.ts +6 -6
- package/es/connectors/pagination/connectPagination.d.ts +4 -4
- package/es/connectors/powered-by/connectPoweredBy.d.ts +4 -4
- package/es/connectors/query-rules/connectQueryRules.d.ts +7 -7
- package/es/connectors/range/connectRange.d.ts +8 -8
- package/es/connectors/rating-menu/connectRatingMenu.d.ts +6 -6
- package/es/connectors/refinement-list/connectRefinementList.d.ts +5 -5
- package/es/connectors/relevant-sort/connectRelevantSort.d.ts +5 -5
- package/es/connectors/search-box/connectSearchBox.d.ts +4 -4
- package/es/connectors/sort-by/connectSortBy.d.ts +5 -5
- package/es/connectors/stats/connectStats.d.ts +4 -4
- package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +9 -9
- package/es/connectors/toggle-refinement/types.d.ts +5 -5
- package/es/connectors/voice-search/connectVoiceSearch.d.ts +4 -4
- package/es/helpers/components/Highlight.d.ts +1 -1
- package/es/helpers/components/ReverseHighlight.d.ts +1 -1
- package/es/helpers/components/ReverseSnippet.d.ts +1 -1
- package/es/helpers/components/Snippet.d.ts +1 -1
- package/es/helpers/highlight.d.ts +1 -1
- package/es/helpers/reverseHighlight.d.ts +1 -1
- package/es/helpers/reverseSnippet.d.ts +1 -1
- package/es/helpers/snippet.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/lib/InstantSearch.d.ts +3 -3
- package/es/lib/InstantSearch.js +3 -7
- package/es/lib/createHelpers.d.ts +1 -1
- package/es/lib/insights/listener.d.ts +1 -1
- package/es/lib/routers/history.d.ts +3 -3
- package/es/lib/suit.d.ts +2 -2
- package/es/lib/templating/prepareTemplateProps.d.ts +2 -2
- package/es/lib/templating/prepareTemplateProps.js +1 -2
- package/es/lib/templating/renderTemplate.js +3 -0
- package/es/lib/utils/checkIndexUiState.d.ts +1 -1
- package/es/lib/utils/createConcurrentSafePromise.d.ts +2 -2
- package/es/lib/utils/createSendEventForFacet.d.ts +4 -4
- package/es/lib/utils/createSendEventForHits.d.ts +8 -7
- package/es/lib/utils/createSendEventForHits.js +6 -5
- package/es/lib/utils/debounce.d.ts +2 -2
- package/es/lib/utils/defer.d.ts +2 -2
- package/es/lib/utils/documentation.d.ts +2 -2
- package/es/lib/utils/escapeFacetValue.d.ts +1 -1
- package/es/lib/utils/geo-search.d.ts +1 -1
- package/es/lib/utils/getRefinements.d.ts +6 -6
- package/es/lib/utils/logger.d.ts +2 -2
- package/es/lib/utils/range.d.ts +1 -1
- package/es/lib/utils/safelyRunOnBrowser.d.ts +2 -2
- package/es/lib/utils/toArray.d.ts +1 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/lib/voiceSearchHelper/types.d.ts +5 -5
- package/es/middlewares/createInsightsMiddleware.d.ts +3 -3
- package/es/middlewares/createRouterMiddleware.d.ts +1 -1
- package/es/types/component.d.ts +1 -1
- package/es/types/connector.d.ts +4 -4
- package/es/types/insights.d.ts +5 -5
- package/es/types/middleware.d.ts +4 -4
- package/es/types/render-state.d.ts +5 -5
- package/es/types/results.d.ts +16 -16
- package/es/types/router.d.ts +2 -2
- package/es/types/templates.d.ts +14 -6
- package/es/types/ui-state.d.ts +4 -4
- package/es/types/utils.d.ts +6 -6
- package/es/types/widget-factory.d.ts +2 -2
- package/es/types/widget.d.ts +23 -23
- package/es/widgets/analytics/analytics.d.ts +4 -4
- package/es/widgets/answers/answers.d.ts +4 -4
- package/es/widgets/breadcrumb/breadcrumb.d.ts +4 -4
- package/es/widgets/clear-refinements/clear-refinements.d.ts +4 -4
- package/es/widgets/configure/configure.d.ts +2 -2
- package/es/widgets/configure-related-items/configure-related-items.d.ts +2 -2
- package/es/widgets/current-refinements/current-refinements.d.ts +3 -3
- package/es/widgets/dynamic-widgets/dynamic-widgets.d.ts +2 -2
- package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -1
- package/es/widgets/geo-search/geo-search.d.ts +7 -7
- package/es/widgets/hierarchical-menu/hierarchical-menu.d.ts +6 -6
- package/es/widgets/hits/hits.d.ts +4 -4
- package/es/widgets/hits/hits.js +3 -4
- package/es/widgets/hits-per-page/hits-per-page.d.ts +3 -3
- package/es/widgets/index/index.d.ts +5 -5
- package/es/widgets/index/index.js +18 -1
- package/es/widgets/infinite-hits/infinite-hits.d.ts +4 -4
- package/es/widgets/infinite-hits/infinite-hits.js +3 -4
- package/es/widgets/menu/menu.d.ts +6 -6
- package/es/widgets/menu-select/menu-select.d.ts +4 -4
- package/es/widgets/numeric-menu/numeric-menu.d.ts +6 -6
- package/es/widgets/pagination/pagination.d.ts +4 -4
- package/es/widgets/panel/panel.d.ts +9 -9
- package/es/widgets/places/places.d.ts +6 -6
- package/es/widgets/powered-by/powered-by.d.ts +3 -3
- package/es/widgets/query-rule-context/query-rule-context.d.ts +2 -2
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.d.ts +4 -4
- package/es/widgets/range-input/range-input.d.ts +4 -4
- package/es/widgets/range-slider/range-slider.d.ts +4 -4
- package/es/widgets/rating-menu/rating-menu.d.ts +6 -6
- package/es/widgets/refinement-list/refinement-list.d.ts +10 -10
- package/es/widgets/relevant-sort/relevant-sort.d.ts +4 -4
- package/es/widgets/search-box/search-box.d.ts +4 -4
- package/es/widgets/sort-by/sort-by.d.ts +4 -4
- package/es/widgets/stats/stats.d.ts +5 -5
- package/es/widgets/toggle-refinement/toggle-refinement.d.ts +4 -4
- package/es/widgets/voice-search/voice-search.d.ts +5 -5
- package/package.json +7 -5
package/es/types/widget.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import type { InstantSearch } from './instantsearch';
|
|
|
4
4
|
import type { IndexUiState, UiState } from './ui-state';
|
|
5
5
|
import type { IndexRenderState, WidgetRenderState } from './render-state';
|
|
6
6
|
import type { Expand, RequiredKeys } from './utils';
|
|
7
|
-
export
|
|
7
|
+
export type ScopedResult = {
|
|
8
8
|
indexId: string;
|
|
9
9
|
results: SearchResults;
|
|
10
10
|
helper: Helper;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type SharedRenderOptions = {
|
|
13
13
|
instantSearchInstance: InstantSearch;
|
|
14
14
|
parent: IndexWidget;
|
|
15
15
|
templatesConfig: Record<string, unknown>;
|
|
@@ -26,32 +26,32 @@ declare type SharedRenderOptions = {
|
|
|
26
26
|
error: InstantSearch['error'];
|
|
27
27
|
createURL(state: SearchParameters): string;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type InitOptions = SharedRenderOptions & {
|
|
30
30
|
uiState: UiState;
|
|
31
31
|
results?: undefined;
|
|
32
32
|
};
|
|
33
|
-
export
|
|
33
|
+
export type RenderOptions = SharedRenderOptions & {
|
|
34
34
|
results: SearchResults;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type DisposeOptions = {
|
|
37
37
|
helper: Helper;
|
|
38
38
|
state: SearchParameters;
|
|
39
39
|
parent: IndexWidget;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
41
|
+
export type BuiltinTypes = 'ais.analytics' | 'ais.answers' | 'ais.autocomplete' | 'ais.breadcrumb' | 'ais.clearRefinements' | 'ais.configure' | 'ais.configureRelatedItems' | 'ais.currentRefinements' | 'ais.dynamicWidgets' | 'ais.geoSearch' | 'ais.hierarchicalMenu' | 'ais.hits' | 'ais.hitsPerPage' | 'ais.index' | 'ais.infiniteHits' | 'ais.menu' | 'ais.numericMenu' | 'ais.pagination' | 'ais.places' | 'ais.poweredBy' | 'ais.queryRules' | 'ais.range' | 'ais.rangeSlider' | 'ais.rangeInput' | 'ais.ratingMenu' | 'ais.refinementList' | 'ais.searchBox' | 'ais.relevantSort' | 'ais.sortBy' | 'ais.stats' | 'ais.toggleRefinement' | 'ais.voiceSearch';
|
|
42
|
+
export type BuiltinWidgetTypes = 'ais.analytics' | 'ais.answers' | 'ais.autocomplete' | 'ais.breadcrumb' | 'ais.clearRefinements' | 'ais.configure' | 'ais.configureRelatedItems' | 'ais.currentRefinements' | 'ais.dynamicWidgets' | 'ais.geoSearch' | 'ais.hierarchicalMenu' | 'ais.hits' | 'ais.hitsPerPage' | 'ais.index' | 'ais.infiniteHits' | 'ais.menu' | 'ais.menuSelect' | 'ais.numericMenu' | 'ais.pagination' | 'ais.places' | 'ais.poweredBy' | 'ais.queryRuleCustomData' | 'ais.queryRuleContext' | 'ais.rangeInput' | 'ais.rangeSlider' | 'ais.ratingMenu' | 'ais.refinementList' | 'ais.searchBox' | 'ais.relevantSort' | 'ais.sortBy' | 'ais.stats' | 'ais.toggleRefinement' | 'ais.voiceSearch';
|
|
43
|
+
export type UnknownWidgetParams = NonNullable<object>;
|
|
44
|
+
export type WidgetParams = {
|
|
45
45
|
widgetParams?: UnknownWidgetParams;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type WidgetDescription = {
|
|
48
48
|
$$type: string;
|
|
49
49
|
$$widgetType?: string;
|
|
50
50
|
renderState?: Record<string, unknown>;
|
|
51
51
|
indexRenderState?: Record<string, unknown>;
|
|
52
52
|
indexUiState?: Record<string, unknown>;
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
type RequiredWidgetLifeCycle<TWidgetDescription extends WidgetDescription> = {
|
|
55
55
|
/**
|
|
56
56
|
* Identifier for connectors and widgets.
|
|
57
57
|
*/
|
|
@@ -70,19 +70,19 @@ declare type RequiredWidgetLifeCycle<TWidgetDescription extends WidgetDescriptio
|
|
|
70
70
|
*/
|
|
71
71
|
dispose?: (options: DisposeOptions) => SearchParameters | void;
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
type RequiredWidgetType<TWidgetDescription extends WidgetDescription> = {
|
|
74
74
|
/**
|
|
75
75
|
* Identifier for widgets.
|
|
76
76
|
*/
|
|
77
77
|
$$widgetType: TWidgetDescription['$$widgetType'];
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
type WidgetType<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, '$$widgetType'> ? RequiredWidgetType<TWidgetDescription> : {
|
|
80
80
|
/**
|
|
81
81
|
* Identifier for widgets.
|
|
82
82
|
*/
|
|
83
83
|
$$widgetType?: string;
|
|
84
84
|
};
|
|
85
|
-
|
|
85
|
+
type RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescription> = {
|
|
86
86
|
/**
|
|
87
87
|
* This function is required for a widget to be taken in account for routing.
|
|
88
88
|
* It will derive a uiState for this widget based on the existing uiState and
|
|
@@ -117,8 +117,8 @@ declare type RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescripti
|
|
|
117
117
|
uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;
|
|
118
118
|
}) => SearchParameters;
|
|
119
119
|
};
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
type UiStateLifeCycle<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'indexUiState'> ? RequiredUiStateLifeCycle<TWidgetDescription> : Partial<RequiredUiStateLifeCycle<TWidgetDescription>>;
|
|
121
|
+
type RequiredRenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = {
|
|
122
122
|
/**
|
|
123
123
|
* Returns the render state of the current widget to pass to the render function.
|
|
124
124
|
*/
|
|
@@ -129,24 +129,24 @@ declare type RequiredRenderStateLifeCycle<TWidgetDescription extends WidgetDescr
|
|
|
129
129
|
*/
|
|
130
130
|
getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];
|
|
131
131
|
};
|
|
132
|
-
|
|
133
|
-
export
|
|
132
|
+
type RenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'renderState' | 'indexRenderState'> & WidgetParams ? RequiredRenderStateLifeCycle<TWidgetDescription> : Partial<RequiredRenderStateLifeCycle<TWidgetDescription>>;
|
|
133
|
+
export type Widget<TWidgetDescription extends WidgetDescription & WidgetParams = {
|
|
134
134
|
$$type: string;
|
|
135
135
|
}> = Expand<RequiredWidgetLifeCycle<TWidgetDescription> & WidgetType<TWidgetDescription> & UiStateLifeCycle<TWidgetDescription> & RenderStateLifeCycle<TWidgetDescription>>;
|
|
136
|
-
export
|
|
136
|
+
export type TransformItemsMetadata = {
|
|
137
137
|
results?: SearchResults;
|
|
138
138
|
};
|
|
139
139
|
/**
|
|
140
140
|
* Transforms the given items.
|
|
141
141
|
*/
|
|
142
|
-
export
|
|
143
|
-
|
|
142
|
+
export type TransformItems<TItem, TMetadata = TransformItemsMetadata> = (items: TItem[], metadata: TMetadata) => TItem[];
|
|
143
|
+
type SortByDirection<TCriterion extends string> = TCriterion | `${TCriterion}:asc` | `${TCriterion}:desc`;
|
|
144
144
|
/**
|
|
145
145
|
* Transforms the given items.
|
|
146
146
|
*/
|
|
147
|
-
export
|
|
147
|
+
export type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<SortByDirection<'count' | 'name' | 'isRefined'>>;
|
|
148
148
|
/**
|
|
149
149
|
* Creates the URL for the given value.
|
|
150
150
|
*/
|
|
151
|
-
export
|
|
151
|
+
export type CreateURL<TValue> = (value: TValue) => string;
|
|
152
152
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SearchParameters, SearchResults } from 'algoliasearch-helper';
|
|
2
2
|
import type { WidgetFactory, WidgetRenderState } from '../../types';
|
|
3
|
-
export
|
|
3
|
+
export type AnalyticsWidgetParamsPushFunction = (
|
|
4
4
|
/**
|
|
5
5
|
* Contains the search parameters, serialized as a query string.
|
|
6
6
|
*/
|
|
@@ -13,7 +13,7 @@ state: SearchParameters,
|
|
|
13
13
|
* The last received results.
|
|
14
14
|
*/
|
|
15
15
|
results: SearchResults) => void;
|
|
16
|
-
export
|
|
16
|
+
export type AnalyticsWidgetParams = {
|
|
17
17
|
/**
|
|
18
18
|
* A function that is called every time the query or refinements changes. You
|
|
19
19
|
* need to add the logic to push the data to your analytics platform.
|
|
@@ -48,7 +48,7 @@ export declare type AnalyticsWidgetParams = {
|
|
|
48
48
|
*/
|
|
49
49
|
pushPagination?: boolean;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export type AnalyticsWidgetDescription = {
|
|
52
52
|
$$type: 'ais.analytics';
|
|
53
53
|
$$widgetType: 'ais.analytics';
|
|
54
54
|
renderState: Record<string, unknown>;
|
|
@@ -56,6 +56,6 @@ export declare type AnalyticsWidgetDescription = {
|
|
|
56
56
|
analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
-
export
|
|
59
|
+
export type AnalyticsWidget = WidgetFactory<AnalyticsWidgetDescription, AnalyticsWidgetParams, AnalyticsWidgetParams>;
|
|
60
60
|
declare const analytics: AnalyticsWidget;
|
|
61
61
|
export default analytics;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import type { WidgetFactory, Template, Hit } from '../../types';
|
|
3
3
|
import type { AnswersConnectorParams, AnswersWidgetDescription } from '../../connectors/answers/connectAnswers';
|
|
4
|
-
export
|
|
4
|
+
export type AnswersTemplates = Partial<{
|
|
5
5
|
/**
|
|
6
6
|
* Template to use for the header. This template will receive an object containing `hits` and `isLoading`.
|
|
7
7
|
*/
|
|
@@ -18,7 +18,7 @@ export declare type AnswersTemplates = Partial<{
|
|
|
18
18
|
*/
|
|
19
19
|
item: Template<Hit>;
|
|
20
20
|
}>;
|
|
21
|
-
export
|
|
21
|
+
export type AnswersCSSClasses = Partial<{
|
|
22
22
|
/**
|
|
23
23
|
* CSS class to add to the root element of the widget.
|
|
24
24
|
*/
|
|
@@ -44,7 +44,7 @@ export declare type AnswersCSSClasses = Partial<{
|
|
|
44
44
|
*/
|
|
45
45
|
item: string | string[];
|
|
46
46
|
}>;
|
|
47
|
-
export
|
|
47
|
+
export type AnswersWidgetParams = {
|
|
48
48
|
/**
|
|
49
49
|
* CSS Selector or HTMLElement to insert the widget.
|
|
50
50
|
*/
|
|
@@ -58,7 +58,7 @@ export declare type AnswersWidgetParams = {
|
|
|
58
58
|
*/
|
|
59
59
|
cssClasses?: AnswersCSSClasses;
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type AnswersWidget = WidgetFactory<AnswersWidgetDescription & {
|
|
62
62
|
$$widgetType: 'ais.answers';
|
|
63
63
|
}, AnswersConnectorParams, AnswersWidgetParams>;
|
|
64
64
|
declare const answersWidget: AnswersWidget;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import type { BreadcrumbWidgetDescription, BreadcrumbConnectorParams } from '../../connectors/breadcrumb/connectBreadcrumb';
|
|
3
3
|
import type { WidgetFactory, Template } from '../../types';
|
|
4
|
-
export
|
|
4
|
+
export type BreadcrumbCSSClasses = Partial<{
|
|
5
5
|
/**
|
|
6
6
|
* CSS class to add to the root element of the widget.
|
|
7
7
|
*/
|
|
@@ -31,7 +31,7 @@ export declare type BreadcrumbCSSClasses = Partial<{
|
|
|
31
31
|
*/
|
|
32
32
|
link: string | string[];
|
|
33
33
|
}>;
|
|
34
|
-
export
|
|
34
|
+
export type BreadcrumbTemplates = Partial<{
|
|
35
35
|
/**
|
|
36
36
|
* Label of the breadcrumb's first element.
|
|
37
37
|
*/
|
|
@@ -41,7 +41,7 @@ export declare type BreadcrumbTemplates = Partial<{
|
|
|
41
41
|
*/
|
|
42
42
|
separator: Template;
|
|
43
43
|
}>;
|
|
44
|
-
export
|
|
44
|
+
export type BreadcrumbWidgetParams = {
|
|
45
45
|
/**
|
|
46
46
|
* CSS Selector or HTMLElement to insert the widget.
|
|
47
47
|
*/
|
|
@@ -55,7 +55,7 @@ export declare type BreadcrumbWidgetParams = {
|
|
|
55
55
|
*/
|
|
56
56
|
cssClasses?: BreadcrumbCSSClasses;
|
|
57
57
|
};
|
|
58
|
-
export
|
|
58
|
+
export type BreadcrumbWidget = WidgetFactory<BreadcrumbWidgetDescription & {
|
|
59
59
|
$$widgetType: 'ais.breadcrumb';
|
|
60
60
|
}, BreadcrumbConnectorParams, BreadcrumbWidgetParams>;
|
|
61
61
|
declare const breadcrumb: BreadcrumbWidget;
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
8
|
-
export
|
|
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
|
|
4
|
+
export type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {
|
|
5
5
|
$$widgetType: 'ais.configureRelatedItems';
|
|
6
6
|
}, ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetParams>;
|
|
7
|
-
export
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
21
|
-
export
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
78
|
-
export
|
|
79
|
-
export
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
53
|
+
export type HitsWidget = WidgetFactory<HitsWidgetDescription & {
|
|
54
54
|
$$widgetType: 'ais.hits';
|
|
55
55
|
}, HitsConnectorParams, HitsWidgetParams>;
|
|
56
56
|
declare const hits: HitsWidget;
|
package/es/widgets/hits/hits.js
CHANGED
|
@@ -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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3
|
+
export type IndexWidgetParams = {
|
|
4
4
|
indexName: string;
|
|
5
5
|
indexId?: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type IndexInitOptions = {
|
|
8
8
|
instantSearchInstance: InstantSearch;
|
|
9
9
|
parent: IndexWidget | null;
|
|
10
10
|
uiState: UiState;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type IndexRenderOptions = {
|
|
13
13
|
instantSearchInstance: InstantSearch;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type IndexWidgetDescription = {
|
|
16
16
|
$$type: 'ais.index';
|
|
17
17
|
$$widgetType: 'ais.index';
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type IndexWidget = Omit<Widget<IndexWidgetDescription & {
|
|
20
20
|
widgetParams: IndexWidgetParams;
|
|
21
21
|
}>, 'getWidgetUiState' | 'getWidgetState'> & {
|
|
22
22
|
getIndexName(): string;
|
|
@@ -101,6 +101,7 @@ var index = function index(widgetParams) {
|
|
|
101
101
|
var localParent = null;
|
|
102
102
|
var helper = null;
|
|
103
103
|
var derivedHelper = null;
|
|
104
|
+
var lastValidSearchParameters = null;
|
|
104
105
|
return {
|
|
105
106
|
$$type: 'ais.index',
|
|
106
107
|
$$widgetType: 'ais.index',
|
|
@@ -114,7 +115,16 @@ var index = function index(widgetParams) {
|
|
|
114
115
|
return helper;
|
|
115
116
|
},
|
|
116
117
|
getResults: function getResults() {
|
|
117
|
-
|
|
118
|
+
var _derivedHelper;
|
|
119
|
+
if (!((_derivedHelper = derivedHelper) !== null && _derivedHelper !== void 0 && _derivedHelper.lastResults)) return null;
|
|
120
|
+
|
|
121
|
+
// To make the UI optimistic, we patch the state to display to the current
|
|
122
|
+
// one instead of the one associated with the latest results.
|
|
123
|
+
// This means user-driven UI changes (e.g., checked checkbox) are reflected
|
|
124
|
+
// immediately instead of waiting for Algolia to respond, regardless of
|
|
125
|
+
// the status of the network request.
|
|
126
|
+
derivedHelper.lastResults._state = helper.state;
|
|
127
|
+
return derivedHelper.lastResults;
|
|
118
128
|
},
|
|
119
129
|
getScopedResults: function getScopedResults() {
|
|
120
130
|
var widgetParent = this.getParent();
|
|
@@ -319,6 +329,7 @@ var index = function index(widgetParams) {
|
|
|
319
329
|
// does not have access to lastResults, which it used to in pre-federated
|
|
320
330
|
// search behavior.
|
|
321
331
|
helper.lastResults = results;
|
|
332
|
+
lastValidSearchParameters = results._state;
|
|
322
333
|
});
|
|
323
334
|
|
|
324
335
|
// We compute the render state before calling `init` in a separate loop
|
|
@@ -377,6 +388,12 @@ var index = function index(widgetParams) {
|
|
|
377
388
|
if (!this.getResults()) {
|
|
378
389
|
return;
|
|
379
390
|
}
|
|
391
|
+
|
|
392
|
+
// we can't attach a listener to the error event of search, as the error
|
|
393
|
+
// then would no longer be thrown for global handlers.
|
|
394
|
+
if (instantSearchInstance.status === 'error' && !instantSearchInstance.mainHelper.hasPendingRequests()) {
|
|
395
|
+
helper.setState(lastValidSearchParameters);
|
|
396
|
+
}
|
|
380
397
|
localWidgets.forEach(function (widget) {
|
|
381
398
|
if (widget.getRenderState) {
|
|
382
399
|
var renderState = widget.getRenderState(instantSearchInstance.renderState[_this4.getIndexId()] || {}, createRenderArgs(instantSearchInstance, _this4));
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
79
|
+
export type InfiniteHitsWidget = WidgetFactory<InfiniteHitsWidgetDescription & {
|
|
80
80
|
$$widgetType: 'ais.infiniteHits';
|
|
81
81
|
}, InfiniteHitsConnectorParams, InfiniteHitsWidgetParams>;
|
|
82
82
|
declare const infiniteHits: InfiniteHitsWidget;
|