@docsearch/react 3.7.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  import { BaseItem, AutocompleteState, AutocompleteContext, AutocompleteInsightsApi, AutocompleteOptions } from '@algolia/autocomplete-core';
2
- import { SearchClient } from 'algoliasearch';
3
- import { SearchQuery, LiteClient } from 'algoliasearch/lite';
2
+ import { LiteClient, SearchParamsObject } from 'algoliasearch/lite';
4
3
  import React from 'react';
5
4
 
6
5
  type ContentType = 'content' | 'lvl0' | 'lvl1' | 'lvl2' | 'lvl3' | 'lvl4' | 'lvl5' | 'lvl6';
@@ -97,12 +96,17 @@ type DocSearchTranslations = Partial<{
97
96
  button: ButtonTranslations;
98
97
  modal: ModalTranslations;
99
98
  }>;
99
+ type DocSearchTransformClient = {
100
+ search: LiteClient['search'];
101
+ addAlgoliaAgent: LiteClient['addAlgoliaAgent'];
102
+ transporter: Pick<LiteClient['transporter'], 'algoliaAgent'>;
103
+ };
100
104
  interface DocSearchProps {
101
105
  appId: string;
102
106
  apiKey: string;
103
107
  indexName: string;
104
108
  placeholder?: string;
105
- searchParameters?: SearchQuery;
109
+ searchParameters?: SearchParamsObject;
106
110
  maxResultsPerGroup?: number;
107
111
  transformItems?: (items: DocSearchHit[]) => DocSearchHit[];
108
112
  hitComponent?: (props: {
@@ -112,7 +116,7 @@ interface DocSearchProps {
112
116
  resultsFooterComponent?: (props: {
113
117
  state: AutocompleteState<InternalDocSearchHit>;
114
118
  }) => JSX.Element | null;
115
- transformSearchClient?: <T extends LiteClient | SearchClient>(searchClient: T) => T;
119
+ transformSearchClient?: (searchClient: DocSearchTransformClient) => DocSearchTransformClient;
116
120
  disableUserPersonalization?: boolean;
117
121
  initialQuery?: string;
118
122
  navigator?: AutocompleteOptions<InternalDocSearchHit>['navigator'];
@@ -199,6 +203,6 @@ interface UseDocSearchKeyboardEventsProps {
199
203
  }
200
204
  declare function useDocSearchKeyboardEvents({ isOpen, onOpen, onClose, onInput, searchButtonRef, }: UseDocSearchKeyboardEventsProps): void;
201
205
 
202
- declare const version = "3.7.0";
206
+ declare const version = "3.8.1";
203
207
 
204
- export { type ButtonTranslations, DocSearch, DocSearchButton, type DocSearchButtonProps, type DocSearchHit, DocSearchModal, type DocSearchModalProps, type DocSearchProps, type DocSearchState, type DocSearchTranslations, type InternalDocSearchHit, type ModalTranslations, type StoredDocSearchHit, type UseDocSearchKeyboardEventsProps, useDocSearchKeyboardEvents, version };
208
+ export { type ButtonTranslations, DocSearch, DocSearchButton, type DocSearchButtonProps, type DocSearchHit, DocSearchModal, type DocSearchModalProps, type DocSearchProps, type DocSearchState, type DocSearchTransformClient, type DocSearchTranslations, type InternalDocSearchHit, type ModalTranslations, type StoredDocSearchHit, type UseDocSearchKeyboardEventsProps, useDocSearchKeyboardEvents, version };