@docsearch/js 4.2.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.d.ts +27 -3
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/index.js +4 -4
- package/dist/umd/index.js.map +1 -1
- package/package.json +5 -2
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InsightsMethodMap as InsightsMethodMap$1, InsightsClient as InsightsClient$1 } from 'search-insights';
|
|
2
2
|
import React, { JSX } from 'react';
|
|
3
|
+
import { JSX as JSX$1 } from 'preact';
|
|
3
4
|
|
|
4
5
|
type Cache = {
|
|
5
6
|
/**
|
|
@@ -8418,6 +8419,12 @@ type DocSearchAskAi = {
|
|
|
8418
8419
|
* The search parameters to use for the ask AI feature.
|
|
8419
8420
|
*/
|
|
8420
8421
|
searchParameters?: AskAiSearchParameters;
|
|
8422
|
+
/**
|
|
8423
|
+
* Enables displaying suggested questions on Ask AI's new conversation screen.
|
|
8424
|
+
*
|
|
8425
|
+
* @default false
|
|
8426
|
+
*/
|
|
8427
|
+
suggestedQuestions?: boolean;
|
|
8421
8428
|
};
|
|
8422
8429
|
interface DocSearchIndex {
|
|
8423
8430
|
name: string;
|
|
@@ -8472,16 +8479,28 @@ interface DocSearchProps$1 {
|
|
|
8472
8479
|
transformItems?: (items: DocSearchHit[]) => DocSearchHit[];
|
|
8473
8480
|
/**
|
|
8474
8481
|
* Custom component to render an individual hit.
|
|
8482
|
+
* Supports template patterns:
|
|
8483
|
+
* - HTML strings with html helper: (props, { html }) => html`<div>...</div>`
|
|
8484
|
+
* - JSX templates: (props) => <div>...</div>
|
|
8485
|
+
* - Function-based templates: (props) => string | JSX.Element | Function.
|
|
8475
8486
|
*/
|
|
8476
8487
|
hitComponent?: (props: {
|
|
8477
8488
|
hit: InternalDocSearchHit | StoredDocSearchHit;
|
|
8478
8489
|
children: React.ReactNode;
|
|
8490
|
+
}, helpers?: {
|
|
8491
|
+
html: (template: TemplateStringsArray, ...values: any[]) => any;
|
|
8479
8492
|
}) => JSX.Element;
|
|
8480
8493
|
/**
|
|
8481
8494
|
* Custom component rendered at the bottom of the results panel.
|
|
8495
|
+
* Supports template patterns:
|
|
8496
|
+
* - HTML strings with html helper: (props, { html }) => html`<div>...</div>`
|
|
8497
|
+
* - JSX templates: (props) => <div>...</div>
|
|
8498
|
+
* - Function-based templates: (props) => string | JSX.Element | Function.
|
|
8482
8499
|
*/
|
|
8483
8500
|
resultsFooterComponent?: (props: {
|
|
8484
8501
|
state: AutocompleteState$1<InternalDocSearchHit>;
|
|
8502
|
+
}, helpers?: {
|
|
8503
|
+
html: (template: TemplateStringsArray, ...values: any[]) => any;
|
|
8485
8504
|
}) => JSX.Element | null;
|
|
8486
8505
|
/**
|
|
8487
8506
|
* Hook to wrap or modify the algolia search client.
|
|
@@ -8655,10 +8674,15 @@ type ModalTranslations = Partial<{
|
|
|
8655
8674
|
footer: FooterTranslations;
|
|
8656
8675
|
}> & ScreenStateTranslations;
|
|
8657
8676
|
|
|
8658
|
-
|
|
8677
|
+
type DocSearchProps = DocSearchProps$1 & {
|
|
8659
8678
|
container: HTMLElement | string;
|
|
8660
8679
|
environment?: typeof window;
|
|
8661
|
-
}
|
|
8662
|
-
declare
|
|
8680
|
+
};
|
|
8681
|
+
declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => JSX$1.Element;
|
|
8682
|
+
type TemplateHelpers = Record<string, unknown> & {
|
|
8683
|
+
html: typeof html;
|
|
8684
|
+
};
|
|
8685
|
+
declare function docsearch(allProps: DocSearchProps): () => void;
|
|
8663
8686
|
|
|
8664
8687
|
export { docsearch as default };
|
|
8688
|
+
export type { DocSearchProps, TemplateHelpers };
|