1 |
|
2 |
|
3 | import type algoliasearch from 'algoliasearch/lite';
|
4 | import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
|
5 | import type * as ClientSearch from '@algolia/client-search';
|
6 | import EventEmitter from '@algolia/events';
|
7 | import type { InsightsClient as InsightsClient_2 } from 'search-insights';
|
8 | import type { InsightsMethodMap } from 'search-insights';
|
9 | import type * as Places from 'places.js';
|
10 | import type { PlainSearchParameters } from 'algoliasearch-helper';
|
11 | import { default as qs_2 } from 'qs';
|
12 | import type { SearchParameters } from 'algoliasearch-helper';
|
13 | import type { SearchResults } from 'algoliasearch-helper';
|
14 |
|
15 | declare type AlgoliaHit = {
|
16 | [attribute: string]: any;
|
17 | objectID: string;
|
18 | _highlightResult?: HitHighlightResult;
|
19 | _snippetResult?: HitSnippetResult;
|
20 | _rankingInfo?: {
|
21 | promoted: boolean;
|
22 | nbTypos: number;
|
23 | firstMatchedWord: number;
|
24 | proximityDistance?: number;
|
25 | geoDistance: number;
|
26 | geoPrecision?: number;
|
27 | nbExactWords: number;
|
28 | words: number;
|
29 | filters: number;
|
30 | userScore: number;
|
31 | matchedGeoLocation?: {
|
32 | lat: number;
|
33 | lng: number;
|
34 | distance: number;
|
35 | };
|
36 | };
|
37 | _distinctSeqID?: number;
|
38 | _geoLoc?: GeoLoc;
|
39 | };
|
40 |
|
41 | declare const analytics: AnalyticsWidget;
|
42 |
|
43 | declare type AnalyticsWidget = WidgetFactory<AnalyticsWidgetDescription, AnalyticsWidgetParams, AnalyticsWidgetParams>;
|
44 |
|
45 | declare type AnalyticsWidgetDescription = {
|
46 | $$type: 'ais.analytics';
|
47 | $$widgetType: 'ais.analytics';
|
48 | renderState: Record<string, unknown>;
|
49 | indexRenderState: {
|
50 | analytics: WidgetRenderState<Record<string, unknown>, AnalyticsWidgetParams>;
|
51 | };
|
52 | };
|
53 |
|
54 | declare type AnalyticsWidgetParams = {
|
55 | |
56 |
|
57 |
|
58 |
|
59 | pushFunction: AnalyticsWidgetParamsPushFunction;
|
60 | |
61 |
|
62 |
|
63 |
|
64 |
|
65 | delay?: number;
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | triggerOnUIInteraction?: boolean;
|
74 | |
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | pushInitialSearch?: boolean;
|
82 | |
83 |
|
84 |
|
85 |
|
86 |
|
87 | pushPagination?: boolean;
|
88 | };
|
89 |
|
90 | declare type AnalyticsWidgetParamsPushFunction = (
|
91 |
|
92 |
|
93 |
|
94 | formattedParameters: string,
|
95 |
|
96 |
|
97 |
|
98 | state: SearchParameters,
|
99 |
|
100 |
|
101 |
|
102 | results: SearchResults) => void;
|
103 |
|
104 | declare type AnswersConnector = Connector<AnswersWidgetDescription, AnswersConnectorParams>;
|
105 |
|
106 | declare type AnswersConnectorParams = {
|
107 | |
108 |
|
109 |
|
110 |
|
111 |
|
112 | attributesForPrediction?: string[];
|
113 | |
114 |
|
115 |
|
116 | queryLanguages: ['en'];
|
117 | |
118 |
|
119 |
|
120 |
|
121 |
|
122 | nbHits?: number;
|
123 | |
124 |
|
125 |
|
126 |
|
127 | renderDebounceTime?: number;
|
128 | |
129 |
|
130 |
|
131 |
|
132 | searchDebounceTime?: number;
|
133 | |
134 |
|
135 |
|
136 |
|
137 |
|
138 | escapeHTML?: boolean;
|
139 | |
140 |
|
141 |
|
142 |
|
143 | extraParameters?: FindAnswersOptions;
|
144 | };
|
145 |
|
146 | declare type AnswersCSSClasses = Partial<{
|
147 | |
148 |
|
149 |
|
150 | root: string | string[];
|
151 | |
152 |
|
153 |
|
154 | emptyRoot: string | string[];
|
155 | |
156 |
|
157 |
|
158 | header: string | string[];
|
159 | |
160 |
|
161 |
|
162 | loader: string | string[];
|
163 | |
164 |
|
165 |
|
166 | list: string | string[];
|
167 | |
168 |
|
169 |
|
170 | item: string | string[];
|
171 | }>;
|
172 |
|
173 | declare type AnswersRenderState = {
|
174 | |
175 |
|
176 |
|
177 | hits: Hits;
|
178 | |
179 |
|
180 |
|
181 | isLoading: boolean;
|
182 | };
|
183 |
|
184 | declare type AnswersTemplates = Partial<{
|
185 | |
186 |
|
187 |
|
188 | header: Template<{
|
189 | hits: Hit[];
|
190 | isLoading: boolean;
|
191 | }>;
|
192 | |
193 |
|
194 |
|
195 | loader: Template;
|
196 | |
197 |
|
198 |
|
199 | item: Template<Hit>;
|
200 | }>;
|
201 |
|
202 | declare type AnswersWidget = WidgetFactory<AnswersWidgetDescription & {
|
203 | $$widgetType: 'ais.answers';
|
204 | }, AnswersConnectorParams, AnswersWidgetParams>;
|
205 |
|
206 | declare const answersWidget: AnswersWidget;
|
207 |
|
208 | declare type AnswersWidgetDescription = {
|
209 | $$type: 'ais.answers';
|
210 | renderState: AnswersRenderState;
|
211 | indexRenderState: {
|
212 | answers: WidgetRenderState<AnswersRenderState, AnswersConnectorParams>;
|
213 | };
|
214 | };
|
215 |
|
216 | declare type AnswersWidgetParams = {
|
217 | |
218 |
|
219 |
|
220 | container: string | HTMLElement;
|
221 | |
222 |
|
223 |
|
224 | templates?: AnswersTemplates;
|
225 | |
226 |
|
227 |
|
228 | cssClasses?: AnswersCSSClasses;
|
229 | };
|
230 |
|
231 | declare type AnyWidgetFactory = WidgetFactory<{
|
232 | $$type: string;
|
233 | }, Record<string, any>, any>;
|
234 |
|
235 | declare type AtLeastOne<TTarget, TMapped = {
|
236 | [Key in keyof TTarget]: Pick<TTarget, Key>;
|
237 | }> = Partial<TTarget> & TMapped[keyof TMapped];
|
238 |
|
239 | declare type AugmentedWidget<TWidgetFactory extends AnyWidgetFactory, TOverriddenKeys extends keyof Widget = 'init' | 'render' | 'dispose'> = Omit<ReturnType<TWidgetFactory>, TOverriddenKeys> & Pick<Required<Widget>, TOverriddenKeys>;
|
240 |
|
241 | declare type AutocompleteConnector = Connector<AutocompleteWidgetDescription, AutocompleteConnectorParams>;
|
242 |
|
243 | declare type AutocompleteConnectorParams = {
|
244 | |
245 |
|
246 |
|
247 |
|
248 |
|
249 | escapeHTML?: boolean;
|
250 | };
|
251 |
|
252 | declare type AutocompleteRenderState = {
|
253 | |
254 |
|
255 |
|
256 | currentRefinement: string;
|
257 | |
258 |
|
259 |
|
260 | indices: Array<{
|
261 | |
262 |
|
263 |
|
264 | indexName: string;
|
265 | |
266 |
|
267 |
|
268 | hits: Hits;
|
269 | |
270 |
|
271 |
|
272 | results: SearchResults;
|
273 | |
274 |
|
275 |
|
276 | sendEvent: SendEventForHits;
|
277 | }>;
|
278 | |
279 |
|
280 |
|
281 | refine: (query: string) => void;
|
282 | };
|
283 |
|
284 | declare type AutocompleteWidgetDescription = {
|
285 | $$type: 'ais.autocomplete';
|
286 | renderState: AutocompleteRenderState;
|
287 | indexRenderState: {
|
288 | autocomplete: WidgetRenderState<AutocompleteRenderState, AutocompleteConnectorParams>;
|
289 | };
|
290 | indexUiState: {
|
291 | query: string;
|
292 | };
|
293 | };
|
294 |
|
295 | declare type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;
|
296 |
|
297 | declare type Bounds = {
|
298 | |
299 |
|
300 |
|
301 | northEast: GeoLoc;
|
302 | |
303 |
|
304 |
|
305 | southWest: GeoLoc;
|
306 | };
|
307 |
|
308 | declare const breadcrumb: BreadcrumbWidget;
|
309 |
|
310 | declare type BreadcrumbConnector = Connector<BreadcrumbWidgetDescription, BreadcrumbConnectorParams>;
|
311 |
|
312 | declare type BreadcrumbConnectorParams = {
|
313 | |
314 |
|
315 |
|
316 | attributes: string[];
|
317 | |
318 |
|
319 |
|
320 | rootPath?: string;
|
321 | |
322 |
|
323 |
|
324 | transformItems?: TransformItems<BreadcrumbConnectorParamsItem>;
|
325 | |
326 |
|
327 |
|
328 |
|
329 |
|
330 | separator?: string;
|
331 | };
|
332 |
|
333 | declare type BreadcrumbConnectorParamsItem = {
|
334 | |
335 |
|
336 |
|
337 | label: string;
|
338 | |
339 |
|
340 |
|
341 | value: string | null;
|
342 | };
|
343 |
|
344 | declare type BreadcrumbCSSClasses = Partial<{
|
345 | |
346 |
|
347 |
|
348 | root: string | string[];
|
349 | |
350 |
|
351 |
|
352 | noRefinementRoot: string | string[];
|
353 | |
354 |
|
355 |
|
356 | list: string | string[];
|
357 | |
358 |
|
359 |
|
360 | item: string | string[];
|
361 | |
362 |
|
363 |
|
364 | selectedItem: string | string[];
|
365 | |
366 |
|
367 |
|
368 | separator: string | string[];
|
369 | |
370 |
|
371 |
|
372 | link: string | string[];
|
373 | }>;
|
374 |
|
375 | declare type BreadcrumbRenderState = {
|
376 | |
377 |
|
378 |
|
379 | createURL: CreateURL<BreadcrumbConnectorParamsItem['value']>;
|
380 | |
381 |
|
382 |
|
383 | items: BreadcrumbConnectorParamsItem[];
|
384 | |
385 |
|
386 |
|
387 | refine: (value: BreadcrumbConnectorParamsItem['value']) => void;
|
388 | |
389 |
|
390 |
|
391 | canRefine: boolean;
|
392 | };
|
393 |
|
394 | declare type BreadcrumbTemplates = Partial<{
|
395 | |
396 |
|
397 |
|
398 | home: Template;
|
399 | |
400 |
|
401 |
|
402 | separator: Template;
|
403 | }>;
|
404 |
|
405 | declare type BreadcrumbWidget = WidgetFactory<BreadcrumbWidgetDescription & {
|
406 | $$widgetType: 'ais.breadcrumb';
|
407 | }, BreadcrumbConnectorParams, BreadcrumbWidgetParams>;
|
408 |
|
409 | declare type BreadcrumbWidgetDescription = {
|
410 | $$type: 'ais.breadcrumb';
|
411 | renderState: BreadcrumbRenderState;
|
412 | indexRenderState: {
|
413 | breadcrumb: {
|
414 | [rootAttribute: string]: WidgetRenderState<BreadcrumbRenderState, BreadcrumbConnectorParams>;
|
415 | };
|
416 | };
|
417 | };
|
418 |
|
419 | declare type BreadcrumbWidgetParams = {
|
420 | |
421 |
|
422 |
|
423 | container: string | HTMLElement;
|
424 | |
425 |
|
426 |
|
427 | templates?: BreadcrumbTemplates;
|
428 | |
429 |
|
430 |
|
431 | cssClasses?: BreadcrumbCSSClasses;
|
432 | };
|
433 |
|
434 | declare class BrowserHistory<TRouteState> implements Router<TRouteState> {
|
435 | |
436 |
|
437 |
|
438 | private readonly windowTitle?;
|
439 | |
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 | private readonly writeDelay;
|
447 | |
448 |
|
449 |
|
450 |
|
451 | private readonly _createURL;
|
452 | |
453 |
|
454 |
|
455 |
|
456 | private readonly parseURL;
|
457 | |
458 |
|
459 |
|
460 |
|
461 | private readonly getLocation;
|
462 | private writeTimer?;
|
463 | private _onPopState;
|
464 | |
465 |
|
466 |
|
467 |
|
468 | private shouldPushState;
|
469 | |
470 |
|
471 |
|
472 |
|
473 | constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, }: BrowserHistoryArgs<TRouteState>);
|
474 | /**
|
475 | * Reads the URL and returns a syncable UI search state.
|
476 | */
|
477 | read(): TRouteState;
|
478 | /**
|
479 | * Pushes a search state into the URL.
|
480 | */
|
481 | write(routeState: TRouteState): void;
|
482 | /**
|
483 | * Sets a callback on the `onpopstate` event of the history API of the current page.
|
484 | * It enables the URL sync to keep track of the changes.
|
485 | */
|
486 | onUpdate(callback: (routeState: TRouteState) => void): void;
|
487 | /**
|
488 | * Creates a complete URL from a given syncable UI state.
|
489 | *
|
490 | * It always generates the full URL, not a relative one.
|
491 | * This allows to handle cases like using a <base href>.
|
492 | * See: https://github.com/algolia/instantsearch.js/issues/790
|
493 | */
|
494 | createURL(routeState: TRouteState): string;
|
495 | /**
|
496 | * Removes the event listener and cleans up the URL.
|
497 | */
|
498 | dispose(): void;
|
499 | }
|
500 |
|
501 | declare type BrowserHistoryArgs<TRouteState> = {
|
502 | windowTitle?: (routeState: TRouteState) => string;
|
503 | writeDelay: number;
|
504 | createURL: CreateURL_2<TRouteState>;
|
505 | parseURL: ParseURL<TRouteState>;
|
506 | getLocation(): Location;
|
507 | };
|
508 |
|
509 | declare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hits, eventName?: string) => string;
|
510 |
|
511 | declare type BuiltInSendEventForFacet = (eventType: string, facetValue: string, eventName?: string) => void;
|
512 |
|
513 | declare type BuiltInSendEventForHits = (eventType: string, hits: Hit | Hits, eventName?: string) => void;
|
514 |
|
515 | declare type BuiltInSendEventForToggle = (eventType: string, isRefined: boolean, eventName?: string) => void;
|
516 |
|
517 | declare const clearRefinements: ClearRefinementsWidget;
|
518 |
|
519 | declare type ClearRefinementsConnector = Connector<ClearRefinementsWidgetDescription, ClearRefinementsConnectorParams>;
|
520 |
|
521 | declare type ClearRefinementsConnectorParams = {
|
522 | |
523 |
|
524 |
|
525 | includedAttributes?: string[];
|
526 | |
527 |
|
528 |
|
529 | excludedAttributes?: string[];
|
530 | |
531 |
|
532 |
|
533 | transformItems?: TransformItems<string>;
|
534 | };
|
535 |
|
536 | declare type ClearRefinementsCSSClasses = Partial<{
|
537 | |
538 |
|
539 |
|
540 | root: string | string[];
|
541 | |
542 |
|
543 |
|
544 | button: string | string[];
|
545 | |
546 |
|
547 |
|
548 | disabledButton: string | string[];
|
549 | }>;
|
550 |
|
551 | declare type ClearRefinementsRenderState = {
|
552 | |
553 |
|
554 |
|
555 | refine: () => void;
|
556 | |
557 |
|
558 |
|
559 |
|
560 | hasRefinements: boolean;
|
561 | |
562 |
|
563 |
|
564 | canRefine: boolean;
|
565 | |
566 |
|
567 |
|
568 | createURL: CreateURL<void>;
|
569 | };
|
570 |
|
571 | declare type ClearRefinementsTemplates = Partial<{
|
572 | |
573 |
|
574 |
|
575 | resetLabel: Template;
|
576 | }>;
|
577 |
|
578 | declare type ClearRefinementsWidget = WidgetFactory<ClearRefinementsWidgetDescription & {
|
579 | $$widgetType: 'ais.clearRefinements';
|
580 | }, ClearRefinementsConnectorParams, ClearRefinementsWidgetParams>;
|
581 |
|
582 | declare type ClearRefinementsWidgetDescription = {
|
583 | $$type: 'ais.clearRefinements';
|
584 | renderState: ClearRefinementsRenderState;
|
585 | indexRenderState: {
|
586 | clearRefinements: WidgetRenderState<ClearRefinementsRenderState, ClearRefinementsConnectorParams>;
|
587 | };
|
588 | };
|
589 |
|
590 | declare type ClearRefinementsWidgetParams = {
|
591 | |
592 |
|
593 |
|
594 | container: string | HTMLElement;
|
595 | |
596 |
|
597 |
|
598 | templates?: ClearRefinementsTemplates;
|
599 | |
600 |
|
601 |
|
602 | cssClasses?: ClearRefinementsCSSClasses;
|
603 | };
|
604 |
|
605 | declare type ComponentCSSClasses<TCSSClasses> = Required<{
|
606 | [className in keyof TCSSClasses]: string;
|
607 | }>;
|
608 |
|
609 | declare const configure: ConfigureWidget;
|
610 |
|
611 | declare type ConfigureConnector = Connector<ConfigureWidgetDescription, ConfigureConnectorParams>;
|
612 |
|
613 | declare type ConfigureConnectorParams = {
|
614 | |
615 |
|
616 |
|
617 |
|
618 | searchParameters: PlainSearchParameters;
|
619 | };
|
620 |
|
621 | declare const configureRelatedItems: ConfigureRelatedItemsWidget;
|
622 |
|
623 | declare type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;
|
624 |
|
625 | declare type ConfigureRelatedItemsConnectorParams = {
|
626 | |
627 |
|
628 |
|
629 | hit: AlgoliaHit;
|
630 | |
631 |
|
632 |
|
633 |
|
634 | matchingPatterns: MatchingPatterns;
|
635 | |
636 |
|
637 |
|
638 | transformSearchParameters?: TransformSearchParameters;
|
639 | };
|
640 |
|
641 | declare type ConfigureRelatedItemsWidget = WidgetFactory<ConfigureRelatedItemsWidgetDescription & {
|
642 | $$widgetType: 'ais.configureRelatedItems';
|
643 | }, ConfigureRelatedItemsConnectorParams, ConfigureRelatedItemsWidgetParams>;
|
644 |
|
645 | declare type ConfigureRelatedItemsWidgetDescription = {
|
646 | $$type: 'ais.configureRelatedItems';
|
647 | } & Omit<ConfigureWidgetDescription, '$$type'>;
|
648 |
|
649 | declare type ConfigureRelatedItemsWidgetParams = PlainSearchParameters;
|
650 |
|
651 | declare type ConfigureRenderState = {
|
652 | |
653 |
|
654 |
|
655 | refine: Refine;
|
656 | };
|
657 |
|
658 | declare type ConfigureWidget = (widgetParams: ConfigureWidgetParams) => Widget<ConfigureWidgetDescription & {
|
659 | $$widgetType: 'ais.configure';
|
660 | widgetParams: ConfigureConnectorParams;
|
661 | }>;
|
662 |
|
663 | declare type ConfigureWidgetDescription = {
|
664 | $$type: 'ais.configure';
|
665 | renderState: ConfigureRenderState;
|
666 | indexRenderState: {
|
667 | configure: WidgetRenderState<ConfigureRenderState, ConfigureConnectorParams>;
|
668 | };
|
669 | indexUiState: {
|
670 | configure: PlainSearchParameters;
|
671 | };
|
672 | };
|
673 |
|
674 |
|
675 |
|
676 |
|
677 |
|
678 | declare type ConfigureWidgetParams = ConfigureConnectorParams['searchParameters'];
|
679 |
|
680 | declare const connectAnswers: AnswersConnector;
|
681 |
|
682 | declare const connectAutocomplete: AutocompleteConnector;
|
683 |
|
684 | declare const connectBreadcrumb: BreadcrumbConnector;
|
685 |
|
686 | declare const connectClearRefinements: ClearRefinementsConnector;
|
687 |
|
688 | declare const connectConfigure: ConfigureConnector;
|
689 |
|
690 | declare const connectConfigureRelatedItems: ConfigureRelatedItemsConnector;
|
691 |
|
692 | declare const connectCurrentRefinements: CurrentRefinementsConnector;
|
693 |
|
694 | declare const connectDynamicWidgets: DynamicWidgetsConnector;
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 | declare const connectGeoSearch: GeoSearchConnector;
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 | declare const connectHierarchicalMenu: HierarchicalMenuConnector;
|
721 |
|
722 | declare const connectHits: HitsConnector;
|
723 |
|
724 | declare const connectHitsPerPage: HitsPerPageConnector;
|
725 |
|
726 | declare const connectHitsWithInsights: HitsConnector;
|
727 |
|
728 | declare const connectInfiniteHits: InfiniteHitsConnector;
|
729 |
|
730 | declare const connectInfiniteHitsWithInsights: InfiniteHitsConnector;
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 | declare const connectMenu: MenuConnector;
|
742 |
|
743 | declare const connectNumericMenu: NumericMenuConnector;
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 | declare type Connector<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams> = <TWidgetParams extends UnknownWidgetParams>(
|
750 |
|
751 |
|
752 |
|
753 | renderFn: Renderer<TWidgetDescription['renderState'], TConnectorParams & TWidgetParams>,
|
754 |
|
755 |
|
756 |
|
757 | unmountFn?: Unmounter) => (widgetParams: TConnectorParams & TWidgetParams) => Widget<TWidgetDescription & {
|
758 | widgetParams: typeof widgetParams;
|
759 | }>;
|
760 |
|
761 | declare type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] & AutocompleteWidgetDescription['indexRenderState'] & BreadcrumbWidgetDescription['indexRenderState'] & ClearRefinementsWidgetDescription['indexRenderState'] & ConfigureWidgetDescription['indexRenderState'] & CurrentRefinementsWidgetDescription['indexRenderState'] & GeoSearchWidgetDescription['indexRenderState'] & HierarchicalMenuWidgetDescription['indexRenderState'] & HitsWidgetDescription['indexRenderState'] & HitsPerPageWidgetDescription['indexRenderState'] & InfiniteHitsWidgetDescription['indexRenderState'] & MenuWidgetDescription['indexRenderState'] & NumericMenuWidgetDescription['indexRenderState'] & PaginationWidgetDescription['indexRenderState'] & PoweredByWidgetDescription['indexRenderState'] & QueryRulesWidgetDescription['indexRenderState'] & RangeWidgetDescription['indexRenderState'] & RatingMenuWidgetDescription['indexRenderState'] & RefinementListWidgetDescription['indexRenderState'] & RelevantSortWidgetDescription['indexRenderState'] & SearchBoxWidgetDescription['indexRenderState'] & SortByWidgetDescription['indexRenderState'] & StatsWidgetDescription['indexRenderState'] & ToggleRefinementWidgetDescription['indexRenderState'] & VoiceSearchWidgetDescription['indexRenderState'];
|
762 |
|
763 | declare namespace connectors {
|
764 | export {
|
765 | connectClearRefinements,
|
766 | connectCurrentRefinements,
|
767 | connectHierarchicalMenu,
|
768 | connectHits,
|
769 | connectHitsWithInsights,
|
770 | connectHitsPerPage,
|
771 | connectInfiniteHits,
|
772 | connectInfiniteHitsWithInsights,
|
773 | connectMenu,
|
774 | connectNumericMenu,
|
775 | connectPagination,
|
776 | connectRange,
|
777 | connectRefinementList,
|
778 | connectSearchBox,
|
779 | connectSortBy,
|
780 | connectRatingMenu,
|
781 | connectStats,
|
782 | connectToggleRefinement,
|
783 | connectBreadcrumb,
|
784 | connectGeoSearch,
|
785 | connectPoweredBy,
|
786 | connectConfigure,
|
787 | connectConfigureRelatedItems as EXPERIMENTAL_connectConfigureRelatedItems,
|
788 | connectAutocomplete,
|
789 | connectQueryRules,
|
790 | connectVoiceSearch,
|
791 | connectAnswers as EXPERIMENTAL_connectAnswers,
|
792 | connectRelevantSort,
|
793 | connectDynamicWidgets,
|
794 | EXPERIMENTAL_connectDynamicWidgets
|
795 | }
|
796 | }
|
797 |
|
798 | declare type ConnectorUiStates = AutocompleteWidgetDescription['indexUiState'] & ConfigureWidgetDescription['indexUiState'] & GeoSearchWidgetDescription['indexUiState'] & HierarchicalMenuWidgetDescription['indexUiState'] & HitsPerPageWidgetDescription['indexUiState'] & InfiniteHitsWidgetDescription['indexUiState'] & MenuWidgetDescription['indexUiState'] & NumericMenuWidgetDescription['indexUiState'] & PaginationWidgetDescription['indexUiState'] & RangeWidgetDescription['indexUiState'] & RatingMenuWidgetDescription['indexUiState'] & RefinementListWidgetDescription['indexUiState'] & RelevantSortWidgetDescription['indexUiState'] & SearchBoxWidgetDescription['indexUiState'] & SortByWidgetDescription['indexUiState'] & ToggleRefinementWidgetDescription['indexUiState'] & VoiceSearchWidgetDescription['indexUiState'];
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 | declare const connectPagination: PaginationConnector;
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 | declare const connectPoweredBy: PoweredByConnector;
|
814 |
|
815 | declare const connectQueryRules: QueryRulesConnector;
|
816 |
|
817 |
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 | declare const connectRange: RangeConnector;
|
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 |
|
833 |
|
834 | declare const connectRatingMenu: RatingMenuConnector;
|
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 |
|
841 |
|
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 | declare const connectRefinementList: RefinementListConnector;
|
849 |
|
850 | declare const connectRelevantSort: RelevantSortConnector;
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 | declare const connectSearchBox: SearchBoxConnector;
|
859 |
|
860 | declare const connectSortBy: SortByConnector;
|
861 |
|
862 | declare const connectStats: StatsConnector;
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 | declare const connectToggleRefinement: ToggleRefinementConnector;
|
873 |
|
874 | declare const connectVoiceSearch: VoiceSearchConnector;
|
875 |
|
876 | declare function createInfiniteHitsSessionStorageCache(): InfiniteHitsCache;
|
877 |
|
878 | declare type CreateInsightsMiddleware = (props: InsightsProps) => InternalMiddleware;
|
879 |
|
880 | declare const createInsightsMiddleware: CreateInsightsMiddleware;
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 | declare function createMetadataMiddleware(): InternalMiddleware;
|
890 |
|
891 | declare const createRouterMiddleware: <TUiState extends UiState = UiState, TRouteState = TUiState>(props?: RouterProps<TUiState, TRouteState>) => InternalMiddleware<TUiState>;
|
892 |
|
893 |
|
894 |
|
895 |
|
896 | declare type CreateURL<TValue> = (value: TValue) => string;
|
897 |
|
898 | declare type CreateURL_2<TRouteState> = (args: {
|
899 | qsModule: typeof qs_2;
|
900 | routeState: TRouteState;
|
901 | location: Location;
|
902 | }) => string;
|
903 |
|
904 | declare type CreateVoiceSearchHelper = (params: VoiceSearchHelperParams) => VoiceSearchHelper;
|
905 |
|
906 | declare const currentRefinements: CurrentRefinementsWidget;
|
907 |
|
908 | declare type CurrentRefinementsConnector = Connector<CurrentRefinementsWidgetDescription, CurrentRefinementsConnectorParams>;
|
909 |
|
910 | declare type CurrentRefinementsConnectorParams = {
|
911 | |
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 | includedAttributes?: string[];
|
918 | |
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 | excludedAttributes?: string[];
|
925 | |
926 |
|
927 |
|
928 | transformItems?: TransformItems<CurrentRefinementsConnectorParamsItem>;
|
929 | };
|
930 |
|
931 | declare type CurrentRefinementsConnectorParamsItem = {
|
932 | |
933 |
|
934 |
|
935 | indexName: string;
|
936 | |
937 |
|
938 |
|
939 | attribute: string;
|
940 | |
941 |
|
942 |
|
943 | label: string;
|
944 | |
945 |
|
946 |
|
947 | refinements: CurrentRefinementsConnectorParamsRefinement[];
|
948 | |
949 |
|
950 |
|
951 | refine(refinement: CurrentRefinementsConnectorParamsRefinement): void;
|
952 | };
|
953 |
|
954 | declare type CurrentRefinementsConnectorParamsRefinement = {
|
955 | |
956 |
|
957 |
|
958 | attribute: string;
|
959 | |
960 |
|
961 |
|
962 |
|
963 |
|
964 | type: string;
|
965 | |
966 |
|
967 |
|
968 | value: string | number;
|
969 | |
970 |
|
971 |
|
972 | label: string;
|
973 | |
974 |
|
975 |
|
976 | operator?: string;
|
977 | |
978 |
|
979 |
|
980 | count?: number;
|
981 | |
982 |
|
983 |
|
984 | exhaustive?: boolean;
|
985 | };
|
986 |
|
987 | declare type CurrentRefinementsCSSClasses = Partial<{
|
988 | |
989 |
|
990 |
|
991 | root: string | string[];
|
992 | |
993 |
|
994 |
|
995 | list: string | string[];
|
996 | |
997 |
|
998 |
|
999 | item: string | string[];
|
1000 | |
1001 |
|
1002 |
|
1003 | label: string | string[];
|
1004 | |
1005 |
|
1006 |
|
1007 | category: string | string[];
|
1008 | |
1009 |
|
1010 |
|
1011 | categoryLabel: string | string[];
|
1012 | |
1013 |
|
1014 |
|
1015 | delete: string | string[];
|
1016 | }>;
|
1017 |
|
1018 | declare type CurrentRefinementsRenderState = {
|
1019 | |
1020 |
|
1021 |
|
1022 | items: CurrentRefinementsConnectorParamsItem[];
|
1023 | |
1024 |
|
1025 |
|
1026 | canRefine: boolean;
|
1027 | |
1028 |
|
1029 |
|
1030 | refine(refinement: CurrentRefinementsConnectorParamsRefinement): void;
|
1031 | |
1032 |
|
1033 |
|
1034 | createURL: CreateURL<CurrentRefinementsConnectorParamsRefinement>;
|
1035 | };
|
1036 |
|
1037 | declare type CurrentRefinementsWidget = WidgetFactory<CurrentRefinementsWidgetDescription & {
|
1038 | $$widgetType: 'ais.currentRefinements';
|
1039 | }, CurrentRefinementsConnectorParams, CurrentRefinementsWidgetParams>;
|
1040 |
|
1041 | declare type CurrentRefinementsWidgetDescription = {
|
1042 | $$type: 'ais.currentRefinements';
|
1043 | renderState: CurrentRefinementsRenderState;
|
1044 | indexRenderState: {
|
1045 | currentRefinements: WidgetRenderState<CurrentRefinementsRenderState, CurrentRefinementsConnectorParams>;
|
1046 | };
|
1047 | };
|
1048 |
|
1049 | declare type CurrentRefinementsWidgetParams = {
|
1050 | |
1051 |
|
1052 |
|
1053 | container: string | HTMLElement;
|
1054 | |
1055 |
|
1056 |
|
1057 | cssClasses?: CurrentRefinementsCSSClasses;
|
1058 | };
|
1059 |
|
1060 | declare type CustomBindEventForHits = (customPayload: any) => string;
|
1061 |
|
1062 | declare type CustomSendEventForFacet = (customPayload: any) => void;
|
1063 |
|
1064 | declare type CustomSendEventForHits = (customPayload: any) => void;
|
1065 |
|
1066 | declare type CustomSendEventForToggle = (customPayload: any) => void;
|
1067 |
|
1068 | declare type DefaultSearchClient = ReturnType<typeof algoliasearch>;
|
1069 |
|
1070 | declare type DisposeOptions = {
|
1071 | helper: AlgoliaSearchHelper;
|
1072 | state: SearchParameters;
|
1073 | parent: IndexWidget;
|
1074 | };
|
1075 |
|
1076 | declare type DummySearchClientV4 = {
|
1077 | readonly transporter: any;
|
1078 | };
|
1079 |
|
1080 | declare const dynamicWidgets: DynamicWidgetsWidget;
|
1081 |
|
1082 | declare type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;
|
1083 |
|
1084 | declare type DynamicWidgetsConnectorParams = {
|
1085 | |
1086 |
|
1087 |
|
1088 | widgets: Widget[];
|
1089 | |
1090 |
|
1091 |
|
1092 |
|
1093 | fallbackWidget?(args: {
|
1094 |
|
1095 | attribute: string;
|
1096 | }): Widget;
|
1097 | |
1098 |
|
1099 |
|
1100 |
|
1101 | transformItems?(items: string[], metadata: {
|
1102 | results: SearchResults;
|
1103 | }): string[];
|
1104 | |
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 | facets?: ['*'] | never[];
|
1111 | |
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 | maxValuesPerFacet?: number;
|
1118 | };
|
1119 |
|
1120 | declare type DynamicWidgetsRenderState = {
|
1121 | attributesToRender: string[];
|
1122 | };
|
1123 |
|
1124 | declare type DynamicWidgetsWidget = WidgetFactory<DynamicWidgetsWidgetDescription & {
|
1125 | $$widgetType: 'ais.dynamicWidgets';
|
1126 | }, Omit<DynamicWidgetsConnectorParams, 'widgets' | 'fallbackWidget'>, DynamicWidgetsWidgetParams>;
|
1127 |
|
1128 | declare type DynamicWidgetsWidgetDescription = {
|
1129 | $$type: 'ais.dynamicWidgets';
|
1130 | renderState: DynamicWidgetsRenderState;
|
1131 | indexRenderState: {
|
1132 | dynamicWidgets: DynamicWidgetsRenderState;
|
1133 | };
|
1134 | };
|
1135 |
|
1136 | declare type DynamicWidgetsWidgetParams = {
|
1137 | |
1138 |
|
1139 |
|
1140 | container: string | HTMLElement;
|
1141 | |
1142 |
|
1143 |
|
1144 |
|
1145 | widgets: Array<(container: HTMLElement) => Widget>;
|
1146 | |
1147 |
|
1148 |
|
1149 |
|
1150 | fallbackWidget?(args: {
|
1151 |
|
1152 | attribute: string;
|
1153 |
|
1154 | container: HTMLElement;
|
1155 | }): Widget;
|
1156 | };
|
1157 |
|
1158 | declare type Expand<T> = T extends infer O ? {
|
1159 | [K in keyof O]: O[K];
|
1160 | } : never;
|
1161 |
|
1162 |
|
1163 | declare const EXPERIMENTAL_connectDynamicWidgets: DynamicWidgetsConnector;
|
1164 |
|
1165 |
|
1166 | declare const EXPERIMENTAL_dynamicWidgets: DynamicWidgetsWidget;
|
1167 |
|
1168 | declare type FindAnswersOptions = DefaultSearchClient extends DummySearchClientV4 ? ClientSearch.FindAnswersOptions : any;
|
1169 |
|
1170 | declare type GeoHit = Hit & Required<Pick<Hit, '_geoLoc'>>;
|
1171 |
|
1172 | declare type GeoLoc = {
|
1173 | lat: number;
|
1174 | lng: number;
|
1175 | };
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 | declare const geoSearch: GeoSearchWidget;
|
1191 |
|
1192 | declare type GeoSearchConnector = Connector<GeoSearchWidgetDescription, GeoSearchConnectorParams>;
|
1193 |
|
1194 | declare type GeoSearchConnectorParams = {
|
1195 | |
1196 |
|
1197 |
|
1198 |
|
1199 | enableRefineOnMapMove?: boolean;
|
1200 | |
1201 |
|
1202 |
|
1203 |
|
1204 | transformItems?: TransformItems<GeoHit>;
|
1205 | };
|
1206 |
|
1207 | declare type GeoSearchCSSClasses = Partial<{
|
1208 |
|
1209 | root: string | string[];
|
1210 |
|
1211 | map: string | string[];
|
1212 |
|
1213 | control: string | string[];
|
1214 |
|
1215 | label: string | string[];
|
1216 |
|
1217 | selectedLabel: string | string[];
|
1218 |
|
1219 | input: string | string[];
|
1220 |
|
1221 | redo: string | string[];
|
1222 |
|
1223 | disabledRedo: string | string[];
|
1224 |
|
1225 | reset: string | string[];
|
1226 | }>;
|
1227 |
|
1228 | declare type GeoSearchMarker<TOptions> = {
|
1229 | |
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 | createOptions?(item: GeoHit): TOptions;
|
1235 | |
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 | events: {
|
1241 | [key: string]: (event: {
|
1242 | item: any;
|
1243 | marker: any;
|
1244 | map: any;
|
1245 | event: any;
|
1246 | }) => void;
|
1247 | };
|
1248 | };
|
1249 |
|
1250 | declare type GeoSearchRenderState = {
|
1251 | |
1252 |
|
1253 |
|
1254 | clearMapRefinement(): void;
|
1255 | |
1256 |
|
1257 |
|
1258 | currentRefinement?: Bounds;
|
1259 | |
1260 |
|
1261 |
|
1262 | hasMapMoveSinceLastRefine(): boolean;
|
1263 | |
1264 |
|
1265 |
|
1266 | isRefinedWithMap(): boolean;
|
1267 | |
1268 |
|
1269 |
|
1270 | isRefineOnMapMove(): boolean;
|
1271 | |
1272 |
|
1273 |
|
1274 | items: GeoHit[];
|
1275 | |
1276 |
|
1277 |
|
1278 | position?: GeoLoc;
|
1279 | |
1280 |
|
1281 |
|
1282 | refine(bounds: Bounds): void;
|
1283 | |
1284 |
|
1285 |
|
1286 | sendEvent: SendEventForHits;
|
1287 | |
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 | setMapMoveSinceLastRefine(): void;
|
1293 | |
1294 |
|
1295 |
|
1296 | toggleRefineOnMapMove(): void;
|
1297 | };
|
1298 |
|
1299 | declare type GeoSearchTemplates = Partial<{
|
1300 |
|
1301 | HTMLMarker: Template<GeoHit>;
|
1302 |
|
1303 | reset: Template;
|
1304 |
|
1305 | toggle: Template;
|
1306 |
|
1307 | redo: Template;
|
1308 | }>;
|
1309 |
|
1310 | declare type GeoSearchWidget = WidgetFactory<GeoSearchWidgetDescription & {
|
1311 | $$widgetType: 'ais.geoSearch';
|
1312 | }, GeoSearchConnectorParams, GeoSearchWidgetParams>;
|
1313 |
|
1314 | declare type GeoSearchWidgetDescription = {
|
1315 | $$type: 'ais.geoSearch';
|
1316 | renderState: GeoSearchRenderState;
|
1317 | indexRenderState: {
|
1318 | geoSearch: WidgetRenderState<GeoSearchRenderState, GeoSearchConnectorParams>;
|
1319 | };
|
1320 | indexUiState: {
|
1321 | geoSearch: {
|
1322 | |
1323 |
|
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 |
|
1329 | boundingBox: string;
|
1330 | };
|
1331 | };
|
1332 | };
|
1333 |
|
1334 | declare type GeoSearchWidgetParams = {
|
1335 | |
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 | initialZoom?: number;
|
1342 | |
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 | initialPosition?: GeoLoc;
|
1350 |
|
1351 | templates?: GeoSearchTemplates;
|
1352 |
|
1353 | cssClasses?: GeoSearchCSSClasses;
|
1354 | |
1355 |
|
1356 |
|
1357 |
|
1358 | builtInMarker?: Partial<GeoSearchMarker<google.maps.MarkerOptions>>;
|
1359 | |
1360 |
|
1361 |
|
1362 |
|
1363 |
|
1364 | customHTMLMarker?: Partial<GeoSearchMarker<Partial<HTMLMarkerArguments>>> | boolean;
|
1365 | |
1366 |
|
1367 |
|
1368 |
|
1369 | enableRefine?: boolean;
|
1370 | |
1371 |
|
1372 |
|
1373 |
|
1374 |
|
1375 | enableClearMapRefinement?: boolean;
|
1376 | |
1377 |
|
1378 |
|
1379 |
|
1380 | enableRefineControl?: boolean;
|
1381 | |
1382 |
|
1383 |
|
1384 |
|
1385 |
|
1386 | mapOptions?: google.maps.MapOptions;
|
1387 | |
1388 |
|
1389 |
|
1390 | container: string | HTMLElement;
|
1391 | |
1392 |
|
1393 |
|
1394 |
|
1395 | googleReference: typeof window['google'];
|
1396 | };
|
1397 |
|
1398 |
|
1399 |
|
1400 |
|
1401 | declare function getInsightsAnonymousUserToken(): string | undefined;
|
1402 |
|
1403 | declare function getInsightsAnonymousUserTokenInternal(): string | undefined;
|
1404 |
|
1405 | declare type GetWidgetRenderState<TWidgetFactory extends AnyWidgetFactory> = ReturnType<TWidgetFactory>['getWidgetRenderState'] extends (renderOptions: any) => infer TRenderState ? TRenderState extends Record<string, unknown> ? TRenderState : never : Record<string, unknown>;
|
1406 |
|
1407 | declare namespace helpers {
|
1408 | export {
|
1409 | reverseHighlight,
|
1410 | reverseSnippet,
|
1411 | highlight,
|
1412 | snippet,
|
1413 | insights,
|
1414 | getInsightsAnonymousUserToken,
|
1415 | getInsightsAnonymousUserTokenInternal,
|
1416 | HighlightOptions,
|
1417 | ReverseHighlightOptions,
|
1418 | SnippetOptions,
|
1419 | ReverseSnippetOptions
|
1420 | }
|
1421 | }
|
1422 |
|
1423 | declare const hierarchicalMenu: HierarchicalMenuWidget;
|
1424 |
|
1425 | declare type HierarchicalMenuConnector = Connector<HierarchicalMenuWidgetDescription, HierarchicalMenuConnectorParams>;
|
1426 |
|
1427 | declare type HierarchicalMenuConnectorParams = {
|
1428 | |
1429 |
|
1430 |
|
1431 | attributes: string[];
|
1432 | |
1433 |
|
1434 |
|
1435 | separator?: string;
|
1436 | |
1437 |
|
1438 |
|
1439 | rootPath?: string | null;
|
1440 | |
1441 |
|
1442 |
|
1443 |
|
1444 | showParentLevel?: boolean;
|
1445 | |
1446 |
|
1447 |
|
1448 | limit?: number;
|
1449 | |
1450 |
|
1451 |
|
1452 | showMore?: boolean;
|
1453 | |
1454 |
|
1455 |
|
1456 | showMoreLimit?: number;
|
1457 | |
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 | sortBy?: SortBy<HierarchicalMenuItem>;
|
1464 | |
1465 |
|
1466 |
|
1467 | transformItems?: TransformItems<HierarchicalMenuItem>;
|
1468 | };
|
1469 |
|
1470 | declare type HierarchicalMenuCSSClasses = Partial<{
|
1471 | |
1472 |
|
1473 |
|
1474 | root: string | string[];
|
1475 | |
1476 |
|
1477 |
|
1478 | noRefinementRoot: string | string[];
|
1479 | |
1480 |
|
1481 |
|
1482 | list: string | string[];
|
1483 | |
1484 |
|
1485 |
|
1486 | childList: string | string[];
|
1487 | |
1488 |
|
1489 |
|
1490 | item: string | string[];
|
1491 | |
1492 |
|
1493 |
|
1494 | selectedItem: string | string[];
|
1495 | |
1496 |
|
1497 |
|
1498 | parentItem: string | string[];
|
1499 | |
1500 |
|
1501 |
|
1502 | link: string | string[];
|
1503 | |
1504 |
|
1505 |
|
1506 | label: string | string[];
|
1507 | |
1508 |
|
1509 |
|
1510 | count: string | string[];
|
1511 | |
1512 |
|
1513 |
|
1514 | showMore: string | string[];
|
1515 | |
1516 |
|
1517 |
|
1518 | disabledShowMore: string | string[];
|
1519 | }>;
|
1520 |
|
1521 | declare type HierarchicalMenuItem = {
|
1522 | |
1523 |
|
1524 |
|
1525 | value: string;
|
1526 | |
1527 |
|
1528 |
|
1529 | label: string;
|
1530 | |
1531 |
|
1532 |
|
1533 | count: number;
|
1534 | |
1535 |
|
1536 |
|
1537 | isRefined: boolean;
|
1538 | |
1539 |
|
1540 |
|
1541 | data: HierarchicalMenuItem[] | null;
|
1542 | };
|
1543 |
|
1544 | declare type HierarchicalMenuRenderState = {
|
1545 | |
1546 |
|
1547 |
|
1548 | createURL: CreateURL<string>;
|
1549 | |
1550 |
|
1551 |
|
1552 | items: HierarchicalMenuItem[];
|
1553 | |
1554 |
|
1555 |
|
1556 | refine: (value: string) => void;
|
1557 | |
1558 |
|
1559 |
|
1560 | canRefine: boolean;
|
1561 | |
1562 |
|
1563 |
|
1564 | isShowingMore: boolean;
|
1565 | |
1566 |
|
1567 |
|
1568 | toggleShowMore: () => void;
|
1569 | |
1570 |
|
1571 |
|
1572 |
|
1573 | canToggleShowMore: boolean;
|
1574 | |
1575 |
|
1576 |
|
1577 | sendEvent: SendEventForFacet;
|
1578 | };
|
1579 |
|
1580 | declare type HierarchicalMenuTemplates = Partial<{
|
1581 | |
1582 |
|
1583 |
|
1584 | item: Template<{
|
1585 | name: string;
|
1586 | count: number;
|
1587 | isRefined: boolean;
|
1588 | url: string;
|
1589 | }>;
|
1590 | |
1591 |
|
1592 |
|
1593 | showMoreText: Template<{
|
1594 | isShowingMore: boolean;
|
1595 | }>;
|
1596 | }>;
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 |
|
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 | declare type HierarchicalMenuWidget = WidgetFactory<HierarchicalMenuWidgetDescription & {
|
1650 | $$widgetType: 'ais.hierarchicalMenu';
|
1651 | }, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetParams>;
|
1652 |
|
1653 | declare type HierarchicalMenuWidgetDescription = {
|
1654 | $$type: 'ais.hierarchicalMenu';
|
1655 | renderState: HierarchicalMenuRenderState;
|
1656 | indexRenderState: {
|
1657 | hierarchicalMenu: {
|
1658 | [rootAttribute: string]: WidgetRenderState<HierarchicalMenuRenderState, HierarchicalMenuConnectorParams>;
|
1659 | };
|
1660 | };
|
1661 | indexUiState: {
|
1662 | hierarchicalMenu: {
|
1663 | [rootAttribute: string]: string[];
|
1664 | };
|
1665 | };
|
1666 | };
|
1667 |
|
1668 | declare type HierarchicalMenuWidgetParams = {
|
1669 | |
1670 |
|
1671 |
|
1672 | container: string | HTMLElement;
|
1673 | |
1674 |
|
1675 |
|
1676 | attributes: string[];
|
1677 | |
1678 |
|
1679 |
|
1680 | separator?: string;
|
1681 | |
1682 |
|
1683 |
|
1684 | rootPath?: string;
|
1685 | |
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 | showParentLevel?: boolean;
|
1707 | |
1708 |
|
1709 |
|
1710 | limit?: number;
|
1711 | |
1712 |
|
1713 |
|
1714 | showMore?: boolean;
|
1715 | |
1716 |
|
1717 |
|
1718 |
|
1719 | showMoreLimit?: number;
|
1720 | |
1721 |
|
1722 |
|
1723 |
|
1724 | sortBy?: SortBy<HierarchicalMenuItem>;
|
1725 | |
1726 |
|
1727 |
|
1728 | transformItems?: TransformItems<HierarchicalMenuItem>;
|
1729 | |
1730 |
|
1731 |
|
1732 | templates?: HierarchicalMenuTemplates;
|
1733 | |
1734 |
|
1735 |
|
1736 | cssClasses?: HierarchicalMenuCSSClasses;
|
1737 | };
|
1738 |
|
1739 | declare function highlight({ attribute, highlightedTagName, hit, cssClasses, }: HighlightOptions): string;
|
1740 |
|
1741 | declare type HighlightOptions = {
|
1742 | attribute: string | string[];
|
1743 | highlightedTagName?: string;
|
1744 | hit: Partial<Hit>;
|
1745 | cssClasses?: Partial<{
|
1746 | highlighted: string;
|
1747 | }>;
|
1748 | };
|
1749 |
|
1750 | declare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;
|
1751 |
|
1752 | declare type Hit = {
|
1753 | __position: number;
|
1754 | __queryID?: string;
|
1755 | } & AlgoliaHit;
|
1756 |
|
1757 | declare type HitAttributeHighlightResult = {
|
1758 | value: string;
|
1759 | matchLevel: 'none' | 'partial' | 'full';
|
1760 | matchedWords: string[];
|
1761 | fullyHighlighted?: boolean;
|
1762 | };
|
1763 |
|
1764 | declare type HitAttributeSnippetResult = Pick<HitAttributeHighlightResult, 'value' | 'matchLevel'>;
|
1765 |
|
1766 | declare type HitHighlightResult = {
|
1767 | [attribute: string]: HitAttributeHighlightResult | HitAttributeHighlightResult[] | HitHighlightResult[] | HitHighlightResult;
|
1768 | };
|
1769 |
|
1770 | declare type Hits = Hit[];
|
1771 |
|
1772 | declare const hits: HitsWidget;
|
1773 |
|
1774 | declare type HitsConnector = Connector<HitsWidgetDescription, HitsConnectorParams>;
|
1775 |
|
1776 | declare type HitsConnectorParams = {
|
1777 | |
1778 |
|
1779 |
|
1780 |
|
1781 |
|
1782 | escapeHTML?: boolean;
|
1783 | |
1784 |
|
1785 |
|
1786 | transformItems?: TransformItems<Hit>;
|
1787 | };
|
1788 |
|
1789 | declare type HitsCSSClasses = Partial<{
|
1790 | |
1791 |
|
1792 |
|
1793 | root: string | string[];
|
1794 | |
1795 |
|
1796 |
|
1797 | emptyRoot: string | string[];
|
1798 | |
1799 |
|
1800 |
|
1801 | list: string | string[];
|
1802 | |
1803 |
|
1804 |
|
1805 | item: string | string[];
|
1806 | }>;
|
1807 |
|
1808 | declare type HitSnippetResult = {
|
1809 | [attribute: string]: HitAttributeSnippetResult[] | HitSnippetResult[] | HitAttributeSnippetResult | HitSnippetResult;
|
1810 | };
|
1811 |
|
1812 | declare const hitsPerPage: HitsPerPageWidget;
|
1813 |
|
1814 | declare type HitsPerPageConnector = Connector<HitsPerPageWidgetDescription, HitsPerPageConnectorParams>;
|
1815 |
|
1816 | declare type HitsPerPageConnectorParams = {
|
1817 | |
1818 |
|
1819 |
|
1820 | items: HitsPerPageConnectorParamsItem[];
|
1821 | |
1822 |
|
1823 |
|
1824 | transformItems?: TransformItems<HitsPerPageRenderStateItem>;
|
1825 | };
|
1826 |
|
1827 | declare type HitsPerPageConnectorParamsItem = {
|
1828 | |
1829 |
|
1830 |
|
1831 | label: string;
|
1832 | |
1833 |
|
1834 |
|
1835 | value: number;
|
1836 | |
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 | default?: boolean;
|
1842 | };
|
1843 |
|
1844 | declare type HitsPerPageCSSClasses = Partial<{
|
1845 | |
1846 |
|
1847 |
|
1848 | root: string | string[];
|
1849 | |
1850 |
|
1851 |
|
1852 | select: string | string[];
|
1853 | |
1854 |
|
1855 |
|
1856 | option: string | string[];
|
1857 | }>;
|
1858 |
|
1859 | declare type HitsPerPageRenderState = {
|
1860 | |
1861 |
|
1862 |
|
1863 | items: HitsPerPageRenderStateItem[];
|
1864 | |
1865 |
|
1866 |
|
1867 | refine: (value: number) => void;
|
1868 | |
1869 |
|
1870 |
|
1871 | hasNoResults: boolean;
|
1872 | };
|
1873 |
|
1874 | declare type HitsPerPageRenderStateItem = {
|
1875 | |
1876 |
|
1877 |
|
1878 | label: string;
|
1879 | |
1880 |
|
1881 |
|
1882 | value: number;
|
1883 | |
1884 |
|
1885 |
|
1886 | isRefined: boolean;
|
1887 | };
|
1888 |
|
1889 | declare type HitsPerPageWidget = WidgetFactory<HitsPerPageWidgetDescription & {
|
1890 | $$widgetType: 'ais.hitsPerPage';
|
1891 | }, HitsPerPageConnectorParams, HitsPerPageWidgetParams>;
|
1892 |
|
1893 | declare type HitsPerPageWidgetDescription = {
|
1894 | $$type: 'ais.hitsPerPage';
|
1895 | renderState: HitsPerPageRenderState;
|
1896 | indexRenderState: {
|
1897 | hitsPerPage: WidgetRenderState<HitsPerPageRenderState, HitsPerPageConnectorParams>;
|
1898 | };
|
1899 | indexUiState: {
|
1900 | hitsPerPage: number;
|
1901 | };
|
1902 | };
|
1903 |
|
1904 | declare type HitsPerPageWidgetParams = {
|
1905 | |
1906 |
|
1907 |
|
1908 | container: string | HTMLElement;
|
1909 | |
1910 |
|
1911 |
|
1912 | cssClasses?: HitsPerPageCSSClasses;
|
1913 | };
|
1914 |
|
1915 | declare type HitsRenderState = {
|
1916 | |
1917 |
|
1918 |
|
1919 | hits: Hits;
|
1920 | |
1921 |
|
1922 |
|
1923 | results?: SearchResults<Hit>;
|
1924 | |
1925 |
|
1926 |
|
1927 | sendEvent: SendEventForHits;
|
1928 | |
1929 |
|
1930 |
|
1931 | bindEvent: BindEventForHits;
|
1932 | };
|
1933 |
|
1934 | declare type HitsTemplates = Partial<{
|
1935 | |
1936 |
|
1937 |
|
1938 |
|
1939 |
|
1940 | empty: Template;
|
1941 | |
1942 |
|
1943 |
|
1944 |
|
1945 |
|
1946 | item: TemplateWithBindEvent<Hit & {
|
1947 | __hitIndex: number;
|
1948 | }>;
|
1949 | }>;
|
1950 |
|
1951 | declare type HitsWidget = WidgetFactory<HitsWidgetDescription & {
|
1952 | $$widgetType: 'ais.hits';
|
1953 | }, HitsConnectorParams, HitsWidgetParams>;
|
1954 |
|
1955 | declare type HitsWidgetDescription = {
|
1956 | $$type: 'ais.hits';
|
1957 | renderState: HitsRenderState;
|
1958 | indexRenderState: {
|
1959 | hits: WidgetRenderState<HitsRenderState, HitsConnectorParams>;
|
1960 | };
|
1961 | };
|
1962 |
|
1963 | declare type HitsWidgetParams = {
|
1964 | |
1965 |
|
1966 |
|
1967 | container: string | HTMLElement;
|
1968 | |
1969 |
|
1970 |
|
1971 | templates?: HitsTemplates;
|
1972 | |
1973 |
|
1974 |
|
1975 | cssClasses?: HitsCSSClasses;
|
1976 | };
|
1977 |
|
1978 | declare type HTMLMarkerArguments = {
|
1979 | __id: string;
|
1980 | position: google.maps.LatLngLiteral;
|
1981 | map: google.maps.Map;
|
1982 | template: string;
|
1983 | title?: string;
|
1984 | className: string;
|
1985 | anchor?: {
|
1986 | x: number;
|
1987 | y: number;
|
1988 | };
|
1989 | };
|
1990 |
|
1991 | declare const index: (widgetParams: IndexWidgetParams) => IndexWidget;
|
1992 |
|
1993 | declare type IndexInitOptions = Pick<InitOptions, 'instantSearchInstance' | 'parent' | 'uiState'>;
|
1994 |
|
1995 | declare type IndexRenderOptions = Pick<RenderOptions, 'instantSearchInstance'>;
|
1996 |
|
1997 | declare type IndexRenderState = Partial<ConnectorRenderStates & WidgetRenderStates>;
|
1998 |
|
1999 | declare type IndexUiState = Partial<ConnectorUiStates & WidgetUiStates>;
|
2000 |
|
2001 | declare type IndexWidget = Omit<Widget<IndexWidgetDescription & {
|
2002 | widgetParams: IndexWidgetParams;
|
2003 | }>, 'getWidgetUiState' | 'getWidgetState'> & {
|
2004 | getIndexName(): string;
|
2005 | getIndexId(): string;
|
2006 | getHelper(): AlgoliaSearchHelper | null;
|
2007 | getResults(): SearchResults | null;
|
2008 | getScopedResults(): ScopedResult[];
|
2009 | getParent(): IndexWidget | null;
|
2010 | getWidgets(): Array<Widget | IndexWidget>;
|
2011 | createURL(state: SearchParameters): string;
|
2012 | addWidgets(widgets: Array<Widget | IndexWidget>): IndexWidget;
|
2013 | removeWidgets(widgets: Array<Widget | IndexWidget>): IndexWidget;
|
2014 | init(options: IndexInitOptions): void;
|
2015 | render(options: IndexRenderOptions): void;
|
2016 | dispose(): void;
|
2017 | |
2018 |
|
2019 |
|
2020 | getWidgetState(uiState: UiState): UiState;
|
2021 | getWidgetUiState<TUiState = UiState>(uiState: TUiState): TUiState;
|
2022 | getWidgetSearchParameters(searchParameters: SearchParameters, searchParametersOptions: {
|
2023 | uiState: IndexUiState;
|
2024 | }): SearchParameters;
|
2025 | refreshUiState(): void;
|
2026 | };
|
2027 |
|
2028 | declare type IndexWidgetDescription = {
|
2029 | $$type: 'ais.index';
|
2030 | $$widgetType: 'ais.index';
|
2031 | };
|
2032 |
|
2033 | declare type IndexWidgetParams = {
|
2034 | indexName: string;
|
2035 | indexId?: string;
|
2036 | };
|
2037 |
|
2038 | declare const infiniteHits: InfiniteHitsWidget;
|
2039 |
|
2040 | declare type InfiniteHitsCache = {
|
2041 | read: Read;
|
2042 | write: Write;
|
2043 | };
|
2044 |
|
2045 | declare type InfiniteHitsCachedHits = {
|
2046 | [page: number]: Hits;
|
2047 | };
|
2048 |
|
2049 | declare type InfiniteHitsConnector = Connector<InfiniteHitsWidgetDescription, InfiniteHitsConnectorParams>;
|
2050 |
|
2051 | declare type InfiniteHitsConnectorParams = {
|
2052 | |
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 | escapeHTML?: boolean;
|
2058 | |
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 | showPrevious?: boolean;
|
2064 | |
2065 |
|
2066 |
|
2067 |
|
2068 | transformItems?: TransformItems<Hit>;
|
2069 | |
2070 |
|
2071 |
|
2072 |
|
2073 |
|
2074 | cache?: InfiniteHitsCache;
|
2075 | };
|
2076 |
|
2077 | declare type InfiniteHitsCSSClasses = Partial<{
|
2078 | |
2079 |
|
2080 |
|
2081 | root: string | string[];
|
2082 | |
2083 |
|
2084 |
|
2085 | emptyRoot: string | string[];
|
2086 | |
2087 |
|
2088 |
|
2089 | list: string | string[];
|
2090 | |
2091 |
|
2092 |
|
2093 | item: string | string[];
|
2094 | |
2095 |
|
2096 |
|
2097 | loadPrevious: string | string[];
|
2098 | |
2099 |
|
2100 |
|
2101 | disabledLoadPrevious: string | string[];
|
2102 | |
2103 |
|
2104 |
|
2105 | loadMore: string | string[];
|
2106 | |
2107 |
|
2108 |
|
2109 | disabledLoadMore: string | string[];
|
2110 | }>;
|
2111 |
|
2112 | declare type InfiniteHitsRenderState = {
|
2113 | |
2114 |
|
2115 |
|
2116 | showPrevious: () => void;
|
2117 | |
2118 |
|
2119 |
|
2120 | showMore: () => void;
|
2121 | |
2122 |
|
2123 |
|
2124 | isFirstPage: boolean;
|
2125 | |
2126 |
|
2127 |
|
2128 | isLastPage: boolean;
|
2129 | |
2130 |
|
2131 |
|
2132 | sendEvent: SendEventForHits;
|
2133 | |
2134 |
|
2135 |
|
2136 | bindEvent: BindEventForHits;
|
2137 | |
2138 |
|
2139 |
|
2140 | currentPageHits: Hits;
|
2141 | |
2142 |
|
2143 |
|
2144 | hits: Hits;
|
2145 | |
2146 |
|
2147 |
|
2148 | results?: SearchResults<Hit>;
|
2149 | };
|
2150 |
|
2151 | declare type InfiniteHitsTemplates = Partial<{
|
2152 | |
2153 |
|
2154 |
|
2155 | empty: Template<{
|
2156 | results: SearchResults;
|
2157 | }>;
|
2158 | |
2159 |
|
2160 |
|
2161 | showPreviousText: Template;
|
2162 | |
2163 |
|
2164 |
|
2165 | showMoreText: Template;
|
2166 | |
2167 |
|
2168 |
|
2169 | item: TemplateWithBindEvent<Hit & {
|
2170 | __hitIndex: number;
|
2171 | }>;
|
2172 | }>;
|
2173 |
|
2174 | declare type InfiniteHitsWidget = WidgetFactory<InfiniteHitsWidgetDescription & {
|
2175 | $$widgetType: 'ais.infiniteHits';
|
2176 | }, InfiniteHitsConnectorParams, InfiniteHitsWidgetParams>;
|
2177 |
|
2178 | declare type InfiniteHitsWidgetDescription = {
|
2179 | $$type: 'ais.infiniteHits';
|
2180 | renderState: InfiniteHitsRenderState;
|
2181 | indexRenderState: {
|
2182 | infiniteHits: WidgetRenderState<InfiniteHitsRenderState, InfiniteHitsConnectorParams>;
|
2183 | };
|
2184 | indexUiState: {
|
2185 | page: number;
|
2186 | };
|
2187 | };
|
2188 |
|
2189 | declare type InfiniteHitsWidgetParams = {
|
2190 | |
2191 |
|
2192 |
|
2193 | container: string | HTMLElement;
|
2194 | |
2195 |
|
2196 |
|
2197 | cssClasses?: InfiniteHitsCSSClasses;
|
2198 | |
2199 |
|
2200 |
|
2201 | templates?: InfiniteHitsTemplates;
|
2202 | |
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 | cache?: InfiniteHitsCache;
|
2208 | };
|
2209 |
|
2210 | declare type InitialResult = {
|
2211 | state: PlainSearchParameters;
|
2212 | results: SearchResults['_rawResults'];
|
2213 | };
|
2214 |
|
2215 | declare type InitialResults = Record<string, InitialResult>;
|
2216 |
|
2217 | declare type InitOptions = SharedRenderOptions & {
|
2218 | uiState: UiState;
|
2219 | results?: undefined;
|
2220 | };
|
2221 |
|
2222 |
|
2223 |
|
2224 |
|
2225 | declare function insights(method: InsightsClientMethod, payload: Partial<InsightsClientPayload>): string;
|
2226 |
|
2227 | declare type InsightsClient = InsightsClient_2 & {
|
2228 | queue?: QueueItem[];
|
2229 | };
|
2230 |
|
2231 | declare type InsightsClientMethod = keyof InsightsMethodMap;
|
2232 |
|
2233 | declare type InsightsClientPayload = {
|
2234 | eventName: string;
|
2235 | queryID: string;
|
2236 | index: string;
|
2237 | objectIDs: string[];
|
2238 | positions?: number[];
|
2239 | };
|
2240 |
|
2241 | declare type InsightsEvent = {
|
2242 | insightsMethod?: InsightsClientMethod;
|
2243 | payload: any;
|
2244 | widgetType: string;
|
2245 | eventType: string;
|
2246 | hits?: Hit[];
|
2247 | attribute?: string;
|
2248 | };
|
2249 |
|
2250 | declare type InsightsProps = {
|
2251 | insightsClient: null | InsightsClient;
|
2252 | insightsInitParams?: {
|
2253 | userHasOptedOut?: boolean;
|
2254 | useCookie?: boolean;
|
2255 | cookieDuration?: number;
|
2256 | region?: 'de' | 'us';
|
2257 | };
|
2258 | onEvent?: (event: InsightsEvent, insightsClient: null | InsightsClient) => void;
|
2259 | };
|
2260 |
|
2261 |
|
2262 |
|
2263 |
|
2264 |
|
2265 |
|
2266 | declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TUiState> extends EventEmitter {
|
2267 | client: InstantSearchOptions['searchClient'];
|
2268 | indexName: string;
|
2269 | insightsClient: InsightsClient | null;
|
2270 | onStateChange: InstantSearchOptions['onStateChange'] | null;
|
2271 | helper: AlgoliaSearchHelper | null;
|
2272 | mainHelper: AlgoliaSearchHelper | null;
|
2273 | mainIndex: IndexWidget;
|
2274 | started: boolean;
|
2275 | templatesConfig: Record<string, unknown>;
|
2276 | renderState: RenderState;
|
2277 | _stalledSearchDelay: number;
|
2278 | _searchStalledTimer: any;
|
2279 | _isSearchStalled: boolean;
|
2280 | _initialUiState: UiState;
|
2281 | _initialResults: InitialResults | null;
|
2282 | _createURL: CreateURL<UiState>;
|
2283 | _searchFunction?: InstantSearchOptions['searchFunction'];
|
2284 | _mainHelperSearch?: AlgoliaSearchHelper['search'];
|
2285 | middleware: Array<{
|
2286 | creator: Middleware;
|
2287 | instance: MiddlewareDefinition;
|
2288 | }>;
|
2289 | sendEventToInsights: (event: InsightsEvent) => void;
|
2290 | constructor(options: InstantSearchOptions<TUiState, TRouteState>);
|
2291 | /**
|
2292 | * Hooks a middleware into the InstantSearch lifecycle.
|
2293 | */
|
2294 | use(...middleware: Middleware[]): this;
|
2295 | /**
|
2296 | * Removes a middleware from the InstantSearch lifecycle.
|
2297 | */
|
2298 | unuse(...middlewareToUnuse: Middleware[]): this;
|
2299 | EXPERIMENTAL_use(...middleware: Middleware[]): this;
|
2300 | /**
|
2301 | * Adds a widget to the search instance.
|
2302 | * A widget can be added either before or after InstantSearch has started.
|
2303 | * @param widget The widget to add to InstantSearch.
|
2304 | *
|
2305 | * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `addWidgets([widget])`.
|
2306 | */
|
2307 | addWidget(widget: Widget): this;
|
2308 | /**
|
2309 | * Adds multiple widgets to the search instance.
|
2310 | * Widgets can be added either before or after InstantSearch has started.
|
2311 | * @param widgets The array of widgets to add to InstantSearch.
|
2312 | */
|
2313 | addWidgets(widgets: Array<Widget | IndexWidget>): this;
|
2314 | /**
|
2315 | * Removes a widget from the search instance.
|
2316 | * @deprecated This method will still be supported in 4.x releases, but not further. It is replaced by `removeWidgets([widget])`
|
2317 | * @param widget The widget instance to remove from InstantSearch.
|
2318 | *
|
2319 | * The widget must implement a `dispose()` method to clear its state.
|
2320 | */
|
2321 | removeWidget(widget: Widget | IndexWidget): this;
|
2322 | /**
|
2323 | * Removes multiple widgets from the search instance.
|
2324 | * @param widgets Array of widgets instances to remove from InstantSearch.
|
2325 | *
|
2326 | * The widgets must implement a `dispose()` method to clear their states.
|
2327 | */
|
2328 | removeWidgets(widgets: Array<Widget | IndexWidget>): this;
|
2329 | /**
|
2330 | * Ends the initialization of InstantSearch.js and triggers the
|
2331 | * first search. This method should be called after all widgets have been added
|
2332 | * to the instance of InstantSearch.js. InstantSearch.js also supports adding and removing
|
2333 | * widgets after the start as an **EXPERIMENTAL** feature.
|
2334 | */
|
2335 | start(): void;
|
2336 | /**
|
2337 | * Removes all widgets without triggering a search afterwards. This is an **EXPERIMENTAL** feature,
|
2338 | * if you find an issue with it, please
|
2339 | * [open an issue](https:
|
2340 | * @return {undefined} This method does not return anything
|
2341 | */
|
2342 | dispose(): void;
|
2343 | scheduleSearch: ((...args: any[]) => void) & {
|
2344 | wait(): Promise<void>;
|
2345 | cancel(): void;
|
2346 | };
|
2347 | scheduleRender: ((...args: any[]) => void) & {
|
2348 | wait(): Promise<void>;
|
2349 | cancel(): void;
|
2350 | };
|
2351 | scheduleStalledRender(): void;
|
2352 | setUiState(uiState: UiState | ((previousUiState: UiState) => UiState)): void;
|
2353 | getUiState(): UiState;
|
2354 | onInternalStateChange: ((...args: any[]) => void) & {
|
2355 | wait(): Promise<void>;
|
2356 | cancel(): void;
|
2357 | };
|
2358 | createURL(nextState?: UiState): string;
|
2359 | refresh(): void;
|
2360 | }
|
2361 |
|
2362 |
|
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 |
|
2372 |
|
2373 |
|
2374 |
|
2375 |
|
2376 |
|
2377 | declare const instantsearch: InstantSearchModule;
|
2378 | export default instantsearch;
|
2379 |
|
2380 | declare type InstantSearchModule = {
|
2381 | <TUiState = Record<string, unknown>, TRouteState = TUiState>(options: InstantSearchOptions<Expand<UiState & TUiState>, TRouteState>): InstantSearch<Expand<UiState & TUiState>, TRouteState>;
|
2382 | version: string;
|
2383 | connectors: typeof connectors;
|
2384 | widgets: typeof widgets;
|
2385 | middlewares: typeof middlewares;
|
2386 | routers: typeof routers;
|
2387 | stateMappings: typeof stateMappings;
|
2388 | createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;
|
2389 | highlight: typeof helpers.highlight;
|
2390 | reverseHighlight: typeof helpers.reverseHighlight;
|
2391 | snippet: typeof helpers.snippet;
|
2392 | reverseSnippet: typeof helpers.reverseSnippet;
|
2393 | insights: typeof helpers.insights;
|
2394 | };
|
2395 |
|
2396 |
|
2397 |
|
2398 |
|
2399 | declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteState = TUiState> = {
|
2400 | |
2401 |
|
2402 |
|
2403 | indexName: string;
|
2404 | |
2405 |
|
2406 |
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 |
|
2425 |
|
2426 |
|
2427 |
|
2428 |
|
2429 |
|
2430 |
|
2431 | searchClient: SearchClient;
|
2432 | |
2433 |
|
2434 |
|
2435 |
|
2436 | numberLocale?: string;
|
2437 | |
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 | searchFunction?: (helper: AlgoliaSearchHelper) => void;
|
2443 | |
2444 |
|
2445 |
|
2446 |
|
2447 |
|
2448 |
|
2449 | onStateChange?: (params: {
|
2450 | uiState: UiState;
|
2451 | setUiState(uiState: UiState | ((previousUiState: UiState) => UiState)): void;
|
2452 | }) => void;
|
2453 | |
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 | initialUiState?: TUiState;
|
2460 | |
2461 |
|
2462 |
|
2463 | stalledSearchDelay?: number;
|
2464 | |
2465 |
|
2466 |
|
2467 |
|
2468 | routing?: RouterProps<TUiState, TRouteState> | boolean;
|
2469 | |
2470 |
|
2471 |
|
2472 |
|
2473 |
|
2474 |
|
2475 | insightsClient?: InsightsClient;
|
2476 | };
|
2477 |
|
2478 | declare type InternalMiddleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => MiddlewareDefinition<TUiState>;
|
2479 |
|
2480 | declare function isMetadataEnabled(): boolean;
|
2481 |
|
2482 | declare type MatchingPatterns = {
|
2483 | [attribute: string]: {
|
2484 | |
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 | score: number;
|
2490 | };
|
2491 | };
|
2492 |
|
2493 | declare const menu: MenuWidget;
|
2494 |
|
2495 | declare type MenuConnector = Connector<MenuWidgetDescription, MenuConnectorParams>;
|
2496 |
|
2497 | declare type MenuConnectorParams = {
|
2498 | |
2499 |
|
2500 |
|
2501 | attribute: string;
|
2502 | |
2503 |
|
2504 |
|
2505 | limit?: number;
|
2506 | |
2507 |
|
2508 |
|
2509 | showMore?: boolean;
|
2510 | |
2511 |
|
2512 |
|
2513 | showMoreLimit?: number;
|
2514 | |
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 | sortBy?: SortBy<MenuItem>;
|
2522 | |
2523 |
|
2524 |
|
2525 | transformItems?: TransformItems<MenuItem>;
|
2526 | };
|
2527 |
|
2528 | declare type MenuCSSClasses = Partial<{
|
2529 | |
2530 |
|
2531 |
|
2532 | root: string | string[];
|
2533 | |
2534 |
|
2535 |
|
2536 | noRefinementRoot: string | string[];
|
2537 | |
2538 |
|
2539 |
|
2540 | list: string | string[];
|
2541 | |
2542 |
|
2543 |
|
2544 | item: string | string[];
|
2545 | |
2546 |
|
2547 |
|
2548 | selectedItem: string | string[];
|
2549 | |
2550 |
|
2551 |
|
2552 | link: string | string[];
|
2553 | |
2554 |
|
2555 |
|
2556 | label: string | string[];
|
2557 | |
2558 |
|
2559 |
|
2560 | count: string | string[];
|
2561 | |
2562 |
|
2563 |
|
2564 | showMore: string | string[];
|
2565 | |
2566 |
|
2567 |
|
2568 | disabledShowMore: string | string[];
|
2569 | }>;
|
2570 |
|
2571 | declare type MenuItem = {
|
2572 | |
2573 |
|
2574 |
|
2575 | value: string;
|
2576 | |
2577 |
|
2578 |
|
2579 | label: string;
|
2580 | |
2581 |
|
2582 |
|
2583 | count: number;
|
2584 | |
2585 |
|
2586 |
|
2587 | isRefined: boolean;
|
2588 | };
|
2589 |
|
2590 | declare type MenuRenderState = {
|
2591 | |
2592 |
|
2593 |
|
2594 | items: MenuItem[];
|
2595 | |
2596 |
|
2597 |
|
2598 | createURL: CreateURL<string>;
|
2599 | |
2600 |
|
2601 |
|
2602 | refine(value: string): void;
|
2603 | |
2604 |
|
2605 |
|
2606 | canRefine: boolean;
|
2607 | |
2608 |
|
2609 |
|
2610 | isShowingMore: boolean;
|
2611 | |
2612 |
|
2613 |
|
2614 | toggleShowMore(): void;
|
2615 | |
2616 |
|
2617 |
|
2618 |
|
2619 | canToggleShowMore: boolean;
|
2620 | |
2621 |
|
2622 |
|
2623 | sendEvent: SendEventForFacet;
|
2624 | };
|
2625 |
|
2626 | declare const menuSelect: MenuSelectWidget;
|
2627 |
|
2628 | declare type MenuSelectCSSClasses = Partial<{
|
2629 | |
2630 |
|
2631 |
|
2632 | root: string | string[];
|
2633 | |
2634 |
|
2635 |
|
2636 | noRefinementRoot: string | string[];
|
2637 | |
2638 |
|
2639 |
|
2640 | select: string | string[];
|
2641 | |
2642 |
|
2643 |
|
2644 | option: string | string[];
|
2645 | }>;
|
2646 |
|
2647 | declare type MenuSelectTemplates = Partial<{
|
2648 | |
2649 |
|
2650 |
|
2651 | item: Template<{
|
2652 | label: string;
|
2653 | value: string;
|
2654 | count: number;
|
2655 | isRefined: boolean;
|
2656 | }>;
|
2657 | |
2658 |
|
2659 |
|
2660 | defaultOption: Template;
|
2661 | }>;
|
2662 |
|
2663 | declare type MenuSelectWidget = WidgetFactory<MenuWidgetDescription & {
|
2664 | $$widgetType: 'ais.menuSelect';
|
2665 | }, MenuConnectorParams, MenuSelectWidgetParams>;
|
2666 |
|
2667 | declare type MenuSelectWidgetParams = {
|
2668 | |
2669 |
|
2670 |
|
2671 | container: string | HTMLElement;
|
2672 | |
2673 |
|
2674 |
|
2675 | templates?: MenuSelectTemplates;
|
2676 | |
2677 |
|
2678 |
|
2679 | cssClasses?: MenuSelectCSSClasses;
|
2680 | };
|
2681 |
|
2682 | declare type MenuTemplates = Partial<{
|
2683 | |
2684 |
|
2685 |
|
2686 | item: Template<{
|
2687 | count: number;
|
2688 | cssClasses: MenuCSSClasses;
|
2689 | isRefined: boolean;
|
2690 | label: string;
|
2691 | url: string;
|
2692 | value: string;
|
2693 | }>;
|
2694 | |
2695 |
|
2696 |
|
2697 | showMoreText: Template<{
|
2698 | isShowingMore: boolean;
|
2699 | }>;
|
2700 | }>;
|
2701 |
|
2702 | declare type MenuWidget = WidgetFactory<MenuWidgetDescription & {
|
2703 | $$widgetType: 'ais.menu';
|
2704 | }, MenuConnectorParams, MenuWidgetParams>;
|
2705 |
|
2706 | declare type MenuWidgetDescription = {
|
2707 | $$type: 'ais.menu';
|
2708 | renderState: MenuRenderState;
|
2709 | indexRenderState: {
|
2710 | menu: {
|
2711 | [attribute: string]: WidgetRenderState<MenuRenderState, MenuConnectorParams>;
|
2712 | };
|
2713 | };
|
2714 | indexUiState: {
|
2715 | menu: {
|
2716 | [attribute: string]: string;
|
2717 | };
|
2718 | };
|
2719 | };
|
2720 |
|
2721 | declare type MenuWidgetParams = {
|
2722 | |
2723 |
|
2724 |
|
2725 | container: string | HTMLElement;
|
2726 | |
2727 |
|
2728 |
|
2729 | templates?: MenuTemplates;
|
2730 | |
2731 |
|
2732 |
|
2733 | cssClasses?: MenuCSSClasses;
|
2734 | };
|
2735 |
|
2736 | declare type Middleware = (options: MiddlewareOptions) => AtLeastOne<MiddlewareDefinition>;
|
2737 |
|
2738 | declare type MiddlewareDefinition<TUiState extends UiState = UiState> = {
|
2739 | onStateChange(options: {
|
2740 | uiState: TUiState;
|
2741 | }): void;
|
2742 | subscribe(): void;
|
2743 | unsubscribe(): void;
|
2744 | };
|
2745 |
|
2746 | declare type MiddlewareOptions = {
|
2747 | instantSearchInstance: InstantSearch;
|
2748 | };
|
2749 |
|
2750 | declare namespace middlewares {
|
2751 | export {
|
2752 | InsightsEvent,
|
2753 | InsightsProps,
|
2754 | CreateInsightsMiddleware,
|
2755 | createInsightsMiddleware,
|
2756 | RouterProps,
|
2757 | createRouterMiddleware,
|
2758 | isMetadataEnabled,
|
2759 | createMetadataMiddleware
|
2760 | }
|
2761 | }
|
2762 |
|
2763 | declare const numericMenu: NumericMenuWidget;
|
2764 |
|
2765 | declare type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;
|
2766 |
|
2767 | declare type NumericMenuConnector = Connector<NumericMenuWidgetDescription, NumericMenuConnectorParams>;
|
2768 |
|
2769 | declare type NumericMenuConnectorParams = {
|
2770 | |
2771 |
|
2772 |
|
2773 | attribute: string;
|
2774 | |
2775 |
|
2776 |
|
2777 | items: NumericMenuConnectorParamsItem[];
|
2778 | |
2779 |
|
2780 |
|
2781 | transformItems?: TransformItems<NumericMenuRenderStateItem>;
|
2782 | };
|
2783 |
|
2784 | declare type NumericMenuConnectorParamsItem = {
|
2785 | |
2786 |
|
2787 |
|
2788 | label: string;
|
2789 | |
2790 |
|
2791 |
|
2792 | start?: number;
|
2793 | |
2794 |
|
2795 |
|
2796 | end?: number;
|
2797 | };
|
2798 |
|
2799 | declare type NumericMenuCSSClasses = Partial<{
|
2800 | |
2801 |
|
2802 |
|
2803 | root: string | string[];
|
2804 | |
2805 |
|
2806 |
|
2807 | noRefinementRoot: string | string[];
|
2808 | |
2809 |
|
2810 |
|
2811 | list: string | string[];
|
2812 | |
2813 |
|
2814 |
|
2815 | item: string | string[];
|
2816 | |
2817 |
|
2818 |
|
2819 | selectedItem: string | string[];
|
2820 | |
2821 |
|
2822 |
|
2823 | label: string | string[];
|
2824 | |
2825 |
|
2826 |
|
2827 | labelText: string | string[];
|
2828 | |
2829 |
|
2830 |
|
2831 | radio: string | string[];
|
2832 | }>;
|
2833 |
|
2834 | declare type NumericMenuRenderState = {
|
2835 | |
2836 |
|
2837 |
|
2838 | items: NumericMenuRenderStateItem[];
|
2839 | |
2840 |
|
2841 |
|
2842 | createURL: CreateURL<NumericMenuRenderStateItem['value']>;
|
2843 | |
2844 |
|
2845 |
|
2846 | hasNoResults: boolean;
|
2847 | |
2848 |
|
2849 |
|
2850 | refine: (facetValue: string) => void;
|
2851 | |
2852 |
|
2853 |
|
2854 | sendEvent: SendEventForFacet;
|
2855 | };
|
2856 |
|
2857 | declare type NumericMenuRenderStateItem = {
|
2858 | |
2859 |
|
2860 |
|
2861 | label: string;
|
2862 | |
2863 |
|
2864 |
|
2865 |
|
2866 |
|
2867 |
|
2868 | value: string;
|
2869 | |
2870 |
|
2871 |
|
2872 | isRefined: boolean;
|
2873 | };
|
2874 |
|
2875 | declare type NumericMenuTemplates = Partial<{
|
2876 | |
2877 |
|
2878 |
|
2879 | item: Template<{
|
2880 | |
2881 |
|
2882 |
|
2883 | attribute: string;
|
2884 | |
2885 |
|
2886 |
|
2887 | label: string;
|
2888 | |
2889 |
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 | value: string;
|
2895 | |
2896 |
|
2897 |
|
2898 | isRefined: boolean;
|
2899 | |
2900 |
|
2901 |
|
2902 | url: string;
|
2903 | |
2904 |
|
2905 |
|
2906 | cssClasses: NumericMenuComponentCSSClasses;
|
2907 | }>;
|
2908 | }>;
|
2909 |
|
2910 | declare type NumericMenuWidget = WidgetFactory<NumericMenuWidgetDescription & {
|
2911 | $$widgetType: 'ais.numericMenu';
|
2912 | }, NumericMenuConnectorParams, NumericMenuWidgetParams>;
|
2913 |
|
2914 | declare type NumericMenuWidgetDescription = {
|
2915 | $$type: 'ais.numericMenu';
|
2916 | renderState: NumericMenuRenderState;
|
2917 | indexRenderState: {
|
2918 | numericMenu: {
|
2919 | [attribute: string]: WidgetRenderState<NumericMenuRenderState, NumericMenuConnectorParams>;
|
2920 | };
|
2921 | };
|
2922 | indexUiState: {
|
2923 | numericMenu: {
|
2924 | [attribute: string]: string;
|
2925 | };
|
2926 | };
|
2927 | };
|
2928 |
|
2929 | declare type NumericMenuWidgetParams = {
|
2930 | |
2931 |
|
2932 |
|
2933 | container: string | HTMLElement;
|
2934 | |
2935 |
|
2936 |
|
2937 | templates?: NumericMenuTemplates;
|
2938 | |
2939 |
|
2940 |
|
2941 | cssClasses?: NumericMenuCSSClasses;
|
2942 | };
|
2943 |
|
2944 | declare const pagination: PaginationWidget;
|
2945 |
|
2946 | declare type PaginationConnector = Connector<PaginationWidgetDescription, PaginationConnectorParams>;
|
2947 |
|
2948 | declare type PaginationConnectorParams = {
|
2949 | |
2950 |
|
2951 |
|
2952 | totalPages?: number;
|
2953 | |
2954 |
|
2955 |
|
2956 |
|
2957 | padding?: number;
|
2958 | };
|
2959 |
|
2960 | declare type PaginationCSSClasses = Partial<{
|
2961 | |
2962 |
|
2963 |
|
2964 | root: string | string[];
|
2965 | |
2966 |
|
2967 |
|
2968 | noRefinementRoot: string | string[];
|
2969 | |
2970 |
|
2971 |
|
2972 | list: string | string[];
|
2973 | |
2974 |
|
2975 |
|
2976 | item: string | string[];
|
2977 | |
2978 |
|
2979 |
|
2980 | firstPageItem: string | string[];
|
2981 | |
2982 |
|
2983 |
|
2984 | lastPageItem: string | string[];
|
2985 | |
2986 |
|
2987 |
|
2988 | previousPageItem: string | string[];
|
2989 | |
2990 |
|
2991 |
|
2992 | nextPageItem: string | string[];
|
2993 | |
2994 |
|
2995 |
|
2996 | pageItem: string | string[];
|
2997 | |
2998 |
|
2999 |
|
3000 | selectedItem: string | string[];
|
3001 | |
3002 |
|
3003 |
|
3004 | disabledItem: string | string[];
|
3005 | |
3006 |
|
3007 |
|
3008 | link: string | string[];
|
3009 | }>;
|
3010 |
|
3011 | declare type PaginationRenderState = {
|
3012 |
|
3013 | createURL: CreateURL<number>;
|
3014 |
|
3015 | refine(page: number): void;
|
3016 |
|
3017 | canRefine: boolean;
|
3018 |
|
3019 | currentRefinement: number;
|
3020 |
|
3021 | nbHits: number;
|
3022 |
|
3023 | nbPages: number;
|
3024 |
|
3025 | pages: number[];
|
3026 |
|
3027 | isFirstPage: boolean;
|
3028 |
|
3029 | isLastPage: boolean;
|
3030 | };
|
3031 |
|
3032 | declare type PaginationTemplates = Partial<{
|
3033 | |
3034 |
|
3035 |
|
3036 | previous: string;
|
3037 | |
3038 |
|
3039 |
|
3040 | next: string;
|
3041 | |
3042 |
|
3043 |
|
3044 | first: string;
|
3045 | |
3046 |
|
3047 |
|
3048 | last: string;
|
3049 | }>;
|
3050 |
|
3051 | declare type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {
|
3052 | $$widgetType: 'ais.pagination';
|
3053 | }, PaginationConnectorParams, PaginationWidgetParams>;
|
3054 |
|
3055 | declare type PaginationWidgetDescription = {
|
3056 | $$type: 'ais.pagination';
|
3057 | renderState: PaginationRenderState;
|
3058 | indexRenderState: {
|
3059 | pagination: WidgetRenderState<PaginationRenderState, PaginationConnectorParams>;
|
3060 | };
|
3061 | indexUiState: {
|
3062 | page: number;
|
3063 | };
|
3064 | };
|
3065 |
|
3066 | declare type PaginationWidgetParams = {
|
3067 | |
3068 |
|
3069 |
|
3070 | container: string | HTMLElement;
|
3071 | |
3072 |
|
3073 |
|
3074 | totalPages?: number;
|
3075 | |
3076 |
|
3077 |
|
3078 |
|
3079 | padding?: number;
|
3080 | |
3081 |
|
3082 |
|
3083 |
|
3084 | scrollTo?: string | HTMLElement | boolean;
|
3085 | |
3086 |
|
3087 |
|
3088 |
|
3089 | showFirst?: boolean;
|
3090 | |
3091 |
|
3092 |
|
3093 |
|
3094 | showLast?: boolean;
|
3095 | |
3096 |
|
3097 |
|
3098 |
|
3099 | showNext?: boolean;
|
3100 | |
3101 |
|
3102 |
|
3103 |
|
3104 | showPrevious?: boolean;
|
3105 | |
3106 |
|
3107 |
|
3108 | templates?: PaginationTemplates;
|
3109 | |
3110 |
|
3111 |
|
3112 | cssClasses?: PaginationCSSClasses;
|
3113 | };
|
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 | declare const panel: PanelWidget;
|
3120 |
|
3121 | declare type PanelCSSClasses = Partial<{
|
3122 | |
3123 |
|
3124 |
|
3125 | root: string | string[];
|
3126 | |
3127 |
|
3128 |
|
3129 | noRefinementRoot: string | string[];
|
3130 | |
3131 |
|
3132 |
|
3133 | collapsibleRoot: string | string[];
|
3134 | |
3135 |
|
3136 |
|
3137 | collapsedRoot: string | string[];
|
3138 | |
3139 |
|
3140 |
|
3141 | collapseButton: string | string[];
|
3142 | |
3143 |
|
3144 |
|
3145 | collapseIcon: string | string[];
|
3146 | |
3147 |
|
3148 |
|
3149 | header: string | string[];
|
3150 | |
3151 |
|
3152 |
|
3153 | body: string | string[];
|
3154 | |
3155 |
|
3156 |
|
3157 | footer: string | string[];
|
3158 | }>;
|
3159 |
|
3160 | declare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;
|
3161 |
|
3162 | declare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{
|
3163 | |
3164 |
|
3165 |
|
3166 | header: Template<PanelRenderOptions<TWidget>>;
|
3167 | |
3168 |
|
3169 |
|
3170 | footer: Template<PanelRenderOptions<TWidget>>;
|
3171 | |
3172 |
|
3173 |
|
3174 | collapseButtonText: Template<{
|
3175 | collapsed: boolean;
|
3176 | }>;
|
3177 | }>;
|
3178 |
|
3179 | declare type PanelWidget = <TWidgetFactory extends AnyWidgetFactory>(panelWidgetParams?: PanelWidgetParams<TWidgetFactory>) => (widgetFactory: TWidgetFactory) => (widgetParams: Parameters<TWidgetFactory>[0]) => AugmentedWidget<TWidgetFactory>;
|
3180 |
|
3181 | declare type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {
|
3182 | |
3183 |
|
3184 |
|
3185 |
|
3186 | hidden?(options: PanelRenderOptions<TWidgetFactory>): boolean;
|
3187 | |
3188 |
|
3189 |
|
3190 |
|
3191 | collapsed?(options: PanelRenderOptions<TWidgetFactory>): boolean;
|
3192 | |
3193 |
|
3194 |
|
3195 | templates?: PanelTemplates<TWidgetFactory>;
|
3196 | |
3197 |
|
3198 |
|
3199 | cssClasses?: PanelCSSClasses;
|
3200 | };
|
3201 |
|
3202 | declare type ParamTrackedFilters = {
|
3203 | [facetName: string]: (facetValues: TrackedFilterRefinement[]) => TrackedFilterRefinement[];
|
3204 | };
|
3205 |
|
3206 | declare type ParamTransformItems = TransformItems<any>;
|
3207 |
|
3208 | declare type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];
|
3209 |
|
3210 | declare type ParseURL<TRouteState> = (args: {
|
3211 | qsModule: typeof qs_2;
|
3212 | location: Location;
|
3213 | }) => TRouteState;
|
3214 |
|
3215 | declare type PlacesInstance = Places.PlacesInstance;
|
3216 |
|
3217 | declare type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 | declare const placesWidget: PlacesWidget;
|
3224 |
|
3225 | declare type PlacesWidgetDescription = {
|
3226 | $$type: 'ais.places';
|
3227 | $$widgetType: 'ais.places';
|
3228 | renderState: Record<string, unknown>;
|
3229 | indexRenderState: {
|
3230 | places: WidgetRenderState<Record<string, unknown>, PlacesWidgetParams>;
|
3231 | };
|
3232 | indexUiState: {
|
3233 | places: {
|
3234 | query: string;
|
3235 | position: string;
|
3236 | };
|
3237 | };
|
3238 | };
|
3239 |
|
3240 | declare type PlacesWidgetParams = {
|
3241 | |
3242 |
|
3243 |
|
3244 |
|
3245 |
|
3246 | placesReference: (options: StaticOptions & ReconfigurableOptions) => PlacesInstance;
|
3247 | |
3248 |
|
3249 |
|
3250 | defaultPosition?: string[];
|
3251 | } & StaticOptions;
|
3252 |
|
3253 | declare const poweredBy: PoweredByWidget;
|
3254 |
|
3255 | declare type PoweredByConnector = Connector<PoweredByWidgetDescription, PoweredByConnectorParams>;
|
3256 |
|
3257 | declare type PoweredByConnectorParams = {
|
3258 |
|
3259 | url?: string;
|
3260 | };
|
3261 |
|
3262 | declare type PoweredByCSSClasses = Partial<{
|
3263 | |
3264 |
|
3265 |
|
3266 | root: string | string[];
|
3267 | |
3268 |
|
3269 |
|
3270 | link: string | string[];
|
3271 | |
3272 |
|
3273 |
|
3274 | logo: string | string[];
|
3275 | }>;
|
3276 |
|
3277 | declare type PoweredByRenderState = {
|
3278 |
|
3279 | url: string;
|
3280 | };
|
3281 |
|
3282 | declare type PoweredByWidget = WidgetFactory<PoweredByWidgetDescription & {
|
3283 | $$widgetType: 'ais.poweredBy';
|
3284 | }, PoweredByConnectorParams, PoweredByWidgetParams>;
|
3285 |
|
3286 | declare type PoweredByWidgetDescription = {
|
3287 | $$type: 'ais.poweredBy';
|
3288 | renderState: PoweredByRenderState;
|
3289 | indexRenderState: {
|
3290 | poweredBy: WidgetRenderState<PoweredByRenderState, PoweredByConnectorParams>;
|
3291 | };
|
3292 | };
|
3293 |
|
3294 | declare type PoweredByWidgetParams = {
|
3295 | |
3296 |
|
3297 |
|
3298 | container: string | HTMLElement;
|
3299 | |
3300 |
|
3301 |
|
3302 |
|
3303 | theme?: 'light' | 'dark';
|
3304 | |
3305 |
|
3306 |
|
3307 | cssClasses?: PoweredByCSSClasses;
|
3308 | };
|
3309 |
|
3310 | declare const queryRuleContext: QueryRuleContextWidget;
|
3311 |
|
3312 | declare type QueryRuleContextWidget = WidgetFactory<QueryRulesWidgetDescription & {
|
3313 | $$widgetType: 'ais.queryRuleContext';
|
3314 | }, QueryRulesConnectorParams, QueryRuleContextWidgetParams>;
|
3315 |
|
3316 | declare type QueryRuleContextWidgetParams = {
|
3317 | trackedFilters: ParamTrackedFilters;
|
3318 | transformRuleContexts?: ParamTransformRuleContexts;
|
3319 | };
|
3320 |
|
3321 | declare const queryRuleCustomData: QueryRuleCustomDataWidget;
|
3322 |
|
3323 | declare type QueryRuleCustomDataCSSClasses = Partial<{
|
3324 | root: string | string[];
|
3325 | }>;
|
3326 |
|
3327 | declare type QueryRuleCustomDataTemplates = Partial<{
|
3328 | default: Template<{
|
3329 | items: any[];
|
3330 | }>;
|
3331 | }>;
|
3332 |
|
3333 | declare type QueryRuleCustomDataWidget = WidgetFactory<QueryRulesWidgetDescription & {
|
3334 | $$widgetType: 'ais.queryRuleCustomData';
|
3335 | }, QueryRulesConnectorParams, QueryRuleCustomDataWidgetParams>;
|
3336 |
|
3337 | declare type QueryRuleCustomDataWidgetParams = {
|
3338 | container: string | HTMLElement;
|
3339 | cssClasses?: QueryRuleCustomDataCSSClasses;
|
3340 | templates?: QueryRuleCustomDataTemplates;
|
3341 | };
|
3342 |
|
3343 | declare type QueryRulesConnector = Connector<QueryRulesWidgetDescription, QueryRulesConnectorParams>;
|
3344 |
|
3345 | declare type QueryRulesConnectorParams = {
|
3346 | trackedFilters?: ParamTrackedFilters;
|
3347 | transformRuleContexts?: ParamTransformRuleContexts;
|
3348 | transformItems?: ParamTransformItems;
|
3349 | };
|
3350 |
|
3351 | declare type QueryRulesRenderState = {
|
3352 | items: any[];
|
3353 | };
|
3354 |
|
3355 | declare type QueryRulesWidgetDescription = {
|
3356 | $$type: 'ais.queryRules';
|
3357 | renderState: QueryRulesRenderState;
|
3358 | indexRenderState: {
|
3359 | queryRules: WidgetRenderState<QueryRulesRenderState, QueryRulesConnectorParams>;
|
3360 | };
|
3361 | };
|
3362 |
|
3363 | declare type QueueItem = QueueItemMap[keyof QueueItemMap];
|
3364 |
|
3365 | declare type QueueItemMap = {
|
3366 | [MethodName in keyof InsightsMethodMap]: [
|
3367 | methodName: MethodName,
|
3368 | ...args: InsightsMethodMap[MethodName]
|
3369 | ];
|
3370 | };
|
3371 |
|
3372 | declare type Range_2 = {
|
3373 | min: RangeMin;
|
3374 | max: RangeMax;
|
3375 | };
|
3376 |
|
3377 | declare type RangeBoundaries = [RangeMin, RangeMax];
|
3378 |
|
3379 | declare type RangeConnector = Connector<RangeWidgetDescription, RangeConnectorParams>;
|
3380 |
|
3381 | declare type RangeConnectorParams = {
|
3382 | |
3383 |
|
3384 |
|
3385 | attribute: string;
|
3386 | |
3387 |
|
3388 |
|
3389 | min?: number;
|
3390 | |
3391 |
|
3392 |
|
3393 | max?: number;
|
3394 | |
3395 |
|
3396 |
|
3397 | precision?: number;
|
3398 | };
|
3399 |
|
3400 | declare const rangeInput: RangeInputWidget;
|
3401 |
|
3402 | declare type RangeInputCSSClasses = Partial<{
|
3403 | |
3404 |
|
3405 |
|
3406 | root: string | string[];
|
3407 | |
3408 |
|
3409 |
|
3410 | noRefinement: string | string[];
|
3411 | |
3412 |
|
3413 |
|
3414 | form: string | string[];
|
3415 | |
3416 |
|
3417 |
|
3418 | label: string | string[];
|
3419 | |
3420 |
|
3421 |
|
3422 | input: string | string[];
|
3423 | |
3424 |
|
3425 |
|
3426 | inputMin: string | string[];
|
3427 | |
3428 |
|
3429 |
|
3430 | separator: string | string[];
|
3431 | |
3432 |
|
3433 |
|
3434 | inputMax: string | string[];
|
3435 | |
3436 |
|
3437 |
|
3438 | submit: string | string[];
|
3439 | }>;
|
3440 |
|
3441 | declare type RangeInputTemplates = Partial<{
|
3442 | |
3443 |
|
3444 |
|
3445 |
|
3446 | separatorText: Template;
|
3447 | |
3448 |
|
3449 |
|
3450 |
|
3451 | submitText: Template;
|
3452 | }>;
|
3453 |
|
3454 | declare type RangeInputWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {
|
3455 | $$widgetType: 'ais.rangeInput';
|
3456 | $$type: 'ais.rangeInput';
|
3457 | }, RangeConnectorParams, RangeInputWidgetParams>;
|
3458 |
|
3459 | declare type RangeInputWidgetParams = {
|
3460 | |
3461 |
|
3462 |
|
3463 | container: string | HTMLElement;
|
3464 | |
3465 |
|
3466 |
|
3467 | attribute: string;
|
3468 | |
3469 |
|
3470 |
|
3471 | min?: number;
|
3472 | |
3473 |
|
3474 |
|
3475 | max?: number;
|
3476 | |
3477 |
|
3478 |
|
3479 |
|
3480 | precision?: number;
|
3481 | |
3482 |
|
3483 |
|
3484 | templates?: RangeInputTemplates;
|
3485 | |
3486 |
|
3487 |
|
3488 | cssClasses?: RangeInputCSSClasses;
|
3489 | };
|
3490 |
|
3491 | declare type RangeMax = number | undefined;
|
3492 |
|
3493 | declare type RangeMin = number | undefined;
|
3494 |
|
3495 | declare type RangeRenderState = {
|
3496 | |
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 |
|
3502 | refine(rangeValue: RangeBoundaries): void;
|
3503 | |
3504 |
|
3505 |
|
3506 | canRefine: boolean;
|
3507 | |
3508 |
|
3509 |
|
3510 | sendEvent: SendEventForFacet;
|
3511 | |
3512 |
|
3513 |
|
3514 | range: Range_2;
|
3515 | |
3516 |
|
3517 |
|
3518 | start: RangeBoundaries;
|
3519 | |
3520 |
|
3521 |
|
3522 |
|
3523 | format: {
|
3524 | from(fromValue: number): string;
|
3525 | to(toValue: number): string;
|
3526 | };
|
3527 | };
|
3528 |
|
3529 |
|
3530 |
|
3531 |
|
3532 |
|
3533 |
|
3534 |
|
3535 |
|
3536 |
|
3537 |
|
3538 |
|
3539 |
|
3540 | declare const rangeSlider: RangeSliderWidget;
|
3541 |
|
3542 | declare type RangeSliderCssClasses = Partial<{
|
3543 | |
3544 |
|
3545 |
|
3546 | root: string | string[];
|
3547 | |
3548 |
|
3549 |
|
3550 | disabledRoot: string | string[];
|
3551 | }>;
|
3552 |
|
3553 | declare type RangeSliderTooltipOptions = {
|
3554 | |
3555 |
|
3556 |
|
3557 |
|
3558 |
|
3559 |
|
3560 | format(value: number): string;
|
3561 | };
|
3562 |
|
3563 | declare type RangeSliderWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {
|
3564 | $$widgetType: 'ais.rangeSlider';
|
3565 | $$type: 'ais.rangeSlider';
|
3566 | }, RangeConnectorParams, RangeSliderWidgetParams>;
|
3567 |
|
3568 | declare type RangeSliderWidgetParams = {
|
3569 | |
3570 |
|
3571 |
|
3572 | container: string | HTMLElement;
|
3573 | |
3574 |
|
3575 |
|
3576 | attribute: string;
|
3577 | |
3578 |
|
3579 |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 | tooltips?: boolean | RangeSliderTooltipOptions;
|
3585 | |
3586 |
|
3587 |
|
3588 | cssClasses?: RangeSliderCssClasses;
|
3589 | |
3590 |
|
3591 |
|
3592 |
|
3593 | pips?: boolean;
|
3594 | |
3595 |
|
3596 |
|
3597 |
|
3598 | precision?: number;
|
3599 | |
3600 |
|
3601 |
|
3602 | step?: number;
|
3603 | |
3604 |
|
3605 |
|
3606 | min?: number;
|
3607 | |
3608 |
|
3609 |
|
3610 | max?: number;
|
3611 | };
|
3612 |
|
3613 | declare type RangeWidgetDescription = {
|
3614 | $$type: 'ais.range';
|
3615 | renderState: RangeRenderState;
|
3616 | indexRenderState: {
|
3617 | range: {
|
3618 | [attribute: string]: WidgetRenderState<RangeRenderState, RangeConnectorParams>;
|
3619 | };
|
3620 | };
|
3621 | indexUiState: {
|
3622 | range: {
|
3623 | [attribute: string]: string;
|
3624 | };
|
3625 | };
|
3626 | };
|
3627 |
|
3628 | declare const ratingMenu: RatingMenuWidget;
|
3629 |
|
3630 | declare type RatingMenuConnector = Connector<RatingMenuWidgetDescription, RatingMenuConnectorParams>;
|
3631 |
|
3632 | declare type RatingMenuConnectorParams = {
|
3633 | |
3634 |
|
3635 |
|
3636 | attribute: string;
|
3637 | |
3638 |
|
3639 |
|
3640 | max?: number;
|
3641 | };
|
3642 |
|
3643 | declare type RatingMenuCSSClasses = Partial<{
|
3644 | |
3645 |
|
3646 |
|
3647 | root: string | string[];
|
3648 | |
3649 |
|
3650 |
|
3651 | noRefinementRoot: string | string[];
|
3652 | |
3653 |
|
3654 |
|
3655 | list: string | string[];
|
3656 | |
3657 |
|
3658 |
|
3659 | item: string | string[];
|
3660 | |
3661 |
|
3662 |
|
3663 | selectedItem: string | string[];
|
3664 | |
3665 |
|
3666 |
|
3667 | disabledItem: string | string[];
|
3668 | |
3669 |
|
3670 |
|
3671 | link: string | string[];
|
3672 | |
3673 |
|
3674 |
|
3675 | starIcon: string | string[];
|
3676 | |
3677 |
|
3678 |
|
3679 | fullStarIcon: string | string[];
|
3680 | |
3681 |
|
3682 |
|
3683 | emptyStarIcon: string | string[];
|
3684 | |
3685 |
|
3686 |
|
3687 | label: string | string[];
|
3688 | |
3689 |
|
3690 |
|
3691 | count: string | string[];
|
3692 | }>;
|
3693 |
|
3694 | declare type RatingMenuRenderState = {
|
3695 | |
3696 |
|
3697 |
|
3698 | items: StarRatingItems[];
|
3699 | |
3700 |
|
3701 |
|
3702 | createURL: CreateURL<string>;
|
3703 | |
3704 |
|
3705 |
|
3706 | canRefine: boolean;
|
3707 | |
3708 |
|
3709 |
|
3710 | refine: (value: string) => void;
|
3711 | |
3712 |
|
3713 |
|
3714 | hasNoResults: boolean;
|
3715 | |
3716 |
|
3717 |
|
3718 | sendEvent: SendEvent;
|
3719 | };
|
3720 |
|
3721 | declare type RatingMenuTemplates = Partial<{
|
3722 | |
3723 |
|
3724 |
|
3725 | item: Template<{
|
3726 | name: string;
|
3727 | count: number;
|
3728 | isRefined: boolean;
|
3729 | url: string;
|
3730 | }>;
|
3731 | }>;
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 |
|
3738 |
|
3739 |
|
3740 |
|
3741 |
|
3742 |
|
3743 |
|
3744 |
|
3745 |
|
3746 |
|
3747 |
|
3748 |
|
3749 |
|
3750 |
|
3751 |
|
3752 |
|
3753 |
|
3754 |
|
3755 |
|
3756 |
|
3757 |
|
3758 |
|
3759 | declare type RatingMenuWidget = WidgetFactory<RatingMenuWidgetDescription & {
|
3760 | $$widgetType: 'ais.ratingMenu';
|
3761 | }, RatingMenuConnectorParams, RatingMenuWidgetParams>;
|
3762 |
|
3763 | declare type RatingMenuWidgetDescription = {
|
3764 | $$type: 'ais.ratingMenu';
|
3765 | renderState: RatingMenuRenderState;
|
3766 | indexRenderState: {
|
3767 | ratingMenu: {
|
3768 | [attribute: string]: WidgetRenderState<RatingMenuRenderState, RatingMenuConnectorParams>;
|
3769 | };
|
3770 | };
|
3771 | indexUiState: {
|
3772 | ratingMenu: {
|
3773 | [attribute: string]: number;
|
3774 | };
|
3775 | };
|
3776 | };
|
3777 |
|
3778 | declare type RatingMenuWidgetParams = {
|
3779 | |
3780 |
|
3781 |
|
3782 | container: string | HTMLElement;
|
3783 | |
3784 |
|
3785 |
|
3786 | attribute: string;
|
3787 | |
3788 |
|
3789 |
|
3790 | max?: number;
|
3791 | |
3792 |
|
3793 |
|
3794 | templates?: RatingMenuTemplates;
|
3795 | |
3796 |
|
3797 |
|
3798 | cssClasses?: RatingMenuCSSClasses;
|
3799 | };
|
3800 |
|
3801 | declare type Read = ({ state, }: {
|
3802 | state: PlainSearchParameters;
|
3803 | }) => InfiniteHitsCachedHits | null;
|
3804 |
|
3805 | declare type ReconfigurableOptions = Places.ReconfigurableOptions;
|
3806 |
|
3807 |
|
3808 |
|
3809 |
|
3810 | declare type Refine = (searchParameters: PlainSearchParameters) => void;
|
3811 |
|
3812 | declare type Refine_2 = (relevancyStrictness: number) => void;
|
3813 |
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 |
|
3828 |
|
3829 |
|
3830 |
|
3831 |
|
3832 |
|
3833 | declare const refinementList: RefinementListWidget;
|
3834 |
|
3835 | declare type RefinementListConnector = Connector<RefinementListWidgetDescription, RefinementListConnectorParams>;
|
3836 |
|
3837 | declare type RefinementListConnectorParams = {
|
3838 | |
3839 |
|
3840 |
|
3841 | attribute: string;
|
3842 | |
3843 |
|
3844 |
|
3845 | operator?: 'and' | 'or';
|
3846 | |
3847 |
|
3848 |
|
3849 |
|
3850 | limit?: number;
|
3851 | |
3852 |
|
3853 |
|
3854 | showMore?: boolean;
|
3855 | |
3856 |
|
3857 |
|
3858 |
|
3859 | showMoreLimit?: number;
|
3860 | |
3861 |
|
3862 |
|
3863 |
|
3864 |
|
3865 |
|
3866 |
|
3867 | sortBy?: SortBy<RefinementListItem>;
|
3868 | |
3869 |
|
3870 |
|
3871 | escapeFacetValues?: boolean;
|
3872 | |
3873 |
|
3874 |
|
3875 | transformItems?: TransformItems<RefinementListItem>;
|
3876 | };
|
3877 |
|
3878 | declare type RefinementListCSSClasses = RefinementListOwnCSSClasses & RefinementListSearchableCSSClasses;
|
3879 |
|
3880 | declare type RefinementListItem = {
|
3881 | |
3882 |
|
3883 |
|
3884 | value: string;
|
3885 | |
3886 |
|
3887 |
|
3888 | label: string;
|
3889 | |
3890 |
|
3891 |
|
3892 | highlighted?: string;
|
3893 | |
3894 |
|
3895 |
|
3896 | count: number;
|
3897 | |
3898 |
|
3899 |
|
3900 | isRefined: boolean;
|
3901 | };
|
3902 |
|
3903 | declare type RefinementListItemData = {
|
3904 | |
3905 |
|
3906 |
|
3907 | count: number;
|
3908 | |
3909 |
|
3910 |
|
3911 | isRefined: boolean;
|
3912 | |
3913 |
|
3914 |
|
3915 | label: string;
|
3916 | |
3917 |
|
3918 |
|
3919 | value: string;
|
3920 | |
3921 |
|
3922 |
|
3923 | highlighted: string;
|
3924 | |
3925 |
|
3926 |
|
3927 | url: string;
|
3928 | |
3929 |
|
3930 |
|
3931 | cssClasses: RefinementListCSSClasses;
|
3932 | };
|
3933 |
|
3934 | declare type RefinementListOwnCSSClasses = Partial<{
|
3935 | |
3936 |
|
3937 |
|
3938 | root: string | string[];
|
3939 | |
3940 |
|
3941 |
|
3942 | noRefinementRoot: string | string[];
|
3943 | |
3944 |
|
3945 |
|
3946 | noResults: string | string[];
|
3947 | |
3948 |
|
3949 |
|
3950 | list: string | string[];
|
3951 | |
3952 |
|
3953 |
|
3954 | item: string | string[];
|
3955 | |
3956 |
|
3957 |
|
3958 | selectedItem: string | string[];
|
3959 | |
3960 |
|
3961 |
|
3962 | label: string | string[];
|
3963 | |
3964 |
|
3965 |
|
3966 | checkbox: string | string[];
|
3967 | |
3968 |
|
3969 |
|
3970 | labelText: string | string[];
|
3971 | |
3972 |
|
3973 |
|
3974 | showMore: string | string[];
|
3975 | |
3976 |
|
3977 |
|
3978 | disabledShowMore: string | string[];
|
3979 | |
3980 |
|
3981 |
|
3982 | count: string | string[];
|
3983 | |
3984 |
|
3985 |
|
3986 | searchBox: string | string[];
|
3987 | }>;
|
3988 |
|
3989 | declare type RefinementListOwnTemplates = Partial<{
|
3990 | |
3991 |
|
3992 |
|
3993 | item: Template<RefinementListItemData>;
|
3994 | |
3995 |
|
3996 |
|
3997 | showMoreText: Template;
|
3998 | |
3999 |
|
4000 |
|
4001 | searchableNoResults: Template;
|
4002 | }>;
|
4003 |
|
4004 | declare type RefinementListRenderState = {
|
4005 | |
4006 |
|
4007 |
|
4008 | items: RefinementListItem[];
|
4009 | |
4010 |
|
4011 |
|
4012 | hasExhaustiveItems: boolean;
|
4013 | |
4014 |
|
4015 |
|
4016 | createURL: CreateURL<string>;
|
4017 | |
4018 |
|
4019 |
|
4020 | refine(value: string): void;
|
4021 | |
4022 |
|
4023 |
|
4024 | sendEvent: SendEventForFacet;
|
4025 | |
4026 |
|
4027 |
|
4028 | searchForItems(query: string): void;
|
4029 | |
4030 |
|
4031 |
|
4032 | isFromSearch: boolean;
|
4033 | |
4034 |
|
4035 |
|
4036 | canRefine: boolean;
|
4037 | |
4038 |
|
4039 |
|
4040 |
|
4041 | canToggleShowMore: boolean;
|
4042 | |
4043 |
|
4044 |
|
4045 | isShowingMore: boolean;
|
4046 | |
4047 |
|
4048 |
|
4049 | toggleShowMore(): void;
|
4050 | };
|
4051 |
|
4052 | declare type RefinementListSearchableCSSClasses = Partial<{
|
4053 | searchableRoot: string | string[];
|
4054 | searchableForm: string | string[];
|
4055 | searchableInput: string | string[];
|
4056 | searchableSubmit: string | string[];
|
4057 | searchableSubmitIcon: string | string[];
|
4058 | searchableReset: string | string[];
|
4059 | searchableResetIcon: string | string[];
|
4060 | searchableLoadingIndicator: string | string[];
|
4061 | searchableLoadingIcon: string | string[];
|
4062 | }>;
|
4063 |
|
4064 | declare type RefinementListSearchableTemplates = Partial<{
|
4065 | |
4066 |
|
4067 |
|
4068 | searchableSubmit: SearchBoxTemplates['submit'];
|
4069 | |
4070 |
|
4071 |
|
4072 | searchableReset: SearchBoxTemplates['reset'];
|
4073 | |
4074 |
|
4075 |
|
4076 | searchableLoadingIndicator: SearchBoxTemplates['loadingIndicator'];
|
4077 | }>;
|
4078 |
|
4079 | declare type RefinementListTemplates = RefinementListOwnTemplates & RefinementListSearchableTemplates;
|
4080 |
|
4081 | declare type RefinementListWidget = WidgetFactory<RefinementListWidgetDescription & {
|
4082 | $$widgetType: 'ais.refinementList';
|
4083 | }, RefinementListConnectorParams, RefinementListWidgetParams>;
|
4084 |
|
4085 | declare type RefinementListWidgetDescription = {
|
4086 | $$type: 'ais.refinementList';
|
4087 | renderState: RefinementListRenderState;
|
4088 | indexRenderState: {
|
4089 | refinementList: {
|
4090 | [attribute: string]: WidgetRenderState<RefinementListRenderState, RefinementListConnectorParams>;
|
4091 | };
|
4092 | };
|
4093 | indexUiState: {
|
4094 | refinementList: {
|
4095 | [attribute: string]: string[];
|
4096 | };
|
4097 | };
|
4098 | };
|
4099 |
|
4100 | declare type RefinementListWidgetParams = {
|
4101 | |
4102 |
|
4103 |
|
4104 | container: string | HTMLElement;
|
4105 | |
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 |
|
4111 | searchable?: boolean;
|
4112 | |
4113 |
|
4114 |
|
4115 | searchablePlaceholder?: string;
|
4116 | |
4117 |
|
4118 |
|
4119 |
|
4120 | searchableIsAlwaysActive?: boolean;
|
4121 | |
4122 |
|
4123 |
|
4124 |
|
4125 | searchableEscapeFacetValues?: boolean;
|
4126 | |
4127 |
|
4128 |
|
4129 | templates?: RefinementListTemplates;
|
4130 | |
4131 |
|
4132 |
|
4133 | cssClasses?: RefinementListCSSClasses;
|
4134 | };
|
4135 |
|
4136 | declare const relevantSort: RelevantSortWidget;
|
4137 |
|
4138 | declare type RelevantSortConnector = Connector<RelevantSortWidgetDescription, RelevantSortConnectorParams>;
|
4139 |
|
4140 | declare type RelevantSortConnectorParams = Record<string, unknown>;
|
4141 |
|
4142 | declare type RelevantSortCSSClasses = Partial<{
|
4143 | root: string;
|
4144 | text: string;
|
4145 | button: string;
|
4146 | }>;
|
4147 |
|
4148 | declare type RelevantSortRenderState = {
|
4149 | |
4150 |
|
4151 |
|
4152 | isRelevantSorted: boolean;
|
4153 | |
4154 |
|
4155 |
|
4156 | isVirtualReplica: boolean;
|
4157 | |
4158 |
|
4159 |
|
4160 | canRefine: boolean;
|
4161 | |
4162 |
|
4163 |
|
4164 | refine: Refine_2;
|
4165 | };
|
4166 |
|
4167 | declare type RelevantSortTemplates = Partial<{
|
4168 | text: Template<{
|
4169 | isRelevantSorted: boolean;
|
4170 | }>;
|
4171 | button: Template<{
|
4172 | isRelevantSorted: boolean;
|
4173 | }>;
|
4174 | }>;
|
4175 |
|
4176 | declare type RelevantSortWidget = WidgetFactory<RelevantSortWidgetDescription & {
|
4177 | $$widgetType: 'ais.relevantSort';
|
4178 | }, RelevantSortConnectorParams, RelevantSortWidgetParams>;
|
4179 |
|
4180 | declare type RelevantSortWidgetDescription = {
|
4181 | $$type: 'ais.relevantSort';
|
4182 | renderState: RelevantSortRenderState;
|
4183 | indexRenderState: {
|
4184 | relevantSort: WidgetRenderState<RelevantSortRenderState, RelevantSortConnectorParams>;
|
4185 | };
|
4186 | indexUiState: {
|
4187 | relevantSort: number;
|
4188 | };
|
4189 | };
|
4190 |
|
4191 | declare type RelevantSortWidgetParams = {
|
4192 | container: string | HTMLElement;
|
4193 | cssClasses?: RelevantSortCSSClasses;
|
4194 | templates?: RelevantSortTemplates;
|
4195 | };
|
4196 |
|
4197 |
|
4198 |
|
4199 |
|
4200 | declare type Renderer<TRenderState, TWidgetParams> = (
|
4201 | /**
|
4202 | * The base render options plus the specific options of the widget.
|
4203 | */
|
4204 | renderState: TRenderState & RendererOptions<TWidgetParams>,
|
4205 | /**
|
4206 | * If is the first run.
|
4207 | */
|
4208 | isFirstRender: boolean) => void;
|
4209 |
|
4210 |
|
4211 |
|
4212 |
|
4213 |
|
4214 | declare type RendererOptions<TWidgetParams> = {
|
4215 | |
4216 |
|
4217 |
|
4218 |
|
4219 | widgetParams: TWidgetParams;
|
4220 | |
4221 |
|
4222 |
|
4223 | instantSearchInstance: InstantSearch;
|
4224 | |
4225 |
|
4226 |
|
4227 | results?: SearchResults;
|
4228 | |
4229 |
|
4230 |
|
4231 |
|
4232 | hits?: Hits;
|
4233 | |
4234 |
|
4235 |
|
4236 | insights?: InsightsClient;
|
4237 | };
|
4238 |
|
4239 | declare type RenderOptions = SharedRenderOptions & {
|
4240 | results: SearchResults;
|
4241 | };
|
4242 |
|
4243 | declare type RenderState = {
|
4244 | [indexId: string]: IndexRenderState;
|
4245 | };
|
4246 |
|
4247 | declare type RenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'renderState' | 'indexRenderState'> & WidgetParams ? RequiredRenderStateLifeCycle<TWidgetDescription> : Partial<RequiredRenderStateLifeCycle<TWidgetDescription>>;
|
4248 |
|
4249 | declare type RequiredKeys<TObject, TKeys extends keyof TObject> = Expand<Required<Pick<TObject, TKeys>> & Omit<TObject, TKeys>>;
|
4250 |
|
4251 | declare type RequiredRenderStateLifeCycle<TWidgetDescription extends WidgetDescription & WidgetParams> = {
|
4252 | |
4253 |
|
4254 |
|
4255 | getWidgetRenderState: (renderOptions: InitOptions | RenderOptions) => Expand<WidgetRenderState<TWidgetDescription['renderState'], TWidgetDescription['widgetParams']>>;
|
4256 | |
4257 |
|
4258 |
|
4259 |
|
4260 | getRenderState: (renderState: Expand<IndexRenderState & Partial<TWidgetDescription['indexRenderState']>>, renderOptions: InitOptions | RenderOptions) => IndexRenderState & TWidgetDescription['indexRenderState'];
|
4261 | };
|
4262 |
|
4263 | declare type RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescription> = {
|
4264 | |
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 |
|
4271 |
|
4272 | getWidgetUiState: (uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>, widgetUiStateOptions: {
|
4273 | searchParameters: SearchParameters;
|
4274 | helper: AlgoliaSearchHelper;
|
4275 | }) => Partial<IndexUiState & TWidgetDescription['indexUiState']>;
|
4276 | |
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 | getWidgetState?: RequiredUiStateLifeCycle<TWidgetDescription>['getWidgetUiState'];
|
4286 | |
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 |
|
4293 |
|
4294 | getWidgetSearchParameters: (state: SearchParameters, widgetSearchParametersOptions: {
|
4295 | uiState: Expand<Partial<TWidgetDescription['indexUiState'] & IndexUiState>>;
|
4296 | }) => SearchParameters;
|
4297 | };
|
4298 |
|
4299 | declare type RequiredWidgetLifeCycle<TWidgetDescription extends WidgetDescription> = {
|
4300 | |
4301 |
|
4302 |
|
4303 | $$type: TWidgetDescription['$$type'];
|
4304 | |
4305 |
|
4306 |
|
4307 | init?: (options: InitOptions) => void;
|
4308 | |
4309 |
|
4310 |
|
4311 | render?: (options: RenderOptions) => void;
|
4312 | |
4313 |
|
4314 |
|
4315 |
|
4316 | dispose?: (options: DisposeOptions) => SearchParameters | void;
|
4317 | };
|
4318 |
|
4319 | declare type RequiredWidgetType<TWidgetDescription extends WidgetDescription> = {
|
4320 | |
4321 |
|
4322 |
|
4323 | $$widgetType: TWidgetDescription['$$widgetType'];
|
4324 | };
|
4325 |
|
4326 | declare function reverseHighlight({ attribute, highlightedTagName, hit, cssClasses, }: ReverseHighlightOptions): string;
|
4327 |
|
4328 | declare type ReverseHighlightOptions = {
|
4329 | attribute: string | string[];
|
4330 | highlightedTagName?: string;
|
4331 | hit: Partial<Hit>;
|
4332 | cssClasses?: Partial<{
|
4333 | highlighted: string;
|
4334 | }>;
|
4335 | };
|
4336 |
|
4337 | declare function reverseSnippet({ attribute, highlightedTagName, hit, cssClasses, }: ReverseSnippetOptions): string;
|
4338 |
|
4339 | declare type ReverseSnippetOptions = {
|
4340 | attribute: string | string[];
|
4341 | highlightedTagName?: string;
|
4342 | hit: Partial<Hit>;
|
4343 | cssClasses?: Partial<{
|
4344 | highlighted: string;
|
4345 | }>;
|
4346 | };
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 | declare type Router<TRouteState = UiState> = {
|
4353 | |
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 |
|
4359 | onUpdate(callback: (route: TRouteState) => void): void;
|
4360 | |
4361 |
|
4362 |
|
4363 |
|
4364 | read(): TRouteState;
|
4365 | |
4366 |
|
4367 |
|
4368 |
|
4369 | write(route: TRouteState): void;
|
4370 | |
4371 |
|
4372 |
|
4373 |
|
4374 | createURL(state: TRouteState): string;
|
4375 | |
4376 |
|
4377 |
|
4378 | dispose(): void;
|
4379 | };
|
4380 |
|
4381 | declare type RouterProps<TUiState extends UiState = UiState, TRouteState = TUiState> = {
|
4382 | router?: Router<TRouteState>;
|
4383 | stateMapping?: StateMapping<TUiState, TRouteState>;
|
4384 | };
|
4385 |
|
4386 | declare namespace routers {
|
4387 | export {
|
4388 | historyRouter as history
|
4389 | }
|
4390 | }
|
4391 |
|
4392 | declare type ScopedResult = {
|
4393 | indexId: string;
|
4394 | results: SearchResults;
|
4395 | helper: AlgoliaSearchHelper;
|
4396 | };
|
4397 |
|
4398 | declare const searchBox: SearchBoxWidget;
|
4399 |
|
4400 | declare type SearchBoxConnector = Connector<SearchBoxWidgetDescription, SearchBoxConnectorParams>;
|
4401 |
|
4402 | declare type SearchBoxConnectorParams = {
|
4403 | |
4404 |
|
4405 |
|
4406 |
|
4407 |
|
4408 |
|
4409 |
|
4410 | queryHook?: (query: string, hook: (value: string) => void) => void;
|
4411 | };
|
4412 |
|
4413 | declare type SearchBoxCSSClasses = Partial<{
|
4414 | |
4415 |
|
4416 |
|
4417 | root: string | string[];
|
4418 | |
4419 |
|
4420 |
|
4421 | form: string | string[];
|
4422 | |
4423 |
|
4424 |
|
4425 | input: string | string[];
|
4426 | |
4427 |
|
4428 |
|
4429 | submit: string | string[];
|
4430 | |
4431 |
|
4432 |
|
4433 | submitIcon: string | string[];
|
4434 | |
4435 |
|
4436 |
|
4437 | reset: string | string[];
|
4438 | |
4439 |
|
4440 |
|
4441 | resetIcon: string | string[];
|
4442 | |
4443 |
|
4444 |
|
4445 | loadingIndicator: string | string[];
|
4446 | |
4447 |
|
4448 |
|
4449 | loadingIcon: string | string[];
|
4450 | }>;
|
4451 |
|
4452 |
|
4453 |
|
4454 |
|
4455 |
|
4456 |
|
4457 |
|
4458 |
|
4459 |
|
4460 | declare type SearchBoxRenderState = {
|
4461 | |
4462 |
|
4463 |
|
4464 | query: string;
|
4465 | |
4466 |
|
4467 |
|
4468 | refine: (value: string) => void;
|
4469 | |
4470 |
|
4471 |
|
4472 | clear: () => void;
|
4473 | |
4474 |
|
4475 |
|
4476 |
|
4477 |
|
4478 | isSearchStalled: boolean;
|
4479 | };
|
4480 |
|
4481 | declare type SearchBoxTemplates = Partial<{
|
4482 | |
4483 |
|
4484 |
|
4485 | submit: Template;
|
4486 | |
4487 |
|
4488 |
|
4489 | reset: Template;
|
4490 | |
4491 |
|
4492 |
|
4493 | loadingIndicator: Template;
|
4494 | }>;
|
4495 |
|
4496 |
|
4497 |
|
4498 |
|
4499 |
|
4500 |
|
4501 |
|
4502 |
|
4503 |
|
4504 | declare type SearchBoxWidget = WidgetFactory<SearchBoxWidgetDescription & {
|
4505 | $$widgetType: 'ais.searchBox';
|
4506 | }, SearchBoxConnectorParams, SearchBoxWidgetParams>;
|
4507 |
|
4508 | declare type SearchBoxWidgetDescription = {
|
4509 | $$type: 'ais.searchBox';
|
4510 | renderState: SearchBoxRenderState;
|
4511 | indexRenderState: {
|
4512 | searchBox: WidgetRenderState<SearchBoxRenderState, SearchBoxConnectorParams>;
|
4513 | };
|
4514 | indexUiState: {
|
4515 | query: string;
|
4516 | };
|
4517 | };
|
4518 |
|
4519 | declare type SearchBoxWidgetParams = {
|
4520 | |
4521 |
|
4522 |
|
4523 | container: string | HTMLElement;
|
4524 | |
4525 |
|
4526 |
|
4527 | placeholder?: string;
|
4528 | |
4529 |
|
4530 |
|
4531 | autofocus?: boolean;
|
4532 | |
4533 |
|
4534 |
|
4535 |
|
4536 | searchAsYouType?: boolean;
|
4537 | |
4538 |
|
4539 |
|
4540 | showReset?: boolean;
|
4541 | |
4542 |
|
4543 |
|
4544 | showSubmit?: boolean;
|
4545 | |
4546 |
|
4547 |
|
4548 |
|
4549 | showLoadingIndicator?: boolean;
|
4550 | |
4551 |
|
4552 |
|
4553 | cssClasses?: SearchBoxCSSClasses;
|
4554 | |
4555 |
|
4556 |
|
4557 | templates?: SearchBoxTemplates;
|
4558 | |
4559 |
|
4560 |
|
4561 |
|
4562 |
|
4563 | queryHook?: (query: string, hook: (value: string) => void) => void;
|
4564 | };
|
4565 |
|
4566 | declare type SearchClient = {
|
4567 | search: DefaultSearchClient['search'];
|
4568 | searchForFacetValues: DefaultSearchClient['searchForFacetValues'];
|
4569 | addAlgoliaAgent?: DefaultSearchClient['addAlgoliaAgent'];
|
4570 | initIndex?: (indexName: string) => SearchIndex extends {
|
4571 | findAnswers: any;
|
4572 | } ? Partial<Pick<SearchIndex, 'findAnswers'>> : SearchIndex;
|
4573 | };
|
4574 |
|
4575 | declare type SearchIndex = ReturnType<DefaultSearchClient['initIndex']>;
|
4576 |
|
4577 | declare type SendEvent = (...args: [InsightsEvent] | [string, string, string?]) => void;
|
4578 |
|
4579 | declare type SendEventForFacet = BuiltInSendEventForFacet & CustomSendEventForFacet;
|
4580 |
|
4581 | declare type SendEventForHits = BuiltInSendEventForHits & CustomSendEventForHits;
|
4582 |
|
4583 | declare type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventForToggle;
|
4584 |
|
4585 | declare type SharedRenderOptions = {
|
4586 | instantSearchInstance: InstantSearch;
|
4587 | parent: IndexWidget | null;
|
4588 | templatesConfig: Record<string, unknown>;
|
4589 | scopedResults: ScopedResult[];
|
4590 | state: SearchParameters;
|
4591 | renderState: IndexRenderState;
|
4592 | helper: AlgoliaSearchHelper;
|
4593 | searchMetadata: {
|
4594 | isSearchStalled: boolean;
|
4595 | };
|
4596 | createURL(state: SearchParameters): string;
|
4597 | };
|
4598 |
|
4599 | declare function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;
|
4600 |
|
4601 | declare function singleIndexStateMapping<TUiState extends UiState = UiState>(indexName: keyof TUiState): StateMapping<TUiState, TUiState[typeof indexName]>;
|
4602 |
|
4603 | declare function snippet({ attribute, highlightedTagName, hit, cssClasses, }: SnippetOptions): string;
|
4604 |
|
4605 | declare type SnippetOptions = {
|
4606 | attribute: string | string[];
|
4607 | highlightedTagName?: string;
|
4608 | hit: Partial<Hit>;
|
4609 | cssClasses?: {
|
4610 | highlighted?: string;
|
4611 | };
|
4612 | };
|
4613 |
|
4614 |
|
4615 |
|
4616 |
|
4617 | declare type SortBy<TItem> = ((a: TItem, b: TItem) => number) | Array<'count' | 'isRefined' | 'name:asc' | 'name:desc'>;
|
4618 |
|
4619 |
|
4620 |
|
4621 |
|
4622 |
|
4623 | declare const sortBy: SortByWidget;
|
4624 |
|
4625 | declare type SortByConnector = Connector<SortByWidgetDescription, SortByConnectorParams>;
|
4626 |
|
4627 | declare type SortByConnectorParams = {
|
4628 | |
4629 |
|
4630 |
|
4631 | items: SortByItem[];
|
4632 | |
4633 |
|
4634 |
|
4635 | transformItems?: TransformItems<SortByItem>;
|
4636 | };
|
4637 |
|
4638 | declare type SortByIndexDefinition = {
|
4639 | |
4640 |
|
4641 |
|
4642 | value: string;
|
4643 | |
4644 |
|
4645 |
|
4646 | label: string;
|
4647 | };
|
4648 |
|
4649 |
|
4650 |
|
4651 |
|
4652 |
|
4653 |
|
4654 | declare type SortByItem = {
|
4655 | |
4656 |
|
4657 |
|
4658 | value: string;
|
4659 | |
4660 |
|
4661 |
|
4662 | label: string;
|
4663 | };
|
4664 |
|
4665 | declare type SortByRenderState = {
|
4666 | |
4667 |
|
4668 |
|
4669 | initialIndex?: string;
|
4670 | |
4671 |
|
4672 |
|
4673 | currentRefinement: string;
|
4674 | |
4675 |
|
4676 |
|
4677 | options: SortByItem[];
|
4678 | |
4679 |
|
4680 |
|
4681 | refine: (value: string) => void;
|
4682 | |
4683 |
|
4684 |
|
4685 | hasNoResults: boolean;
|
4686 | };
|
4687 |
|
4688 | declare type SortByWidget = WidgetFactory<SortByWidgetDescription & {
|
4689 | $$widgetType: 'ais.sortBy';
|
4690 | }, SortByConnectorParams, SortByWidgetParams>;
|
4691 |
|
4692 | declare type SortByWidgetCssClasses = Partial<{
|
4693 | |
4694 |
|
4695 |
|
4696 | root: string | string[];
|
4697 | |
4698 |
|
4699 |
|
4700 | select: string | string[];
|
4701 | |
4702 |
|
4703 |
|
4704 | option: string | string[];
|
4705 | }>;
|
4706 |
|
4707 | declare type SortByWidgetDescription = {
|
4708 | $$type: 'ais.sortBy';
|
4709 | renderState: SortByRenderState;
|
4710 | indexRenderState: {
|
4711 | sortBy: WidgetRenderState<SortByRenderState, SortByConnectorParams>;
|
4712 | };
|
4713 | indexUiState: {
|
4714 | sortBy: string;
|
4715 | };
|
4716 | };
|
4717 |
|
4718 | declare type SortByWidgetParams = {
|
4719 | |
4720 |
|
4721 |
|
4722 | container: string | HTMLElement;
|
4723 | |
4724 |
|
4725 |
|
4726 | items: SortByIndexDefinition[];
|
4727 | |
4728 |
|
4729 |
|
4730 | cssClasses?: SortByWidgetCssClasses;
|
4731 | |
4732 |
|
4733 |
|
4734 | transformItems?: TransformItems<SortByItem>;
|
4735 | };
|
4736 |
|
4737 | declare type StarRatingItems = {
|
4738 | |
4739 |
|
4740 |
|
4741 | name: string;
|
4742 | |
4743 |
|
4744 |
|
4745 | label: string;
|
4746 | |
4747 |
|
4748 |
|
4749 | value: string;
|
4750 | |
4751 |
|
4752 |
|
4753 | count: number;
|
4754 | |
4755 |
|
4756 |
|
4757 | stars: boolean[];
|
4758 | |
4759 |
|
4760 |
|
4761 | isRefined: boolean;
|
4762 | };
|
4763 |
|
4764 |
|
4765 |
|
4766 |
|
4767 |
|
4768 |
|
4769 |
|
4770 | declare type StateMapping<TUiState = UiState, TRouteState = TUiState> = {
|
4771 | |
4772 |
|
4773 |
|
4774 |
|
4775 |
|
4776 |
|
4777 | stateToRoute(uiState: TUiState): TRouteState;
|
4778 | |
4779 |
|
4780 |
|
4781 |
|
4782 |
|
4783 | routeToState(routeState: TRouteState): TUiState;
|
4784 | };
|
4785 |
|
4786 | declare namespace stateMappings {
|
4787 | export {
|
4788 | simpleStateMapping as simple,
|
4789 | singleIndexStateMapping as singleIndex
|
4790 | }
|
4791 | }
|
4792 |
|
4793 | declare type StaticOptions = Places.StaticOptions;
|
4794 |
|
4795 |
|
4796 |
|
4797 |
|
4798 |
|
4799 |
|
4800 |
|
4801 | declare const stats: StatsWidget;
|
4802 |
|
4803 | declare type StatsConnector = Connector<StatsWidgetDescription, StatsConnectorParams>;
|
4804 |
|
4805 | declare type StatsConnectorParams = Record<string, unknown>;
|
4806 |
|
4807 | declare type StatsCSSClasses = Partial<{
|
4808 | |
4809 |
|
4810 |
|
4811 | root: string | string[];
|
4812 | |
4813 |
|
4814 |
|
4815 | text: string | string[];
|
4816 | }>;
|
4817 |
|
4818 |
|
4819 |
|
4820 |
|
4821 |
|
4822 | declare type StatsRenderState = {
|
4823 | |
4824 |
|
4825 |
|
4826 | hitsPerPage?: number;
|
4827 | |
4828 |
|
4829 |
|
4830 | nbHits: number;
|
4831 | |
4832 |
|
4833 |
|
4834 | nbSortedHits?: number;
|
4835 | |
4836 |
|
4837 |
|
4838 | areHitsSorted: boolean;
|
4839 | |
4840 |
|
4841 |
|
4842 | nbPages: number;
|
4843 | |
4844 |
|
4845 |
|
4846 | page: number;
|
4847 | |
4848 |
|
4849 |
|
4850 | processingTimeMS: number;
|
4851 | |
4852 |
|
4853 |
|
4854 | query: string;
|
4855 | };
|
4856 |
|
4857 | declare type StatsTemplates = Partial<{
|
4858 | |
4859 |
|
4860 |
|
4861 | text: Template<{
|
4862 | hasManyResults: boolean;
|
4863 | hasNoResults: boolean;
|
4864 | hasOneResult: boolean;
|
4865 | } & StatsRenderState>;
|
4866 | }>;
|
4867 |
|
4868 | declare type StatsWidget = WidgetFactory<StatsWidgetDescription & {
|
4869 | $$widgetType: 'ais.stats';
|
4870 | }, StatsConnectorParams, StatsWidgetParams>;
|
4871 |
|
4872 | declare type StatsWidgetDescription = {
|
4873 | $$type: 'ais.stats';
|
4874 | renderState: StatsRenderState;
|
4875 | indexRenderState: {
|
4876 | stats: WidgetRenderState<StatsRenderState, StatsConnectorParams>;
|
4877 | };
|
4878 | };
|
4879 |
|
4880 | declare type StatsWidgetParams = {
|
4881 | |
4882 |
|
4883 |
|
4884 | container: string | HTMLElement;
|
4885 | |
4886 |
|
4887 |
|
4888 | templates?: StatsTemplates;
|
4889 | |
4890 |
|
4891 |
|
4892 | cssClasses?: StatsCSSClasses;
|
4893 | };
|
4894 |
|
4895 | declare type Status = 'initial' | 'askingPermission' | 'waiting' | 'recognizing' | 'finished' | 'error';
|
4896 |
|
4897 | declare type Template<TTemplateData = void> = string | ((data: TTemplateData) => string);
|
4898 |
|
4899 | declare type TemplateWithBindEvent<TTemplateData = void> = string | ((data: TTemplateData, bindEvent: BindEventForHits) => string);
|
4900 |
|
4901 |
|
4902 |
|
4903 |
|
4904 |
|
4905 |
|
4906 |
|
4907 |
|
4908 |
|
4909 |
|
4910 |
|
4911 |
|
4912 |
|
4913 | declare const toggleRefinement: ToggleRefinementWidget;
|
4914 |
|
4915 | declare type ToggleRefinementConnector = Connector<ToggleRefinementWidgetDescription, ToggleRefinementConnectorParams>;
|
4916 |
|
4917 | declare type ToggleRefinementConnectorParams = {
|
4918 |
|
4919 | attribute: string;
|
4920 | |
4921 |
|
4922 |
|
4923 |
|
4924 | on?: string | string[] | boolean | boolean[] | number | number[];
|
4925 | |
4926 |
|
4927 |
|
4928 | off?: string | string[] | boolean | boolean[] | number | number[];
|
4929 | };
|
4930 |
|
4931 | declare type ToggleRefinementCSSClasses = Partial<{
|
4932 | |
4933 |
|
4934 |
|
4935 | root: string | string[];
|
4936 | |
4937 |
|
4938 |
|
4939 | label: string | string[];
|
4940 | |
4941 |
|
4942 |
|
4943 | checkbox: string | string[];
|
4944 | |
4945 |
|
4946 |
|
4947 | labelText: string | string[];
|
4948 | }>;
|
4949 |
|
4950 | declare type ToggleRefinementRenderState = {
|
4951 |
|
4952 | value: {
|
4953 | name: string;
|
4954 | isRefined: boolean;
|
4955 | count: number | null;
|
4956 | onFacetValue: ToggleRefinementValue;
|
4957 | offFacetValue: ToggleRefinementValue;
|
4958 | };
|
4959 |
|
4960 | createURL: CreateURL<string>;
|
4961 |
|
4962 | sendEvent: SendEventForToggle;
|
4963 |
|
4964 | canRefine: boolean;
|
4965 |
|
4966 | refine: (value?: {
|
4967 | isRefined: boolean;
|
4968 | }) => void;
|
4969 | };
|
4970 |
|
4971 | declare type ToggleRefinementTemplates = Partial<{
|
4972 | |
4973 |
|
4974 |
|
4975 | labelText: Template<ToggleRefinementValue>;
|
4976 | }>;
|
4977 |
|
4978 | declare type ToggleRefinementValue = {
|
4979 |
|
4980 | isRefined: boolean;
|
4981 |
|
4982 | count: number | null;
|
4983 | };
|
4984 |
|
4985 | declare type ToggleRefinementWidget = WidgetFactory<ToggleRefinementWidgetDescription & {
|
4986 | $$widgetType: 'ais.toggleRefinement';
|
4987 | }, ToggleRefinementConnectorParams, ToggleRefinementWidgetParams>;
|
4988 |
|
4989 | declare type ToggleRefinementWidgetDescription = {
|
4990 | $$type: 'ais.toggleRefinement';
|
4991 | renderState: ToggleRefinementRenderState;
|
4992 | indexRenderState: {
|
4993 | toggleRefinement: {
|
4994 | [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;
|
4995 | };
|
4996 | };
|
4997 | indexUiState: {
|
4998 | toggle: {
|
4999 | [attribute: string]: boolean;
|
5000 | };
|
5001 | };
|
5002 | };
|
5003 |
|
5004 | declare type ToggleRefinementWidgetParams = {
|
5005 | |
5006 |
|
5007 |
|
5008 | container: string | HTMLElement;
|
5009 | |
5010 |
|
5011 |
|
5012 | templates?: ToggleRefinementTemplates;
|
5013 | |
5014 |
|
5015 |
|
5016 | cssClasses?: ToggleRefinementCSSClasses;
|
5017 | };
|
5018 |
|
5019 | declare type TrackedFilterRefinement = string | number | boolean;
|
5020 |
|
5021 |
|
5022 |
|
5023 |
|
5024 | declare type TransformItems<TItem> = (items: TItem[]) => TItem[];
|
5025 |
|
5026 | declare type TransformSearchParameters = (searchParameters: SearchParameters) => PlainSearchParameters;
|
5027 |
|
5028 | declare type UiState = {
|
5029 | [indexId: string]: IndexUiState;
|
5030 | };
|
5031 |
|
5032 | declare type UiStateLifeCycle<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, 'indexUiState'> ? RequiredUiStateLifeCycle<TWidgetDescription> : Partial<RequiredUiStateLifeCycle<TWidgetDescription>>;
|
5033 |
|
5034 | declare type UnknownWidgetParams = NonNullable<object>;
|
5035 |
|
5036 |
|
5037 |
|
5038 |
|
5039 | declare type Unmounter = () => void;
|
5040 |
|
5041 | declare type VoiceListeningState = {
|
5042 | status: Status;
|
5043 | transcript: string;
|
5044 | isSpeechFinal: boolean;
|
5045 | errorCode?: string;
|
5046 | };
|
5047 |
|
5048 | declare const voiceSearch: VoiceSearchWidget;
|
5049 |
|
5050 | declare type VoiceSearchConnector = Connector<VoiceSearchWidgetDescription, VoiceSearchConnectorParams>;
|
5051 |
|
5052 | declare type VoiceSearchConnectorParams = {
|
5053 | searchAsYouSpeak?: boolean;
|
5054 | language?: string;
|
5055 | additionalQueryParameters?: (params: {
|
5056 | query: string;
|
5057 | }) => PlainSearchParameters | void;
|
5058 | createVoiceSearchHelper?: CreateVoiceSearchHelper;
|
5059 | };
|
5060 |
|
5061 | declare type VoiceSearchCSSClasses = Partial<{
|
5062 | root: string | string[];
|
5063 | button: string | string[];
|
5064 | status: string | string[];
|
5065 | }>;
|
5066 |
|
5067 | declare type VoiceSearchHelper = {
|
5068 | getState: () => VoiceListeningState;
|
5069 | isBrowserSupported: () => boolean;
|
5070 | isListening: () => boolean;
|
5071 | startListening: () => void;
|
5072 | stopListening: () => void;
|
5073 | dispose: () => void;
|
5074 | };
|
5075 |
|
5076 | declare type VoiceSearchHelperParams = {
|
5077 | searchAsYouSpeak: boolean;
|
5078 | language?: string;
|
5079 | onQueryChange: (query: string) => void;
|
5080 | onStateChange: () => void;
|
5081 | };
|
5082 |
|
5083 | declare type VoiceSearchRenderState = {
|
5084 | isBrowserSupported: boolean;
|
5085 | isListening: boolean;
|
5086 | toggleListening: () => void;
|
5087 | voiceListeningState: VoiceListeningState;
|
5088 | };
|
5089 |
|
5090 | declare type VoiceSearchTemplateProps = {
|
5091 | status: string;
|
5092 | errorCode: string;
|
5093 | isListening: boolean;
|
5094 | transcript: string;
|
5095 | isSpeechFinal: boolean;
|
5096 | isBrowserSupported: boolean;
|
5097 | };
|
5098 |
|
5099 | declare type VoiceSearchTemplates = Partial<{
|
5100 | buttonText: Template<VoiceSearchTemplateProps>;
|
5101 | status: Template<VoiceSearchTemplateProps>;
|
5102 | }>;
|
5103 |
|
5104 | declare type VoiceSearchWidget = WidgetFactory<VoiceSearchWidgetDescription & {
|
5105 | $$type: 'ais.voiceSearch';
|
5106 | }, VoiceSearchConnectorParams, VoiceSearchWidgetParams>;
|
5107 |
|
5108 | declare type VoiceSearchWidgetDescription = {
|
5109 | $$type: 'ais.voiceSearch';
|
5110 | renderState: VoiceSearchRenderState;
|
5111 | indexRenderState: {
|
5112 | voiceSearch: WidgetRenderState<VoiceSearchRenderState, VoiceSearchConnectorParams>;
|
5113 | };
|
5114 | indexUiState: {
|
5115 | query: string;
|
5116 | };
|
5117 | };
|
5118 |
|
5119 | declare type VoiceSearchWidgetParams = {
|
5120 | container: string | HTMLElement;
|
5121 | cssClasses?: VoiceSearchCSSClasses;
|
5122 | templates?: VoiceSearchTemplates;
|
5123 | searchAsYouSpeak?: boolean;
|
5124 | language?: string;
|
5125 | additionalQueryParameters?: (params: {
|
5126 | query: string;
|
5127 | }) => PlainSearchParameters | void;
|
5128 | createVoiceSearchHelper?: CreateVoiceSearchHelper;
|
5129 | };
|
5130 |
|
5131 | declare type Widget<TWidgetDescription extends WidgetDescription & WidgetParams = {
|
5132 | $$type: string;
|
5133 | }> = Expand<RequiredWidgetLifeCycle<TWidgetDescription> & WidgetType<TWidgetDescription> & UiStateLifeCycle<TWidgetDescription> & RenderStateLifeCycle<TWidgetDescription>>;
|
5134 |
|
5135 | declare type WidgetDescription = {
|
5136 | $$type: string;
|
5137 | $$widgetType?: string;
|
5138 | renderState?: Record<string, unknown>;
|
5139 | indexRenderState?: Record<string, unknown>;
|
5140 | indexUiState?: Record<string, unknown>;
|
5141 | };
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 | declare type WidgetFactory<TWidgetDescription extends WidgetDescription, TConnectorParams extends UnknownWidgetParams, TWidgetParams extends UnknownWidgetParams> = (
|
5147 | /**
|
5148 | * The params of the widget.
|
5149 | */
|
5150 | widgetParams: TWidgetParams & TConnectorParams) => Widget<TWidgetDescription & {
|
5151 | widgetParams: TConnectorParams;
|
5152 | }>;
|
5153 |
|
5154 | declare type WidgetParams = {
|
5155 | widgetParams?: UnknownWidgetParams;
|
5156 | };
|
5157 |
|
5158 | declare type WidgetRenderState<TWidgetRenderState, TWidgetParams> = TWidgetRenderState & {
|
5159 | widgetParams: TWidgetParams;
|
5160 | };
|
5161 |
|
5162 | declare type WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState'] & PlacesWidgetDescription['indexRenderState'];
|
5163 |
|
5164 | declare namespace widgets {
|
5165 | export {
|
5166 | analytics,
|
5167 | breadcrumb,
|
5168 | clearRefinements,
|
5169 | configure,
|
5170 | currentRefinements,
|
5171 | answersWidget as EXPERIMENTAL_answers,
|
5172 | configureRelatedItems as EXPERIMENTAL_configureRelatedItems,
|
5173 | dynamicWidgets,
|
5174 | EXPERIMENTAL_dynamicWidgets,
|
5175 | geoSearch,
|
5176 | hierarchicalMenu,
|
5177 | hits,
|
5178 | hitsPerPage,
|
5179 | index,
|
5180 | infiniteHits,
|
5181 | menu,
|
5182 | menuSelect,
|
5183 | numericMenu,
|
5184 | pagination,
|
5185 | panel,
|
5186 | placesWidget as places,
|
5187 | poweredBy,
|
5188 | queryRuleContext,
|
5189 | queryRuleCustomData,
|
5190 | rangeInput,
|
5191 | rangeSlider,
|
5192 | ratingMenu,
|
5193 | refinementList,
|
5194 | relevantSort,
|
5195 | searchBox,
|
5196 | sortBy,
|
5197 | stats,
|
5198 | toggleRefinement,
|
5199 | voiceSearch
|
5200 | }
|
5201 | }
|
5202 |
|
5203 | declare type WidgetType<TWidgetDescription extends WidgetDescription> = TWidgetDescription extends RequiredKeys<WidgetDescription, '$$widgetType'> ? RequiredWidgetType<TWidgetDescription> : {
|
5204 | |
5205 |
|
5206 |
|
5207 | $$widgetType?: string;
|
5208 | };
|
5209 |
|
5210 | declare type WidgetUiStates = PlacesWidgetDescription['indexUiState'];
|
5211 |
|
5212 | declare type Write = ({ state, hits, }: {
|
5213 | state: PlainSearchParameters;
|
5214 | hits: InfiniteHitsCachedHits;
|
5215 | }) => void;
|
5216 |
|
5217 | export { }
|
5218 |
|
\ | No newline at end of file |