@docsearch/js 5.0.0-beta.2 → 5.0.0-beta.4
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/docsearch.d.ts +38 -7
- package/dist/esm/docsearch.js +33 -32
- package/dist/esm/docsearch.js.map +1 -1
- package/dist/esm/index.d.ts +39 -7
- package/dist/esm/index.js +303 -88
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/docsearch.js +5 -5
- package/dist/umd/docsearch.js.map +1 -1
- package/dist/umd/index.js +15 -15
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/*! @docsearch/js 5.0.0-beta.
|
|
2
|
-
import { DocSearchAIProps as DocSearchAIProps$1 } from "@docsearch/react/docsearchAi";
|
|
1
|
+
/*! @docsearch/js 5.0.0-beta.4 (UNRELEASED 11d6ed4) | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */
|
|
3
2
|
import { InitialAskAiMessage } from "@docsearch/core";
|
|
3
|
+
import { HitComponentProps, ResultsFooterComponentProps } from "@docsearch/react";
|
|
4
|
+
import { DocSearchAIProps as DocSearchAIProps$1 } from "@docsearch/react/docsearchAi";
|
|
4
5
|
//#region ../../node_modules/.bun/preact@11.0.0-beta.0/node_modules/preact/src/index.d.ts
|
|
5
6
|
import JSX = JSXInternal;
|
|
6
7
|
//#endregion
|
|
@@ -19,18 +20,49 @@ interface DocSearchCallbacks {
|
|
|
19
20
|
onClose?: () => void;
|
|
20
21
|
interceptAskAiEvent?: (initialMessage: InitialAskAiMessage) => boolean | void;
|
|
21
22
|
}
|
|
22
|
-
type
|
|
23
|
+
type TemplateHelpers = {
|
|
24
|
+
html: typeof html;
|
|
25
|
+
};
|
|
26
|
+
type TemplateFnReturnType = JSX.Element | string | (() => JSX.Element) | null;
|
|
27
|
+
type HitComponentFn = (props: HitComponentProps, helpers: TemplateHelpers) => TemplateFnReturnType;
|
|
28
|
+
type ResultsFooterComponentFn = (props: ResultsFooterComponentProps, helpers: TemplateHelpers) => TemplateFnReturnType;
|
|
29
|
+
type FooterActionFn = (props: never, helpers: TemplateHelpers) => TemplateFnReturnType;
|
|
30
|
+
type DocSearchProps<TProps> = DocSearchCallbacks & Omit<TProps, 'onSidepanelClose' | 'onSidepanelOpen' | 'hitComponent' | 'resultsFooterComponent' | 'footerAction'> & {
|
|
23
31
|
container: HTMLElement | string;
|
|
24
32
|
environment?: typeof window;
|
|
33
|
+
/**
|
|
34
|
+
* Custom component to render an individual hit. Supports template patterns:
|
|
35
|
+
*
|
|
36
|
+
* - HTML strings with html helper: (props, { html }) => html`<div>...</div>`
|
|
37
|
+
* - JSX templates: (props) => <div>...</div>
|
|
38
|
+
* - Function-based templates: (props) => string | JSX.Element | Function.
|
|
39
|
+
*/
|
|
40
|
+
hitComponent?: HitComponentFn;
|
|
41
|
+
/**
|
|
42
|
+
* Custom component rendered at the bottom of the results panel. Supports
|
|
43
|
+
* template patterns:
|
|
44
|
+
*
|
|
45
|
+
* - HTML strings with html helper: (props, { html }) => html`<div>...</div>`
|
|
46
|
+
* - JSX templates: (props) => <div>...</div>
|
|
47
|
+
* - Function-based templates: (props) => string | JSX.Element | Function.
|
|
48
|
+
*/
|
|
49
|
+
resultsFooterComponent?: ResultsFooterComponentFn;
|
|
50
|
+
/**
|
|
51
|
+
* A custom action that can be rendered in the Modal's footer before the
|
|
52
|
+
* Algolia logo. The component will be rendered as a child of `<div
|
|
53
|
+
* className="DocSearch-Footer-Action" />`. Supports template patterns:
|
|
54
|
+
*
|
|
55
|
+
* - HTML strings with html helper: (props, { html }) => html`<div>...</div>`
|
|
56
|
+
* - JSX templates: (props) => <div>...</div>
|
|
57
|
+
* - Function-based templates: (props) => string | JSX.Element | Function.
|
|
58
|
+
*/
|
|
59
|
+
footerAction?: FooterActionFn;
|
|
25
60
|
};
|
|
26
61
|
declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => JSX.Element;
|
|
27
|
-
type TemplateHelpers = Record<string, unknown> & {
|
|
28
|
-
html: typeof html;
|
|
29
|
-
};
|
|
30
62
|
//#endregion
|
|
31
63
|
//#region src/docsearchAi.d.ts
|
|
32
64
|
type DocSearchAIProps = DocSearchProps<DocSearchAIProps$1>;
|
|
33
65
|
declare const docsearchAi: (allProps: DocSearchAIProps) => DocSearchInstance;
|
|
34
66
|
//#endregion
|
|
35
|
-
export { type DocSearchCallbacks, type DocSearchInstance, type DocSearchAIProps as DocSearchProps, type TemplateHelpers, docsearchAi as default };
|
|
67
|
+
export { type DocSearchCallbacks, type DocSearchInstance, type DocSearchAIProps as DocSearchProps, type FooterActionFn, type HitComponentFn, type ResultsFooterComponentFn, type TemplateHelpers, docsearchAi as default };
|
|
36
68
|
//# sourceMappingURL=index.d.ts.map
|