@searchcraft/javascript-sdk 0.9.7 → 0.10.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/README.md +2 -2
- package/dist/components/defineCustomElements.js +8 -6
- package/dist/components/index.d.ts +2632 -68
- package/dist/components/index.js +51 -15
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-e41b0f43.js → p-0077f677.js} +14 -21
- package/dist/components/p-0077f677.js.map +1 -0
- package/dist/components/p-13e81b5d.js +147 -0
- package/dist/components/p-13e81b5d.js.map +1 -0
- package/dist/components/p-172a848d.js +93 -0
- package/dist/components/p-172a848d.js.map +1 -0
- package/dist/components/{p-580c09dc.js → p-17c646e2.js} +226 -190
- package/dist/components/p-17c646e2.js.map +1 -0
- package/dist/components/{p-e55a7970.js → p-1adf78b9.js} +2 -2
- package/dist/components/p-1adf78b9.js.map +1 -0
- package/dist/components/{p-e27a0dab.js → p-2be1a382.js} +5 -7
- package/dist/components/p-2be1a382.js.map +1 -0
- package/dist/components/{p-4df578e4.js → p-3e65aa91.js} +8 -8
- package/dist/components/p-3e65aa91.js.map +1 -0
- package/dist/components/{p-8f854dec.js → p-5d17ace0.js} +14 -13
- package/dist/components/p-5d17ace0.js.map +1 -0
- package/dist/components/{p-bf6a086a.js → p-73db9122.js} +3 -10
- package/dist/components/p-73db9122.js.map +1 -0
- package/dist/components/p-810a7850.js +17 -0
- package/dist/components/p-810a7850.js.map +1 -0
- package/dist/components/p-84e2cbd6.js +46 -0
- package/dist/components/p-84e2cbd6.js.map +1 -0
- package/dist/components/{p-bb12ab5a.js → p-868803f9.js} +4 -3
- package/dist/components/p-868803f9.js.map +1 -0
- package/dist/components/{p-60f05735.js → p-a62a2e74.js} +4 -4
- package/dist/components/p-a62a2e74.js.map +1 -0
- package/dist/components/{p-5fdaf1e6.js → p-a64b4cba.js} +2 -145
- package/dist/components/p-a64b4cba.js.map +1 -0
- package/dist/components/{p-71cc28c1.js → p-acf23bab.js} +2 -2
- package/dist/components/p-acf23bab.js.map +1 -0
- package/dist/components/{p-0e393fe1.js → p-f2585cdf.js} +3 -9
- package/dist/components/p-f2585cdf.js.map +1 -0
- package/dist/components/searchcraft-ad.js +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +6 -5
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +2 -2
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-pagination.js +3 -9
- package/dist/components/searchcraft-pagination.js.map +1 -1
- package/dist/components/searchcraft-popover-button.js +95 -3
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-footer.d.ts +11 -0
- package/dist/components/searchcraft-popover-footer.js +8 -0
- package/dist/components/searchcraft-popover-footer.js.map +1 -0
- package/dist/components/searchcraft-popover-form.js +36 -27
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.js +1 -1
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +12 -23
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-result.d.ts +11 -0
- package/dist/components/searchcraft-search-result.js +8 -0
- package/dist/components/searchcraft-search-result.js.map +1 -0
- package/dist/components/searchcraft-search-results-per-page.js +3 -10
- package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
- package/dist/components/searchcraft-search-results.d.ts +11 -0
- package/dist/components/{searchcraft-base-search-results.js → searchcraft-search-results.js} +25 -71
- package/dist/components/searchcraft-search-results.js.map +1 -0
- package/dist/components/searchcraft-select.js +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-theme.js +4 -42
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/hydrate/index.d.ts +242 -0
- package/dist/hydrate/index.js +23479 -0
- package/dist/hydrate/index.mjs +23471 -0
- package/dist/hydrate/package.json +12 -0
- package/dist/themes/hologram.css +1 -0
- package/dist/themes/hologram.css.map +1 -0
- package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +2 -0
- package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +3 -2
- package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +6 -7
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +3 -1
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +30 -1
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +23 -14
- package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +3 -2
- package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +22 -8
- package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +74 -0
- package/dist/types/components/searchcraft-popover-footer/searchcraft-popover-footer.d.ts +13 -0
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +27 -15
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +5 -3
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +3 -2
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +41 -19
- package/dist/types/components/searchcraft-search-result/searchcraft-search-result.d.ts +28 -0
- package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +81 -0
- package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +21 -5
- package/dist/types/components/searchcraft-select/searchcraft-select.d.ts +3 -5
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +3 -3
- package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +24 -16
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
- package/dist/types/components.d.ts +947 -612
- package/dist/types/index.d.ts +5 -4
- package/dist/types/store/SearchcraftStore.types.d.ts +3 -0
- package/dist/types/utils/html.d.ts +6 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +13 -7
- package/dist/components/bundled.types.d.ts +0 -2275
- package/dist/components/p-0e393fe1.js.map +0 -1
- package/dist/components/p-19fe91f1.js +0 -136
- package/dist/components/p-19fe91f1.js.map +0 -1
- package/dist/components/p-4df578e4.js.map +0 -1
- package/dist/components/p-580c09dc.js.map +0 -1
- package/dist/components/p-5fdaf1e6.js.map +0 -1
- package/dist/components/p-60f05735.js.map +0 -1
- package/dist/components/p-71cc28c1.js.map +0 -1
- package/dist/components/p-8f854dec.js.map +0 -1
- package/dist/components/p-bb12ab5a.js.map +0 -1
- package/dist/components/p-bf6a086a.js.map +0 -1
- package/dist/components/p-d9551738.js +0 -25
- package/dist/components/p-d9551738.js.map +0 -1
- package/dist/components/p-e27a0dab.js.map +0 -1
- package/dist/components/p-e41b0f43.js.map +0 -1
- package/dist/components/p-e55a7970.js.map +0 -1
- package/dist/components/searchcraft-base-search-result.d.ts +0 -11
- package/dist/components/searchcraft-base-search-result.js +0 -8
- package/dist/components/searchcraft-base-search-result.js.map +0 -1
- package/dist/components/searchcraft-base-search-results.d.ts +0 -11
- package/dist/components/searchcraft-base-search-results.js.map +0 -1
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +0 -55
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +0 -89
|
@@ -1,78 +1,2642 @@
|
|
|
1
|
-
|
|
2
|
-
export { SearchcraftPopoverListItemAd as SearchcraftAd } from '../types/components/searchcraft-ad/searchcraft-ad';
|
|
3
|
-
export { defineCustomElement as defineCustomElementSearchcraftAd } from './searchcraft-ad';
|
|
4
|
-
export { SearchcraftBaseSearchResult as SearchcraftBaseSearchResult } from '../types/components/searchcraft-base-search-result/searchcraft-base-search-result';
|
|
5
|
-
export { defineCustomElement as defineCustomElementSearchcraftBaseSearchResult } from './searchcraft-base-search-result';
|
|
6
|
-
export { SearchcraftBaseSearchResults as SearchcraftBaseSearchResults } from '../types/components/searchcraft-base-search-results/searchcraft-base-search-results';
|
|
7
|
-
export { defineCustomElement as defineCustomElementSearchcraftBaseSearchResults } from './searchcraft-base-search-results';
|
|
8
|
-
export { SearchcraftButton as SearchcraftButton } from '../types/components/searchcraft-button/searchcraft-button';
|
|
9
|
-
export { defineCustomElement as defineCustomElementSearchcraftButton } from './searchcraft-button';
|
|
10
|
-
export { SearchcraftErrorMessage as SearchcraftErrorMessage } from '../types/components/searchcraft-error-message/searchcraft-error-message';
|
|
11
|
-
export { defineCustomElement as defineCustomElementSearchcraftErrorMessage } from './searchcraft-error-message';
|
|
12
|
-
export { SearchcraftFacetList as SearchcraftFacetList } from '../types/components/searchcraft-facet-list/searchcraft-facet-list';
|
|
13
|
-
export { defineCustomElement as defineCustomElementSearchcraftFacetList } from './searchcraft-facet-list';
|
|
14
|
-
export { SearchcraftFilterPanel as SearchcraftFilterPanel } from '../types/components/searchcraft-filter-panel/searchcraft-filter-panel';
|
|
15
|
-
export { defineCustomElement as defineCustomElementSearchcraftFilterPanel } from './searchcraft-filter-panel';
|
|
16
|
-
export { SearchcraftInput as SearchcraftInputForm } from '../types/components/searchcraft-input-form/searchcraft-input-form';
|
|
17
|
-
export { defineCustomElement as defineCustomElementSearchcraftInputForm } from './searchcraft-input-form';
|
|
18
|
-
export { SearchcraftInputLabel as SearchcraftInputLabel } from '../types/components/searchcraft-input-label/searchcraft-input-label';
|
|
19
|
-
export { defineCustomElement as defineCustomElementSearchcraftInputLabel } from './searchcraft-input-label';
|
|
20
|
-
export { SearchcraftPagination as SearchcraftPagination } from '../types/components/searchcraft-pagination/searchcraft-pagination';
|
|
21
|
-
export { defineCustomElement as defineCustomElementSearchcraftPagination } from './searchcraft-pagination';
|
|
22
|
-
export { SearchcraftPopoverButton as SearchcraftPopoverButton } from '../types/components/searchcraft-popover-button/searchcraft-popover-button';
|
|
23
|
-
export { defineCustomElement as defineCustomElementSearchcraftPopoverButton } from './searchcraft-popover-button';
|
|
24
|
-
export { SearchcraftPopoverForm as SearchcraftPopoverForm } from '../types/components/searchcraft-popover-form/searchcraft-popover-form';
|
|
25
|
-
export { defineCustomElement as defineCustomElementSearchcraftPopoverForm } from './searchcraft-popover-form';
|
|
26
|
-
export { SearchcraftPopoverListItem as SearchcraftPopoverListItem } from '../types/components/searchcraft-popover-list-item/searchcraft-popover-list-item';
|
|
27
|
-
export { defineCustomElement as defineCustomElementSearchcraftPopoverListItem } from './searchcraft-popover-list-item';
|
|
28
|
-
export { SearchcraftPopoverListView as SearchcraftPopoverListView } from '../types/components/searchcraft-popover-list-view/searchcraft-popover-list-view';
|
|
29
|
-
export { defineCustomElement as defineCustomElementSearchcraftPopoverListView } from './searchcraft-popover-list-view';
|
|
30
|
-
export { SearchcraftResultsInfo as SearchcraftResultsInfo } from '../types/components/searchcraft-results-info/searchcraft-results-info';
|
|
31
|
-
export { defineCustomElement as defineCustomElementSearchcraftResultsInfo } from './searchcraft-results-info';
|
|
32
|
-
export { SearchcraftSearchResultsPerPage as SearchcraftSearchResultsPerPage } from '../types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page';
|
|
33
|
-
export { defineCustomElement as defineCustomElementSearchcraftSearchResultsPerPage } from './searchcraft-search-results-per-page';
|
|
34
|
-
export { SearchcraftSelect as SearchcraftSelect } from '../types/components/searchcraft-select/searchcraft-select';
|
|
35
|
-
export { defineCustomElement as defineCustomElementSearchcraftSelect } from './searchcraft-select';
|
|
36
|
-
export { SearchcraftSlider as SearchcraftSlider } from '../types/components/searchcraft-slider/searchcraft-slider';
|
|
37
|
-
export { defineCustomElement as defineCustomElementSearchcraftSlider } from './searchcraft-slider';
|
|
38
|
-
export { SearchcraftTheme as SearchcraftTheme } from '../types/components/searchcraft-theme/searchcraft-theme';
|
|
39
|
-
export { defineCustomElement as defineCustomElementSearchcraftTheme } from './searchcraft-theme';
|
|
40
|
-
export { SearchcraftToggleButton as SearchcraftToggleButton } from '../types/components/searchcraft-toggle-button/searchcraft-toggle-button';
|
|
41
|
-
export { defineCustomElement as defineCustomElementSearchcraftToggleButton } from './searchcraft-toggle-button';
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
42
2
|
|
|
3
|
+
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
|
|
4
|
+
|
|
5
|
+
declare enum LogLevel {
|
|
6
|
+
DEBUG = 0,
|
|
7
|
+
INFO = 1,
|
|
8
|
+
WARN = 2,
|
|
9
|
+
ERROR = 3
|
|
10
|
+
}
|
|
11
|
+
export interface SDKDebuggerOptions {
|
|
12
|
+
logLevel: LogLevel;
|
|
13
|
+
logFormatter?: (level: LogLevel, message: string) => string;
|
|
14
|
+
}
|
|
15
|
+
declare class Logger {
|
|
16
|
+
private logLevel;
|
|
17
|
+
private logFormatter;
|
|
18
|
+
constructor(options: SDKDebuggerOptions);
|
|
19
|
+
private defaultFormatter;
|
|
20
|
+
debug(message: string): void;
|
|
21
|
+
info(message: string): void;
|
|
22
|
+
warn(message: string): void;
|
|
23
|
+
error(message: string): void;
|
|
24
|
+
log(level: LogLevel, message: string): void;
|
|
25
|
+
}
|
|
43
26
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
27
|
+
* A data type representing an index field value, along with properties
|
|
28
|
+
* describing how to format and display the index field value.
|
|
46
29
|
*/
|
|
47
|
-
export
|
|
48
|
-
|
|
30
|
+
export type SearchResultFieldName = {
|
|
31
|
+
/**
|
|
32
|
+
* The index field name.
|
|
33
|
+
*/
|
|
34
|
+
fieldName: string;
|
|
35
|
+
/**
|
|
36
|
+
* The data type to treat this index field as.
|
|
37
|
+
*/
|
|
38
|
+
dataType: "text" | "date" | "number";
|
|
39
|
+
/**
|
|
40
|
+
* The locale to use when formatting dataType: `number`
|
|
41
|
+
*/
|
|
42
|
+
numberFormatLocale?: string;
|
|
43
|
+
/**
|
|
44
|
+
* If it's a number, the number format to apply.
|
|
45
|
+
* reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
46
|
+
*/
|
|
47
|
+
numberFormatOptions?: Intl.NumberFormatOptions;
|
|
48
|
+
/**
|
|
49
|
+
* A scale factor to apply to a `number` value.
|
|
50
|
+
*/
|
|
51
|
+
numberScale?: number;
|
|
52
|
+
/**
|
|
53
|
+
* TODO: Implement DateFormatOptions, for date formatting
|
|
54
|
+
*/
|
|
55
|
+
dateFormatOptions?: unknown;
|
|
56
|
+
};
|
|
49
57
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* such as "setAssetPath(import.meta.url)". Other options include
|
|
53
|
-
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
54
|
-
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
55
|
-
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
56
|
-
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
57
|
-
* will have to ensure the static assets are copied to its build directory.
|
|
58
|
+
* A data type representing the mapping of index fields, for the purpose of rendering them
|
|
59
|
+
* in search result item.
|
|
58
60
|
*/
|
|
59
|
-
export
|
|
60
|
-
|
|
61
|
+
export type SearchResultMapping = {
|
|
62
|
+
/**
|
|
63
|
+
* The fields to map to.
|
|
64
|
+
*/
|
|
65
|
+
fieldNames: SearchResultFieldName[];
|
|
66
|
+
/**
|
|
67
|
+
* The delimiter used to join them.
|
|
68
|
+
*/
|
|
69
|
+
delimiter?: string;
|
|
70
|
+
};
|
|
71
|
+
export type PopoverResultMappings = {
|
|
72
|
+
title?: SearchResultMapping;
|
|
73
|
+
subtitle?: SearchResultMapping;
|
|
74
|
+
imageSource?: SearchResultMapping;
|
|
75
|
+
imageAlt?: SearchResultMapping;
|
|
76
|
+
href?: SearchResultMapping;
|
|
77
|
+
};
|
|
78
|
+
export interface FilterItem {
|
|
79
|
+
type: "facets" | "dateRange" | "numericRange" | "exactMatchToggle" | "mostRecentToggle";
|
|
80
|
+
label: string;
|
|
81
|
+
options: object | null;
|
|
82
|
+
}
|
|
83
|
+
export interface FacetsFilterItem extends FilterItem {
|
|
84
|
+
fieldName: string;
|
|
85
|
+
type: "facets";
|
|
86
|
+
options: {
|
|
87
|
+
showSublevel: boolean;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export interface NumericFilterItem extends FilterItem {
|
|
91
|
+
fieldName: string;
|
|
92
|
+
type: "numericRange";
|
|
93
|
+
options: {
|
|
94
|
+
min: number;
|
|
95
|
+
max: number;
|
|
96
|
+
granularity: number;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface DateRangeFilterItem extends FilterItem {
|
|
100
|
+
fieldName: string;
|
|
101
|
+
type: "dateRange";
|
|
102
|
+
options: {
|
|
103
|
+
minDate: Date;
|
|
104
|
+
maxDate: Date;
|
|
105
|
+
granularity: "year" | "month" | "day" | "hour";
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export interface ExactMatchToggleFilterItem extends FilterItem {
|
|
109
|
+
type: "exactMatchToggle";
|
|
110
|
+
options: {
|
|
111
|
+
subLabel?: string;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export interface MostRecentToggleFilterItem extends FilterItem {
|
|
115
|
+
type: "mostRecentToggle";
|
|
116
|
+
options: {
|
|
117
|
+
subLabel?: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export type TemplateHtml = (strings: TemplateStringsArray, ...values: (string | number | undefined)[]) => string;
|
|
121
|
+
export type SearchResultTemplate<T> = (data: T, index: number, utils: {
|
|
122
|
+
html: TemplateHtml;
|
|
123
|
+
}) => string;
|
|
124
|
+
export type SearchResultTemplateData = any;
|
|
125
|
+
export type ResultsInfoTemplate = (data: {
|
|
126
|
+
range: [
|
|
127
|
+
number,
|
|
128
|
+
number
|
|
129
|
+
];
|
|
130
|
+
count: number;
|
|
131
|
+
responseTime: string;
|
|
132
|
+
}, utils: {
|
|
133
|
+
html: TemplateHtml;
|
|
134
|
+
}) => string;
|
|
135
|
+
export type CustomAdTemplate = (data: {
|
|
136
|
+
adContainerId: string;
|
|
137
|
+
searchTerm: string;
|
|
138
|
+
}, utils: {
|
|
139
|
+
html: TemplateHtml;
|
|
140
|
+
}) => string;
|
|
141
|
+
export type PopoverButtonTemplate = (data: boolean, utils: {
|
|
142
|
+
html: TemplateHtml;
|
|
143
|
+
}) => string;
|
|
61
144
|
/**
|
|
62
|
-
*
|
|
63
|
-
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
64
|
-
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
65
|
-
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
66
|
-
* will result in the same behavior.
|
|
145
|
+
* The SearchcraftConfig object is used to initialize Searchcraft in your application.
|
|
67
146
|
*/
|
|
68
|
-
export
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
147
|
+
export interface SearchcraftConfig {
|
|
148
|
+
/**
|
|
149
|
+
* Host IP Address and port number configured and created using Vektron
|
|
150
|
+
*/
|
|
151
|
+
endpointURL: string;
|
|
152
|
+
/**
|
|
153
|
+
* Name or names of search indices configured using Vektron. Given as an array of strings
|
|
154
|
+
*/
|
|
155
|
+
index: string[];
|
|
156
|
+
/**
|
|
157
|
+
* A unique user identifier for the end user.
|
|
158
|
+
*/
|
|
159
|
+
userId?: string;
|
|
160
|
+
/**
|
|
161
|
+
* The Index read key provided by Vektron.
|
|
162
|
+
*/
|
|
163
|
+
readKey: string;
|
|
164
|
+
/**
|
|
165
|
+
* The amount of delay, in milliseconds, to debounce search requests. Defaults to `0`.
|
|
166
|
+
*/
|
|
167
|
+
searchDebounceDelay?: number;
|
|
168
|
+
/**
|
|
169
|
+
* The maximum number of results to return per page.
|
|
170
|
+
*/
|
|
171
|
+
searchResultsPerPage?: number;
|
|
172
|
+
/**
|
|
173
|
+
* Name of the ad source to use.
|
|
174
|
+
*/
|
|
175
|
+
adSource?: "adMarketplace" | "Nativo" | "Custom" | "None";
|
|
176
|
+
/**
|
|
177
|
+
* The maximum number of product ads to show for a single search term.
|
|
178
|
+
*/
|
|
179
|
+
admProductAdQuantity?: number;
|
|
180
|
+
/**
|
|
181
|
+
* The maximum number of text ads to show for a single search term.
|
|
182
|
+
*/
|
|
183
|
+
admTextAdQuantity?: number;
|
|
184
|
+
/**
|
|
185
|
+
* The adm sub value.
|
|
186
|
+
*/
|
|
187
|
+
admSub?: string;
|
|
188
|
+
/**
|
|
189
|
+
* The amount of debounce delay to add before calling the ad_container_rendered event
|
|
190
|
+
*/
|
|
191
|
+
adContainerRenderedDebounceDelay?: number;
|
|
192
|
+
/**
|
|
193
|
+
* The number of custom ads to render at the start of the search results page.
|
|
194
|
+
*/
|
|
195
|
+
customAdStartQuantity?: number;
|
|
196
|
+
/**
|
|
197
|
+
* The number of custom ads to render at the end of the search results page.
|
|
198
|
+
*/
|
|
199
|
+
customAdEndQuantity?: number;
|
|
200
|
+
/**
|
|
201
|
+
* Renders a custom ad in between search results, at the specified interval.
|
|
202
|
+
*/
|
|
203
|
+
customAdInterstitialInterval?: number;
|
|
204
|
+
/**
|
|
205
|
+
* Specifies the number of ads to be rendered in each interstitial in between search results.
|
|
206
|
+
*/
|
|
207
|
+
customAdInterstitialQuantity?: number;
|
|
208
|
+
/**
|
|
209
|
+
* A callback function responsible for rendering the custom ad containers.
|
|
210
|
+
*/
|
|
211
|
+
customAdTemplate?: CustomAdTemplate;
|
|
212
|
+
/**
|
|
213
|
+
* The placement id to use for Nativo ads.
|
|
214
|
+
*/
|
|
215
|
+
nativoPlacementId?: number;
|
|
216
|
+
/**
|
|
217
|
+
* The class name for nativo ad containers.
|
|
218
|
+
*/
|
|
219
|
+
nativoAdClassName?: string;
|
|
220
|
+
/**
|
|
221
|
+
* The number of custom ads to render at the start of the search results page.
|
|
222
|
+
*/
|
|
223
|
+
nativoAdStartQuantity?: number;
|
|
224
|
+
/**
|
|
225
|
+
* The number of custom ads to render at the end of the search results page.
|
|
226
|
+
*/
|
|
227
|
+
nativoAdEndQuantity?: number;
|
|
228
|
+
/**
|
|
229
|
+
* Renders a custom ad in between search results, at the specified interval.
|
|
230
|
+
*/
|
|
231
|
+
nativoAdInterstitialInterval?: number;
|
|
232
|
+
/**
|
|
233
|
+
* Specify how many normal search results to render before rendering the first interstitial ad grouping.
|
|
234
|
+
*/
|
|
235
|
+
nativoAdInterstialStartIndex?: number;
|
|
236
|
+
/**
|
|
237
|
+
* Specifies the number of ads to be rendered in each interstitial in between search results.
|
|
238
|
+
*/
|
|
239
|
+
nativoAdInterstitialQuantity?: number;
|
|
240
|
+
}
|
|
241
|
+
export type SearchcraftAdSource = "adMarketplace" | "Nativo" | "Custom" | "None";
|
|
242
|
+
/**
|
|
243
|
+
* Used internally by consuming packages as part of the core sdk constructor.
|
|
244
|
+
*/
|
|
245
|
+
export interface SearchcraftSDKInfo {
|
|
246
|
+
sdkName: string;
|
|
247
|
+
sdkVersion: string;
|
|
248
|
+
}
|
|
249
|
+
export interface AdClientResponseItem {
|
|
250
|
+
id: string;
|
|
251
|
+
adSource: SearchcraftAdSource;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* A Facet object returned in a search response.
|
|
255
|
+
*/
|
|
256
|
+
export type FacetRoot = {
|
|
257
|
+
[key: string]: FacetChild[];
|
|
258
|
+
};
|
|
259
|
+
export type FacetPrime = FacetRoot[];
|
|
260
|
+
/**
|
|
261
|
+
* Represents the structure of facets, which group search results into categories.
|
|
262
|
+
*/
|
|
263
|
+
export interface FacetChild {
|
|
264
|
+
count: number;
|
|
265
|
+
path: string;
|
|
266
|
+
children?: FacetChild[];
|
|
74
267
|
}
|
|
75
|
-
|
|
76
|
-
|
|
268
|
+
/**
|
|
269
|
+
* Types of measure requests that can be sent to the /measure/event endpoint.
|
|
270
|
+
*/
|
|
271
|
+
export type MeasureEventName = "sdk_initialized" | "search_requested" | "search_response_received" | "search_completed" | "document_clicked";
|
|
272
|
+
/**
|
|
273
|
+
* Properties attached to a measure request.
|
|
274
|
+
*/
|
|
275
|
+
export interface MeasureRequestProperties {
|
|
276
|
+
searchcraft_organization_id?: string;
|
|
277
|
+
searchcraft_application_id?: string;
|
|
278
|
+
searchcraft_index_names: string[];
|
|
279
|
+
search_term?: string;
|
|
280
|
+
number_of_documents?: number;
|
|
281
|
+
external_document_id?: string;
|
|
282
|
+
document_position?: number;
|
|
283
|
+
session_id?: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* User properties attached to a measure request.
|
|
287
|
+
*/
|
|
288
|
+
export interface MeasureRequestUser {
|
|
289
|
+
user_id: string;
|
|
290
|
+
country?: string;
|
|
291
|
+
city?: string;
|
|
292
|
+
device_id?: string;
|
|
293
|
+
client_ip?: string;
|
|
294
|
+
locale?: string;
|
|
295
|
+
os?: string;
|
|
296
|
+
platform?: string;
|
|
297
|
+
region?: string;
|
|
298
|
+
sdk_name?: string;
|
|
299
|
+
sdk_version?: string;
|
|
300
|
+
user_agent?: string;
|
|
301
|
+
latitude?: number;
|
|
302
|
+
longitude?: number;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* The structure of a response returned from a Searchcraft operation.
|
|
306
|
+
*/
|
|
307
|
+
export interface SearchcraftResponse {
|
|
308
|
+
status: number;
|
|
309
|
+
data: SearchcraftResponseData | SearchcraftResponseError;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Error returned when a search is unsuccessful.
|
|
313
|
+
*/
|
|
314
|
+
export type SearchcraftResponseError = {
|
|
315
|
+
status: number;
|
|
316
|
+
message?: string;
|
|
317
|
+
code?: number;
|
|
318
|
+
hits?: [
|
|
319
|
+
];
|
|
320
|
+
facets?: null;
|
|
321
|
+
count?: number;
|
|
322
|
+
time_taken?: number;
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Top-level result returned when a search is successful.
|
|
326
|
+
*/
|
|
327
|
+
export interface SearchcraftResponseData {
|
|
328
|
+
count?: number;
|
|
329
|
+
facets?: FacetPrime;
|
|
330
|
+
hits?: SearchIndexEntry[];
|
|
331
|
+
time_taken?: number;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Represents an entry in the search index returned as part of a search result.
|
|
335
|
+
*/
|
|
336
|
+
export interface SearchIndexEntry {
|
|
337
|
+
doc?: SearchDocument;
|
|
338
|
+
document_id?: string;
|
|
339
|
+
score?: number;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Data document returned within a SearchResult.
|
|
343
|
+
*/
|
|
344
|
+
export interface SearchDocument extends Record<string, string | number> {
|
|
345
|
+
id: number;
|
|
346
|
+
[key: string]: string | number;
|
|
347
|
+
}
|
|
348
|
+
export interface SearchClientResponseItem {
|
|
349
|
+
id: string;
|
|
350
|
+
document: SearchDocument;
|
|
351
|
+
}
|
|
352
|
+
export type FacetPathsForIndexField = {
|
|
353
|
+
fieldName: string;
|
|
354
|
+
value: string;
|
|
355
|
+
};
|
|
356
|
+
export type RangeValueForIndexField = {
|
|
357
|
+
fieldName: string;
|
|
358
|
+
value: string;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Parameters required to make a successful Search request.
|
|
362
|
+
*/
|
|
363
|
+
export type SearchParams = {
|
|
364
|
+
/**
|
|
365
|
+
* The search mode, which can be either 'fuzzy' or 'exact'.
|
|
366
|
+
*/
|
|
367
|
+
mode: "fuzzy" | "exact";
|
|
368
|
+
/**
|
|
369
|
+
* The starting point for the results, used for pagination.
|
|
370
|
+
* Optional parameter.
|
|
371
|
+
*/
|
|
372
|
+
offset?: number;
|
|
373
|
+
/**
|
|
374
|
+
* The number of results returned.
|
|
375
|
+
* Optional parameter.
|
|
376
|
+
*/
|
|
377
|
+
limit?: number;
|
|
378
|
+
/**
|
|
379
|
+
* The field to order the results by (e.g., 'date_published', 'title', etc.).
|
|
380
|
+
* Optional parameter.
|
|
381
|
+
*/
|
|
382
|
+
order_by?: string;
|
|
383
|
+
/**
|
|
384
|
+
* The search term provided by the user.
|
|
385
|
+
*/
|
|
386
|
+
searchTerm: string;
|
|
387
|
+
/**
|
|
388
|
+
* The sort order, which can be either 'asc' or 'desc'.
|
|
389
|
+
* Optional parameter.
|
|
390
|
+
*/
|
|
391
|
+
sort?: "asc" | "desc";
|
|
392
|
+
facetPathsForIndexFields?: Record<string, FacetPathsForIndexField>;
|
|
393
|
+
rangeValueForIndexFields?: Record<string, RangeValueForIndexField>;
|
|
394
|
+
};
|
|
395
|
+
export interface SubscriptionEventMap {
|
|
396
|
+
ad_container_rendered: AdContainerRenderedSubscriptionEvent;
|
|
397
|
+
ad_container_viewed: AdContainerViewedSubscriptionEvent;
|
|
398
|
+
query_fetched: QueryFetchedEvent;
|
|
399
|
+
query_submitted: QuerySubmittedEvent;
|
|
400
|
+
input_cleared: InputClearedEvent;
|
|
401
|
+
no_results_returned: NoResultsReturnedEvent;
|
|
402
|
+
}
|
|
403
|
+
export interface AdContainerRenderedSubscriptionEvent extends SubscriptionEvent {
|
|
404
|
+
name: "ad_container_rendered";
|
|
405
|
+
data: {
|
|
406
|
+
adContainerId: string;
|
|
407
|
+
adSource: SearchcraftAdSource;
|
|
408
|
+
searchTerm: string;
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
export interface AdContainerViewedSubscriptionEvent extends SubscriptionEvent {
|
|
412
|
+
name: "ad_container_viewed";
|
|
413
|
+
data: {
|
|
414
|
+
adContainerId: string;
|
|
415
|
+
adSource: SearchcraftAdSource;
|
|
416
|
+
searchTerm: string;
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
export interface QuerySubmittedEvent extends SubscriptionEvent {
|
|
420
|
+
name: "query_submitted";
|
|
421
|
+
data: {
|
|
422
|
+
searchTerm: string;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
export interface QueryFetchedEvent extends SubscriptionEvent {
|
|
426
|
+
name: "query_fetched";
|
|
427
|
+
data: {
|
|
428
|
+
searchTerm: string;
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
export interface InputClearedEvent extends SubscriptionEvent {
|
|
432
|
+
name: "input_cleared";
|
|
433
|
+
}
|
|
434
|
+
export interface NoResultsReturnedEvent extends SubscriptionEvent {
|
|
435
|
+
name: "no_results_returned";
|
|
436
|
+
}
|
|
437
|
+
export type SubscriptionEventName = keyof SubscriptionEventMap;
|
|
438
|
+
export type SubscriptionEventCallback<T extends SubscriptionEventName> = (event: SubscriptionEventMap[T]) => void;
|
|
439
|
+
export type UnsubscribeFunction = () => void;
|
|
440
|
+
export interface SubscriptionEvent {
|
|
441
|
+
name: SubscriptionEventName;
|
|
442
|
+
}
|
|
443
|
+
declare class AdClient {
|
|
444
|
+
config: SearchcraftConfig;
|
|
445
|
+
constructor(config: SearchcraftConfig);
|
|
446
|
+
getAdsForSearchParams(_params: SearchParams): Promise<AdClientResponseItem[]>;
|
|
447
|
+
onQuerySubmitted(_params: SearchParams): Promise<void>;
|
|
448
|
+
onQueryFetched(_params: SearchParams, _response: SearchcraftResponse): Promise<void>;
|
|
449
|
+
onInputCleared(): Promise<void>;
|
|
450
|
+
onAdContainerRendered(_data: {
|
|
451
|
+
adClientResponseItem?: AdClientResponseItem;
|
|
452
|
+
adContainerId: string;
|
|
453
|
+
adSource: SearchcraftAdSource;
|
|
454
|
+
searchTerm: string;
|
|
455
|
+
}): Promise<void>;
|
|
456
|
+
onAdContainerViewed(_data: {
|
|
457
|
+
adClientResponseItem?: AdClientResponseItem;
|
|
458
|
+
adContainerId: string;
|
|
459
|
+
adSource: SearchcraftAdSource;
|
|
460
|
+
searchTerm: string;
|
|
461
|
+
}): Promise<void>;
|
|
462
|
+
}
|
|
463
|
+
declare class MeasureClient {
|
|
464
|
+
private measureRequestTimeout;
|
|
465
|
+
private measureRequestsBatched;
|
|
466
|
+
private config;
|
|
467
|
+
private sdkInfo;
|
|
468
|
+
private userId;
|
|
469
|
+
private sessionId;
|
|
470
|
+
constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo, userId: string);
|
|
471
|
+
/**
|
|
472
|
+
* Getter for the base url used by the /measure endpoints.
|
|
473
|
+
*/
|
|
474
|
+
private get baseMeasureUrl();
|
|
475
|
+
/**
|
|
476
|
+
* Getter for the measure request user. Uses config values + navigator values.
|
|
477
|
+
*/
|
|
478
|
+
private get measureRequestUser();
|
|
479
|
+
/**
|
|
480
|
+
* Sends a measure event to the `/measure/event` endpoint for analytics purposes.
|
|
481
|
+
*
|
|
482
|
+
* @param {MeasureEventName} eventName - Name of the event.
|
|
483
|
+
* @param {Partial<MeasureRequestProperties>} properties - Additional properties to send with the event.
|
|
484
|
+
* @param {Partial<MeasureRequestUser>} user - Additional user properites to send with the event.
|
|
485
|
+
*/
|
|
486
|
+
sendMeasureEvent: (eventName: MeasureEventName, properties?: Partial<MeasureRequestProperties>, user?: Partial<MeasureRequestUser>) => Promise<void>;
|
|
487
|
+
}
|
|
488
|
+
declare class SearchClient {
|
|
489
|
+
private config;
|
|
490
|
+
private userId;
|
|
491
|
+
private parent;
|
|
492
|
+
private searchCompletedEventTimeout;
|
|
493
|
+
constructor(parent: SearchcraftCore, config: SearchcraftConfig, userId: string);
|
|
494
|
+
/**
|
|
495
|
+
* Getter for the base url used by the /search endpoint.
|
|
496
|
+
*/
|
|
497
|
+
private get baseSearchUrl();
|
|
498
|
+
/**
|
|
499
|
+
* Performs a search operation.
|
|
500
|
+
* @param {SearchParams} searchParams - The parameters for the search.
|
|
501
|
+
*/
|
|
502
|
+
getSearchResponse: (searchParams: SearchParams) => Promise<SearchcraftResponse>;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Javascript Class providing the functionality to interact with the Searchcraft BE
|
|
506
|
+
*/
|
|
507
|
+
export declare class SearchcraftCore {
|
|
508
|
+
config: SearchcraftConfig;
|
|
509
|
+
measureClient: MeasureClient | undefined;
|
|
510
|
+
searchClient: SearchClient | undefined;
|
|
511
|
+
adClient: AdClient | undefined;
|
|
512
|
+
userId: string;
|
|
513
|
+
private requestTimeout;
|
|
514
|
+
private subscriptionEvents;
|
|
515
|
+
constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo);
|
|
516
|
+
private initInputForms;
|
|
517
|
+
/**
|
|
518
|
+
* When changes happen in the DOM, we want to link any input forms found to the instance of the core.
|
|
519
|
+
*/
|
|
520
|
+
private startObservingMutations;
|
|
521
|
+
private initClients;
|
|
522
|
+
emitEvent<T extends SubscriptionEventName>(eventName: T, event: SubscriptionEventMap[T]): void;
|
|
523
|
+
subscribe<T extends SubscriptionEventName>(eventName: T, callback: SubscriptionEventCallback<T>): UnsubscribeFunction;
|
|
524
|
+
/**
|
|
525
|
+
* Called when a `<searchcraft-ad>` component is rendered
|
|
526
|
+
*/
|
|
527
|
+
handleAdContainerRendered(data: {
|
|
528
|
+
adClientResponseItem?: AdClientResponseItem;
|
|
529
|
+
adContainerId: string;
|
|
530
|
+
adSource: SearchcraftAdSource;
|
|
531
|
+
searchTerm: string;
|
|
532
|
+
}): void;
|
|
533
|
+
/**
|
|
534
|
+
* Called when a `<searchcraft-ad>` is viewed
|
|
535
|
+
*/
|
|
536
|
+
handleAdContainerViewed(data: {
|
|
537
|
+
adClientResponseItem?: AdClientResponseItem;
|
|
538
|
+
adContainerId: string;
|
|
539
|
+
adSource: SearchcraftAdSource;
|
|
540
|
+
searchTerm: string;
|
|
541
|
+
}): void;
|
|
542
|
+
/**
|
|
543
|
+
* Perform various actions when the input is cleared
|
|
544
|
+
*/
|
|
545
|
+
handleInputCleared(): void;
|
|
546
|
+
/**
|
|
547
|
+
* Gets items from the SearchClient and the AdClient.
|
|
548
|
+
*/
|
|
549
|
+
getItems: (searchParams: SearchParams, itemsCallback: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void, adCallback: (adClientResponseItems: AdClientResponseItem[]) => void) => void;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Callable functions made available by the SearchcraftStore.
|
|
553
|
+
*/
|
|
554
|
+
export interface SearchcraftStateFunctions {
|
|
555
|
+
addFacetPathsForIndexField: (data: FacetPathsForIndexField) => void;
|
|
556
|
+
addRangeValueForIndexField: (data: RangeValueForIndexField) => void;
|
|
557
|
+
getSearchcraftInstance: () => SearchcraftCore | undefined;
|
|
558
|
+
initialize: (searchcraft: unknown, debug?: boolean) => void;
|
|
559
|
+
removeFacetPathsForIndexField: (fieldName: string) => void;
|
|
560
|
+
removeRangeValueForIndexField: (fieldName: string) => void;
|
|
561
|
+
resetFacetPaths: () => void;
|
|
562
|
+
search: () => Promise<void>;
|
|
563
|
+
setPopoverVisibility: (isVisible: boolean) => void;
|
|
564
|
+
setSearchClientResponseItems: (results: SearchClientResponseItem[]) => void;
|
|
565
|
+
setSearchResultsPage: (page: number) => void;
|
|
566
|
+
setSearchResultsPerPage: (perPage: number) => void;
|
|
567
|
+
setSearchTerm: (searchTerm: string) => void;
|
|
568
|
+
setSearchMode: (mode: "fuzzy" | "exact") => void;
|
|
569
|
+
setSortType: (type: "asc" | "desc") => void;
|
|
570
|
+
setHotKeyAndHotKeyModifier: (hotkey?: string, hotkeyModifier?: "ctrl" | "meta" | "alt" | "option") => void;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Values stored in SearchcraftStore.
|
|
574
|
+
*/
|
|
575
|
+
export interface SearchcraftStateValues {
|
|
576
|
+
adClientResponseItems: AdClientResponseItem[];
|
|
577
|
+
core: SearchcraftCore | undefined;
|
|
578
|
+
hotkey: string;
|
|
579
|
+
hotkeyModifier: "ctrl" | "meta" | "alt" | "option";
|
|
580
|
+
logger: Logger | undefined;
|
|
581
|
+
facetPathsForIndexFields: Record<string, FacetPathsForIndexField>;
|
|
582
|
+
isPopoverVisible: boolean;
|
|
583
|
+
isSearchInProgress: boolean;
|
|
584
|
+
rangeValueForIndexFields: Record<string, RangeValueForIndexField>;
|
|
585
|
+
searchMode: "fuzzy" | "exact";
|
|
586
|
+
searchClientResponseItems: SearchClientResponseItem[];
|
|
587
|
+
searchResponseTimeTaken: number | undefined;
|
|
588
|
+
searchResponseFacetPrime: FacetPrime | undefined;
|
|
589
|
+
searchResultsCount: number;
|
|
590
|
+
searchResultsPage: number;
|
|
591
|
+
searchResultsPerPage: number;
|
|
592
|
+
searchTerm: string;
|
|
593
|
+
sortType: "asc" | "desc";
|
|
594
|
+
}
|
|
595
|
+
export interface SearchcraftState extends SearchcraftStateFunctions, SearchcraftStateValues {
|
|
596
|
+
}
|
|
597
|
+
export declare const searchcraftStore: import("zustand").StoreApi<SearchcraftState>;
|
|
598
|
+
export declare function parseCustomStyles(styles: string | Record<string, string>): Record<string, string>;
|
|
599
|
+
export declare function serializeStyles(styles: Record<string, Record<string, string>>): string;
|
|
600
|
+
export type SearchcraftSelectOption = {
|
|
601
|
+
label: string;
|
|
602
|
+
value: string | number;
|
|
603
|
+
selected?: boolean;
|
|
604
|
+
};
|
|
605
|
+
export namespace Components {
|
|
606
|
+
/**
|
|
607
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
608
|
+
*/
|
|
609
|
+
interface SearchcraftAd {
|
|
610
|
+
"adClientResponseItem"?: AdClientResponseItem;
|
|
611
|
+
"adContainerId": string;
|
|
612
|
+
"adSource": SearchcraftAdSource;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* This web component represents a button.
|
|
616
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
617
|
+
*/
|
|
618
|
+
interface SearchcraftButton {
|
|
619
|
+
/**
|
|
620
|
+
* Whether the button is disabled.
|
|
621
|
+
*/
|
|
622
|
+
"disabled"?: boolean;
|
|
623
|
+
/**
|
|
624
|
+
* Controls the visual representation of the button.
|
|
625
|
+
*/
|
|
626
|
+
"hierarchy"?: "primary" | "tertiary";
|
|
627
|
+
/**
|
|
628
|
+
* The icon element.
|
|
629
|
+
*/
|
|
630
|
+
"icon"?: Element;
|
|
631
|
+
/**
|
|
632
|
+
* Should the button only display an icon.
|
|
633
|
+
*/
|
|
634
|
+
"iconOnly"?: boolean;
|
|
635
|
+
/**
|
|
636
|
+
* The position of the icon.
|
|
637
|
+
*/
|
|
638
|
+
"iconPosition"?: "left" | "right";
|
|
639
|
+
/**
|
|
640
|
+
* The label for the button.
|
|
641
|
+
*/
|
|
642
|
+
"label": string;
|
|
643
|
+
/**
|
|
644
|
+
* The type of the button.
|
|
645
|
+
*/
|
|
646
|
+
"type"?: "submit" | "reset" | "button";
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
650
|
+
* @js-example ```html
|
|
651
|
+
* <searchcraft-error-message>
|
|
652
|
+
* No search results found for query
|
|
653
|
+
* </searchcraft-error-message>
|
|
654
|
+
* ```
|
|
655
|
+
*/
|
|
656
|
+
interface SearchcraftErrorMessage {
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
660
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
661
|
+
* @js-example ```html
|
|
662
|
+
* <!-- index.html -->
|
|
663
|
+
* <searchcraft-facet-list field-name="title" />
|
|
664
|
+
* ```
|
|
665
|
+
* ```js
|
|
666
|
+
* // index.js
|
|
667
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
668
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
669
|
+
* console.log('Facet selection updated');
|
|
670
|
+
* });
|
|
671
|
+
* ```
|
|
672
|
+
*/
|
|
673
|
+
interface SearchcraftFacetList {
|
|
674
|
+
/**
|
|
675
|
+
* The name of the field where facets are applied.
|
|
676
|
+
*/
|
|
677
|
+
"fieldName": string;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
681
|
+
* @react-import ```jsx
|
|
682
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
683
|
+
* ```
|
|
684
|
+
* @vue-import ```jsx
|
|
685
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
686
|
+
* ```
|
|
687
|
+
* @js-example ```html
|
|
688
|
+
* <!-- index.html -->
|
|
689
|
+
* <searchcraft-filter-panel />
|
|
690
|
+
* ```
|
|
691
|
+
* ```js
|
|
692
|
+
* // index.js
|
|
693
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
694
|
+
* if (filterPanel) {
|
|
695
|
+
* filterPanel.items = [];
|
|
696
|
+
* }
|
|
697
|
+
* ```
|
|
698
|
+
* @react-example ```jsx
|
|
699
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
700
|
+
* ```
|
|
701
|
+
* @vue-example ```jsx
|
|
702
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
703
|
+
* ```
|
|
704
|
+
*/
|
|
705
|
+
interface SearchcraftFilterPanel {
|
|
706
|
+
/**
|
|
707
|
+
* The items to filter.
|
|
708
|
+
*/
|
|
709
|
+
"items": FilterItem[];
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
713
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
714
|
+
* @react-import ```jsx
|
|
715
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
716
|
+
* ```
|
|
717
|
+
* @vue-import ```jsx
|
|
718
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
719
|
+
* ```
|
|
720
|
+
* @js-example ```html
|
|
721
|
+
* <searchcraft-input-form auto-search />
|
|
722
|
+
* ```
|
|
723
|
+
* @react-example ```jsx
|
|
724
|
+
* <SearchcraftInputForm autoSearch />
|
|
725
|
+
* ```
|
|
726
|
+
* @vue-example ```jsx
|
|
727
|
+
* <SearchcraftInputForm autoSearch />
|
|
728
|
+
* ```
|
|
729
|
+
*/
|
|
730
|
+
interface SearchcraftInputForm {
|
|
731
|
+
/**
|
|
732
|
+
* Whether or not to automatically submit the search term when the input changes.
|
|
733
|
+
*/
|
|
734
|
+
"autoSearch"?: boolean;
|
|
735
|
+
/**
|
|
736
|
+
* The label for the submit button.
|
|
737
|
+
*/
|
|
738
|
+
"buttonLabel"?: string;
|
|
739
|
+
/**
|
|
740
|
+
* Where to place the search button.
|
|
741
|
+
*/
|
|
742
|
+
"buttonPlacement"?: "left" | "right" | "none";
|
|
743
|
+
"core"?: SearchcraftCore;
|
|
744
|
+
/**
|
|
745
|
+
* The label rendered above the input.
|
|
746
|
+
*/
|
|
747
|
+
"inputLabel"?: string;
|
|
748
|
+
/**
|
|
749
|
+
* The input element's placeholder value.
|
|
750
|
+
*/
|
|
751
|
+
"placeholderValue"?: string;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
755
|
+
* @js-example ```html
|
|
756
|
+
* <searchcraft-input-label label="Search" />
|
|
757
|
+
* ```
|
|
758
|
+
*/
|
|
759
|
+
interface SearchcraftInputLabel {
|
|
760
|
+
/**
|
|
761
|
+
* The classname applied to the label element.
|
|
762
|
+
*/
|
|
763
|
+
"inputLabelClassName"?: string | undefined;
|
|
764
|
+
"label": string;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
768
|
+
* @react-import ```jsx
|
|
769
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
770
|
+
* ```
|
|
771
|
+
* @vue-import ```jsx
|
|
772
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
773
|
+
* ```
|
|
774
|
+
* @js-example ```html
|
|
775
|
+
* <searchcraft-pagination />
|
|
776
|
+
* ```
|
|
777
|
+
* @react-example ```jsx
|
|
778
|
+
* <SearchcraftPagination />
|
|
779
|
+
* ```
|
|
780
|
+
* @vue-example ```jsx
|
|
781
|
+
* <SearchcraftPagination />
|
|
782
|
+
* ```
|
|
783
|
+
*/
|
|
784
|
+
interface SearchcraftPagination {
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
788
|
+
* @react-import ```jsx
|
|
789
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
790
|
+
* ````
|
|
791
|
+
* @vue-import ```jsx
|
|
792
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
793
|
+
* ```
|
|
794
|
+
* @js-example ```html
|
|
795
|
+
* <!-- index.html -->
|
|
796
|
+
* <searchcraft-popover-button>
|
|
797
|
+
* Open popover
|
|
798
|
+
* </searchcraft-popover-button>
|
|
799
|
+
* ```
|
|
800
|
+
* ```js
|
|
801
|
+
* // index.js
|
|
802
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
803
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
804
|
+
* <span>Click me</span>
|
|
805
|
+
* `;
|
|
806
|
+
* ```
|
|
807
|
+
* @react-example ```jsx
|
|
808
|
+
* <SearchcraftPopoverButton
|
|
809
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
810
|
+
* <span>Click me</span>
|
|
811
|
+
* `}
|
|
812
|
+
* >
|
|
813
|
+
* Open popover
|
|
814
|
+
* </SearchcraftPopoverButton>
|
|
815
|
+
* ```
|
|
816
|
+
* @vue-example ```jsx
|
|
817
|
+
* <SearchcraftPopoverButton
|
|
818
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
819
|
+
* <span>Click me</span>
|
|
820
|
+
* `}
|
|
821
|
+
* >
|
|
822
|
+
* Open popover
|
|
823
|
+
* </SearchcraftPopoverButton>
|
|
824
|
+
* ```
|
|
825
|
+
*/
|
|
826
|
+
interface SearchcraftPopoverButton {
|
|
827
|
+
/**
|
|
828
|
+
* A callback function responsible for rendering the button contents.
|
|
829
|
+
*/
|
|
830
|
+
"template"?: PopoverButtonTemplate;
|
|
831
|
+
/**
|
|
832
|
+
* The type of popover button to render.
|
|
833
|
+
*/
|
|
834
|
+
"type"?: "skeuomorphic";
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
838
|
+
*/
|
|
839
|
+
interface SearchcraftPopoverFooter {
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
843
|
+
* @react-import ```jsx
|
|
844
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
845
|
+
* ```
|
|
846
|
+
* @vue-import ```jsx
|
|
847
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
848
|
+
* ```
|
|
849
|
+
* @js-example ```html
|
|
850
|
+
* <!-- index.html -->
|
|
851
|
+
* <searchcraft-popover-form type="inline" />
|
|
852
|
+
* ```
|
|
853
|
+
* ```js
|
|
854
|
+
* // index.js
|
|
855
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
856
|
+
* popoverForm.popoverResultMappings = {};
|
|
857
|
+
* ```
|
|
858
|
+
* @react-example ```jsx
|
|
859
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
860
|
+
* ```
|
|
861
|
+
* @vue-example ```jsx
|
|
862
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
863
|
+
* ```
|
|
864
|
+
*/
|
|
865
|
+
interface SearchcraftPopoverForm {
|
|
866
|
+
/**
|
|
867
|
+
* The hotkey that activates the popover.
|
|
868
|
+
*/
|
|
869
|
+
"hotkey"?: string;
|
|
870
|
+
/**
|
|
871
|
+
* The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
|
|
872
|
+
*/
|
|
873
|
+
"hotkeyModifier"?: "ctrl" | "meta" | "alt" | "option";
|
|
874
|
+
/**
|
|
875
|
+
* Formats the content rendered for each result.
|
|
876
|
+
*/
|
|
877
|
+
"popoverResultMappings"?: PopoverResultMappings;
|
|
878
|
+
/**
|
|
879
|
+
* The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
|
|
880
|
+
*/
|
|
881
|
+
"type"?: "inline" | "fullscreen" | "modal";
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
885
|
+
*/
|
|
886
|
+
interface SearchcraftPopoverListItem {
|
|
887
|
+
/**
|
|
888
|
+
* The document position relative to the search results (For Measure)
|
|
889
|
+
*/
|
|
890
|
+
"documentPosition": number;
|
|
891
|
+
"item": SearchClientResponseItem | undefined;
|
|
892
|
+
"popoverResultMappings": PopoverResultMappings | undefined;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
896
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
897
|
+
* @js-example ```html
|
|
898
|
+
* <searchcraft-popover-list-view />
|
|
899
|
+
* ```
|
|
900
|
+
*/
|
|
901
|
+
interface SearchcraftPopoverListView {
|
|
902
|
+
"adClientResponseItems": AdClientResponseItem[] | undefined;
|
|
903
|
+
/**
|
|
904
|
+
* The mappings that define how the data in the documents are mapped to the list-view-item elements.
|
|
905
|
+
*/
|
|
906
|
+
"popoverResultMappings": PopoverResultMappings | undefined;
|
|
907
|
+
/**
|
|
908
|
+
* The items to render in the list view.
|
|
909
|
+
*/
|
|
910
|
+
"searchClientResponseItems": SearchClientResponseItem[] | undefined;
|
|
911
|
+
"searchResultsPage": number;
|
|
912
|
+
"searchResultsPerPage": number;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
916
|
+
* @react-import ```jsx
|
|
917
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
918
|
+
* ```
|
|
919
|
+
* @vue-import ```jsx
|
|
920
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
921
|
+
* ```
|
|
922
|
+
* @js-example ```html
|
|
923
|
+
* <!-- index.html -->
|
|
924
|
+
* <searchcraft-results-info />
|
|
925
|
+
* ```
|
|
926
|
+
* ```js
|
|
927
|
+
* // index.js
|
|
928
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
929
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
930
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
931
|
+
* `;
|
|
932
|
+
* ```
|
|
933
|
+
* @react-example ```jsx
|
|
934
|
+
* <SearchcraftResultsInfo
|
|
935
|
+
* template={(info, { html }) => html`
|
|
936
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
937
|
+
* `}
|
|
938
|
+
* />
|
|
939
|
+
* ```
|
|
940
|
+
* @vue-example ```jsx
|
|
941
|
+
* <SearchcraftResultsInfo
|
|
942
|
+
* :template={(info, { html }) => html`
|
|
943
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
944
|
+
* `}
|
|
945
|
+
* />
|
|
946
|
+
* ```
|
|
947
|
+
*/
|
|
948
|
+
interface SearchcraftResultsInfo {
|
|
949
|
+
/**
|
|
950
|
+
* A callback function responsible for rendering the results info.
|
|
951
|
+
*/
|
|
952
|
+
"template"?: ResultsInfoTemplate;
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
956
|
+
*/
|
|
957
|
+
interface SearchcraftSearchResult {
|
|
958
|
+
/**
|
|
959
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
960
|
+
*/
|
|
961
|
+
"documentPosition": number;
|
|
962
|
+
/**
|
|
963
|
+
* The index.
|
|
964
|
+
*/
|
|
965
|
+
"index": number;
|
|
966
|
+
"item"?: SearchClientResponseItem;
|
|
967
|
+
/**
|
|
968
|
+
* A callback function responsible for rendering a result.
|
|
969
|
+
*/
|
|
970
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
974
|
+
* @react-import ```jsx
|
|
975
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
976
|
+
* ```
|
|
977
|
+
* @vue-import ```jsx
|
|
978
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
979
|
+
* ```
|
|
980
|
+
* @js-example ```html
|
|
981
|
+
* <!-- index.html -->
|
|
982
|
+
* <searchcraft-search-results
|
|
983
|
+
* ad-interval="4"
|
|
984
|
+
* place-ad-at-start="true"
|
|
985
|
+
* />
|
|
986
|
+
* ```
|
|
987
|
+
* ```js
|
|
988
|
+
* // index.js
|
|
989
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
990
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
991
|
+
* <h2>${item.title}</h2>
|
|
992
|
+
* `;
|
|
993
|
+
* ```
|
|
994
|
+
* @react-example ```jsx
|
|
995
|
+
* <SearchcraftSearchResults
|
|
996
|
+
* adInterval={4}
|
|
997
|
+
* placeAdAtState={true}
|
|
998
|
+
* template={(item, index, { html }) => html`
|
|
999
|
+
* <h2>${item.title}</h2>
|
|
1000
|
+
* `}
|
|
1001
|
+
* />
|
|
1002
|
+
* ```
|
|
1003
|
+
* @vue-example ```jsx
|
|
1004
|
+
* <SearchcraftSearchResults
|
|
1005
|
+
* adInterval={4}
|
|
1006
|
+
* placeAdAtState={true}
|
|
1007
|
+
* :template={(item, index, { html }) => html`
|
|
1008
|
+
* <h2>${item.title}</h2>
|
|
1009
|
+
* `}
|
|
1010
|
+
* />
|
|
1011
|
+
* ```
|
|
1012
|
+
*/
|
|
1013
|
+
interface SearchcraftSearchResults {
|
|
1014
|
+
/**
|
|
1015
|
+
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
1016
|
+
*/
|
|
1017
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* This web component is designed to choose the number of search results displayed.
|
|
1021
|
+
* @react-import ```jsx
|
|
1022
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
1023
|
+
* ```
|
|
1024
|
+
* @vue-import ```jsx
|
|
1025
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
1026
|
+
* ```
|
|
1027
|
+
* @js-example ```html
|
|
1028
|
+
* <!-- index.html -->
|
|
1029
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
1030
|
+
* ```
|
|
1031
|
+
* @react-example ```jsx
|
|
1032
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
1033
|
+
* ```
|
|
1034
|
+
* @vue-example ```jsx
|
|
1035
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
1036
|
+
* ```
|
|
1037
|
+
*/
|
|
1038
|
+
interface SearchcraftSearchResultsPerPage {
|
|
1039
|
+
/**
|
|
1040
|
+
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
1041
|
+
*/
|
|
1042
|
+
"increment": string | number;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* This web component is designed to allow users to select between a group of options.
|
|
1046
|
+
* @js-example ```html
|
|
1047
|
+
* <!-- index.html -->
|
|
1048
|
+
* <searchcraft-select
|
|
1049
|
+
* inputId="searchcraft-select"
|
|
1050
|
+
* name="searchcraft-select"
|
|
1051
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
1052
|
+
* />
|
|
1053
|
+
* ```
|
|
1054
|
+
*/
|
|
1055
|
+
interface SearchcraftSelect {
|
|
1056
|
+
/**
|
|
1057
|
+
* The caption displayed below the select input.
|
|
1058
|
+
*/
|
|
1059
|
+
"caption"?: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* Whether the select input is disabled.
|
|
1062
|
+
*/
|
|
1063
|
+
"disabled"?: boolean;
|
|
1064
|
+
/**
|
|
1065
|
+
* The ID for the select input.
|
|
1066
|
+
*/
|
|
1067
|
+
"inputId": string;
|
|
1068
|
+
/**
|
|
1069
|
+
* The label of the select input.
|
|
1070
|
+
*/
|
|
1071
|
+
"label"?: string;
|
|
1072
|
+
/**
|
|
1073
|
+
* The ID for the label of the select input.
|
|
1074
|
+
*/
|
|
1075
|
+
"labelId"?: string;
|
|
1076
|
+
/**
|
|
1077
|
+
* The name of the select input.
|
|
1078
|
+
*/
|
|
1079
|
+
"name": string;
|
|
1080
|
+
/**
|
|
1081
|
+
* The options for the select input.
|
|
1082
|
+
*/
|
|
1083
|
+
"options": SearchcraftSelectOption[] | string;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
1087
|
+
*/
|
|
1088
|
+
interface SearchcraftSlider {
|
|
1089
|
+
/**
|
|
1090
|
+
* The type of data allowed.
|
|
1091
|
+
*/
|
|
1092
|
+
"dataType": "number" | "date";
|
|
1093
|
+
/**
|
|
1094
|
+
* The granularity that the value must adhere to.
|
|
1095
|
+
*/
|
|
1096
|
+
"granularity": number;
|
|
1097
|
+
/**
|
|
1098
|
+
* The maximum value allowed.
|
|
1099
|
+
*/
|
|
1100
|
+
"max": number;
|
|
1101
|
+
/**
|
|
1102
|
+
* The minimum value allowed.
|
|
1103
|
+
*/
|
|
1104
|
+
"min": number;
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
1108
|
+
* @react-import ```jsx
|
|
1109
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
1110
|
+
* ```
|
|
1111
|
+
* @vue-import ```jsx
|
|
1112
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
1113
|
+
* ```
|
|
1114
|
+
* @js-example ```html
|
|
1115
|
+
* <searchcraft-theme />
|
|
1116
|
+
* ```
|
|
1117
|
+
* @react-example ```jsx
|
|
1118
|
+
* <SearchcraftTheme />
|
|
1119
|
+
* ```
|
|
1120
|
+
* @vue-example ```jsx
|
|
1121
|
+
* <SearchcraftTheme />
|
|
1122
|
+
* ```
|
|
1123
|
+
*/
|
|
1124
|
+
interface SearchcraftTheme {
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
1128
|
+
*/
|
|
1129
|
+
interface SearchcraftToggleButton {
|
|
1130
|
+
/**
|
|
1131
|
+
* The label.
|
|
1132
|
+
*/
|
|
1133
|
+
"label": string;
|
|
1134
|
+
/**
|
|
1135
|
+
* The secondary label displayed below the main label.
|
|
1136
|
+
*/
|
|
1137
|
+
"subLabel": string | undefined;
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
export interface SearchcraftButtonCustomEvent<T> extends CustomEvent<T> {
|
|
1141
|
+
detail: T;
|
|
1142
|
+
target: HTMLSearchcraftButtonElement;
|
|
1143
|
+
}
|
|
1144
|
+
export interface SearchcraftFacetListCustomEvent<T> extends CustomEvent<T> {
|
|
1145
|
+
detail: T;
|
|
1146
|
+
target: HTMLSearchcraftFacetListElement;
|
|
1147
|
+
}
|
|
1148
|
+
export interface SearchcraftInputFormCustomEvent<T> extends CustomEvent<T> {
|
|
1149
|
+
detail: T;
|
|
1150
|
+
target: HTMLSearchcraftInputFormElement;
|
|
1151
|
+
}
|
|
1152
|
+
export interface SearchcraftSelectCustomEvent<T> extends CustomEvent<T> {
|
|
1153
|
+
detail: T;
|
|
1154
|
+
target: HTMLSearchcraftSelectElement;
|
|
1155
|
+
}
|
|
1156
|
+
export interface SearchcraftSliderCustomEvent<T> extends CustomEvent<T> {
|
|
1157
|
+
detail: T;
|
|
1158
|
+
target: HTMLSearchcraftSliderElement;
|
|
1159
|
+
}
|
|
1160
|
+
export interface SearchcraftToggleButtonCustomEvent<T> extends CustomEvent<T> {
|
|
1161
|
+
detail: T;
|
|
1162
|
+
target: HTMLSearchcraftToggleButtonElement;
|
|
1163
|
+
}
|
|
1164
|
+
declare global {
|
|
1165
|
+
/**
|
|
1166
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
1167
|
+
*/
|
|
1168
|
+
interface HTMLSearchcraftAdElement extends Components.SearchcraftAd, HTMLStencilElement {
|
|
1169
|
+
}
|
|
1170
|
+
var HTMLSearchcraftAdElement: {
|
|
1171
|
+
prototype: HTMLSearchcraftAdElement;
|
|
1172
|
+
new (): HTMLSearchcraftAdElement;
|
|
1173
|
+
};
|
|
1174
|
+
interface HTMLSearchcraftButtonElementEventMap {
|
|
1175
|
+
"buttonClick": void;
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* This web component represents a button.
|
|
1179
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
1180
|
+
*/
|
|
1181
|
+
interface HTMLSearchcraftButtonElement extends Components.SearchcraftButton, HTMLStencilElement {
|
|
1182
|
+
addEventListener<K extends keyof HTMLSearchcraftButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftButtonElement, ev: SearchcraftButtonCustomEvent<HTMLSearchcraftButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1183
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1184
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1185
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1186
|
+
removeEventListener<K extends keyof HTMLSearchcraftButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftButtonElement, ev: SearchcraftButtonCustomEvent<HTMLSearchcraftButtonElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1187
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1188
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1189
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1190
|
+
}
|
|
1191
|
+
var HTMLSearchcraftButtonElement: {
|
|
1192
|
+
prototype: HTMLSearchcraftButtonElement;
|
|
1193
|
+
new (): HTMLSearchcraftButtonElement;
|
|
1194
|
+
};
|
|
1195
|
+
/**
|
|
1196
|
+
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
1197
|
+
* @js-example ```html
|
|
1198
|
+
* <searchcraft-error-message>
|
|
1199
|
+
* No search results found for query
|
|
1200
|
+
* </searchcraft-error-message>
|
|
1201
|
+
* ```
|
|
1202
|
+
*/
|
|
1203
|
+
interface HTMLSearchcraftErrorMessageElement extends Components.SearchcraftErrorMessage, HTMLStencilElement {
|
|
1204
|
+
}
|
|
1205
|
+
var HTMLSearchcraftErrorMessageElement: {
|
|
1206
|
+
prototype: HTMLSearchcraftErrorMessageElement;
|
|
1207
|
+
new (): HTMLSearchcraftErrorMessageElement;
|
|
1208
|
+
};
|
|
1209
|
+
interface HTMLSearchcraftFacetListElementEventMap {
|
|
1210
|
+
"facetSelectionUpdated": {
|
|
1211
|
+
paths: string[];
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
1216
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
1217
|
+
* @js-example ```html
|
|
1218
|
+
* <!-- index.html -->
|
|
1219
|
+
* <searchcraft-facet-list field-name="title" />
|
|
1220
|
+
* ```
|
|
1221
|
+
* ```js
|
|
1222
|
+
* // index.js
|
|
1223
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
1224
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
1225
|
+
* console.log('Facet selection updated');
|
|
1226
|
+
* });
|
|
1227
|
+
* ```
|
|
1228
|
+
*/
|
|
1229
|
+
interface HTMLSearchcraftFacetListElement extends Components.SearchcraftFacetList, HTMLStencilElement {
|
|
1230
|
+
addEventListener<K extends keyof HTMLSearchcraftFacetListElementEventMap>(type: K, listener: (this: HTMLSearchcraftFacetListElement, ev: SearchcraftFacetListCustomEvent<HTMLSearchcraftFacetListElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1231
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1232
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1233
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1234
|
+
removeEventListener<K extends keyof HTMLSearchcraftFacetListElementEventMap>(type: K, listener: (this: HTMLSearchcraftFacetListElement, ev: SearchcraftFacetListCustomEvent<HTMLSearchcraftFacetListElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1235
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1236
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1237
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1238
|
+
}
|
|
1239
|
+
var HTMLSearchcraftFacetListElement: {
|
|
1240
|
+
prototype: HTMLSearchcraftFacetListElement;
|
|
1241
|
+
new (): HTMLSearchcraftFacetListElement;
|
|
1242
|
+
};
|
|
1243
|
+
/**
|
|
1244
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
1245
|
+
* @react-import ```jsx
|
|
1246
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
1247
|
+
* ```
|
|
1248
|
+
* @vue-import ```jsx
|
|
1249
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
1250
|
+
* ```
|
|
1251
|
+
* @js-example ```html
|
|
1252
|
+
* <!-- index.html -->
|
|
1253
|
+
* <searchcraft-filter-panel />
|
|
1254
|
+
* ```
|
|
1255
|
+
* ```js
|
|
1256
|
+
* // index.js
|
|
1257
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
1258
|
+
* if (filterPanel) {
|
|
1259
|
+
* filterPanel.items = [];
|
|
1260
|
+
* }
|
|
1261
|
+
* ```
|
|
1262
|
+
* @react-example ```jsx
|
|
1263
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
1264
|
+
* ```
|
|
1265
|
+
* @vue-example ```jsx
|
|
1266
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
1267
|
+
* ```
|
|
1268
|
+
*/
|
|
1269
|
+
interface HTMLSearchcraftFilterPanelElement extends Components.SearchcraftFilterPanel, HTMLStencilElement {
|
|
1270
|
+
}
|
|
1271
|
+
var HTMLSearchcraftFilterPanelElement: {
|
|
1272
|
+
prototype: HTMLSearchcraftFilterPanelElement;
|
|
1273
|
+
new (): HTMLSearchcraftFilterPanelElement;
|
|
1274
|
+
};
|
|
1275
|
+
interface HTMLSearchcraftInputFormElementEventMap {
|
|
1276
|
+
"inputFocus": void;
|
|
1277
|
+
"inputBlur": void;
|
|
1278
|
+
"inputInit": void;
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
1282
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
1283
|
+
* @react-import ```jsx
|
|
1284
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
1285
|
+
* ```
|
|
1286
|
+
* @vue-import ```jsx
|
|
1287
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
1288
|
+
* ```
|
|
1289
|
+
* @js-example ```html
|
|
1290
|
+
* <searchcraft-input-form auto-search />
|
|
1291
|
+
* ```
|
|
1292
|
+
* @react-example ```jsx
|
|
1293
|
+
* <SearchcraftInputForm autoSearch />
|
|
1294
|
+
* ```
|
|
1295
|
+
* @vue-example ```jsx
|
|
1296
|
+
* <SearchcraftInputForm autoSearch />
|
|
1297
|
+
* ```
|
|
1298
|
+
*/
|
|
1299
|
+
interface HTMLSearchcraftInputFormElement extends Components.SearchcraftInputForm, HTMLStencilElement {
|
|
1300
|
+
addEventListener<K extends keyof HTMLSearchcraftInputFormElementEventMap>(type: K, listener: (this: HTMLSearchcraftInputFormElement, ev: SearchcraftInputFormCustomEvent<HTMLSearchcraftInputFormElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1301
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1302
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1303
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1304
|
+
removeEventListener<K extends keyof HTMLSearchcraftInputFormElementEventMap>(type: K, listener: (this: HTMLSearchcraftInputFormElement, ev: SearchcraftInputFormCustomEvent<HTMLSearchcraftInputFormElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1305
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1306
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1307
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1308
|
+
}
|
|
1309
|
+
var HTMLSearchcraftInputFormElement: {
|
|
1310
|
+
prototype: HTMLSearchcraftInputFormElement;
|
|
1311
|
+
new (): HTMLSearchcraftInputFormElement;
|
|
1312
|
+
};
|
|
1313
|
+
/**
|
|
1314
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
1315
|
+
* @js-example ```html
|
|
1316
|
+
* <searchcraft-input-label label="Search" />
|
|
1317
|
+
* ```
|
|
1318
|
+
*/
|
|
1319
|
+
interface HTMLSearchcraftInputLabelElement extends Components.SearchcraftInputLabel, HTMLStencilElement {
|
|
1320
|
+
}
|
|
1321
|
+
var HTMLSearchcraftInputLabelElement: {
|
|
1322
|
+
prototype: HTMLSearchcraftInputLabelElement;
|
|
1323
|
+
new (): HTMLSearchcraftInputLabelElement;
|
|
1324
|
+
};
|
|
1325
|
+
/**
|
|
1326
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1327
|
+
* @react-import ```jsx
|
|
1328
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
1329
|
+
* ```
|
|
1330
|
+
* @vue-import ```jsx
|
|
1331
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
1332
|
+
* ```
|
|
1333
|
+
* @js-example ```html
|
|
1334
|
+
* <searchcraft-pagination />
|
|
1335
|
+
* ```
|
|
1336
|
+
* @react-example ```jsx
|
|
1337
|
+
* <SearchcraftPagination />
|
|
1338
|
+
* ```
|
|
1339
|
+
* @vue-example ```jsx
|
|
1340
|
+
* <SearchcraftPagination />
|
|
1341
|
+
* ```
|
|
1342
|
+
*/
|
|
1343
|
+
interface HTMLSearchcraftPaginationElement extends Components.SearchcraftPagination, HTMLStencilElement {
|
|
1344
|
+
}
|
|
1345
|
+
var HTMLSearchcraftPaginationElement: {
|
|
1346
|
+
prototype: HTMLSearchcraftPaginationElement;
|
|
1347
|
+
new (): HTMLSearchcraftPaginationElement;
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
1351
|
+
* @react-import ```jsx
|
|
1352
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
1353
|
+
* ````
|
|
1354
|
+
* @vue-import ```jsx
|
|
1355
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
1356
|
+
* ```
|
|
1357
|
+
* @js-example ```html
|
|
1358
|
+
* <!-- index.html -->
|
|
1359
|
+
* <searchcraft-popover-button>
|
|
1360
|
+
* Open popover
|
|
1361
|
+
* </searchcraft-popover-button>
|
|
1362
|
+
* ```
|
|
1363
|
+
* ```js
|
|
1364
|
+
* // index.js
|
|
1365
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
1366
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
1367
|
+
* <span>Click me</span>
|
|
1368
|
+
* `;
|
|
1369
|
+
* ```
|
|
1370
|
+
* @react-example ```jsx
|
|
1371
|
+
* <SearchcraftPopoverButton
|
|
1372
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
1373
|
+
* <span>Click me</span>
|
|
1374
|
+
* `}
|
|
1375
|
+
* >
|
|
1376
|
+
* Open popover
|
|
1377
|
+
* </SearchcraftPopoverButton>
|
|
1378
|
+
* ```
|
|
1379
|
+
* @vue-example ```jsx
|
|
1380
|
+
* <SearchcraftPopoverButton
|
|
1381
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
1382
|
+
* <span>Click me</span>
|
|
1383
|
+
* `}
|
|
1384
|
+
* >
|
|
1385
|
+
* Open popover
|
|
1386
|
+
* </SearchcraftPopoverButton>
|
|
1387
|
+
* ```
|
|
1388
|
+
*/
|
|
1389
|
+
interface HTMLSearchcraftPopoverButtonElement extends Components.SearchcraftPopoverButton, HTMLStencilElement {
|
|
1390
|
+
}
|
|
1391
|
+
var HTMLSearchcraftPopoverButtonElement: {
|
|
1392
|
+
prototype: HTMLSearchcraftPopoverButtonElement;
|
|
1393
|
+
new (): HTMLSearchcraftPopoverButtonElement;
|
|
1394
|
+
};
|
|
1395
|
+
/**
|
|
1396
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
1397
|
+
*/
|
|
1398
|
+
interface HTMLSearchcraftPopoverFooterElement extends Components.SearchcraftPopoverFooter, HTMLStencilElement {
|
|
1399
|
+
}
|
|
1400
|
+
var HTMLSearchcraftPopoverFooterElement: {
|
|
1401
|
+
prototype: HTMLSearchcraftPopoverFooterElement;
|
|
1402
|
+
new (): HTMLSearchcraftPopoverFooterElement;
|
|
1403
|
+
};
|
|
1404
|
+
/**
|
|
1405
|
+
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
1406
|
+
* @react-import ```jsx
|
|
1407
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
1408
|
+
* ```
|
|
1409
|
+
* @vue-import ```jsx
|
|
1410
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
1411
|
+
* ```
|
|
1412
|
+
* @js-example ```html
|
|
1413
|
+
* <!-- index.html -->
|
|
1414
|
+
* <searchcraft-popover-form type="inline" />
|
|
1415
|
+
* ```
|
|
1416
|
+
* ```js
|
|
1417
|
+
* // index.js
|
|
1418
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
1419
|
+
* popoverForm.popoverResultMappings = {};
|
|
1420
|
+
* ```
|
|
1421
|
+
* @react-example ```jsx
|
|
1422
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
1423
|
+
* ```
|
|
1424
|
+
* @vue-example ```jsx
|
|
1425
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
1426
|
+
* ```
|
|
1427
|
+
*/
|
|
1428
|
+
interface HTMLSearchcraftPopoverFormElement extends Components.SearchcraftPopoverForm, HTMLStencilElement {
|
|
1429
|
+
}
|
|
1430
|
+
var HTMLSearchcraftPopoverFormElement: {
|
|
1431
|
+
prototype: HTMLSearchcraftPopoverFormElement;
|
|
1432
|
+
new (): HTMLSearchcraftPopoverFormElement;
|
|
1433
|
+
};
|
|
1434
|
+
/**
|
|
1435
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
1436
|
+
*/
|
|
1437
|
+
interface HTMLSearchcraftPopoverListItemElement extends Components.SearchcraftPopoverListItem, HTMLStencilElement {
|
|
1438
|
+
}
|
|
1439
|
+
var HTMLSearchcraftPopoverListItemElement: {
|
|
1440
|
+
prototype: HTMLSearchcraftPopoverListItemElement;
|
|
1441
|
+
new (): HTMLSearchcraftPopoverListItemElement;
|
|
1442
|
+
};
|
|
1443
|
+
/**
|
|
1444
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
1445
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
1446
|
+
* @js-example ```html
|
|
1447
|
+
* <searchcraft-popover-list-view />
|
|
1448
|
+
* ```
|
|
1449
|
+
*/
|
|
1450
|
+
interface HTMLSearchcraftPopoverListViewElement extends Components.SearchcraftPopoverListView, HTMLStencilElement {
|
|
1451
|
+
}
|
|
1452
|
+
var HTMLSearchcraftPopoverListViewElement: {
|
|
1453
|
+
prototype: HTMLSearchcraftPopoverListViewElement;
|
|
1454
|
+
new (): HTMLSearchcraftPopoverListViewElement;
|
|
1455
|
+
};
|
|
1456
|
+
/**
|
|
1457
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
1458
|
+
* @react-import ```jsx
|
|
1459
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
1460
|
+
* ```
|
|
1461
|
+
* @vue-import ```jsx
|
|
1462
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
1463
|
+
* ```
|
|
1464
|
+
* @js-example ```html
|
|
1465
|
+
* <!-- index.html -->
|
|
1466
|
+
* <searchcraft-results-info />
|
|
1467
|
+
* ```
|
|
1468
|
+
* ```js
|
|
1469
|
+
* // index.js
|
|
1470
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
1471
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
1472
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1473
|
+
* `;
|
|
1474
|
+
* ```
|
|
1475
|
+
* @react-example ```jsx
|
|
1476
|
+
* <SearchcraftResultsInfo
|
|
1477
|
+
* template={(info, { html }) => html`
|
|
1478
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1479
|
+
* `}
|
|
1480
|
+
* />
|
|
1481
|
+
* ```
|
|
1482
|
+
* @vue-example ```jsx
|
|
1483
|
+
* <SearchcraftResultsInfo
|
|
1484
|
+
* :template={(info, { html }) => html`
|
|
1485
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
1486
|
+
* `}
|
|
1487
|
+
* />
|
|
1488
|
+
* ```
|
|
1489
|
+
*/
|
|
1490
|
+
interface HTMLSearchcraftResultsInfoElement extends Components.SearchcraftResultsInfo, HTMLStencilElement {
|
|
1491
|
+
}
|
|
1492
|
+
var HTMLSearchcraftResultsInfoElement: {
|
|
1493
|
+
prototype: HTMLSearchcraftResultsInfoElement;
|
|
1494
|
+
new (): HTMLSearchcraftResultsInfoElement;
|
|
1495
|
+
};
|
|
1496
|
+
/**
|
|
1497
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
1498
|
+
*/
|
|
1499
|
+
interface HTMLSearchcraftSearchResultElement extends Components.SearchcraftSearchResult, HTMLStencilElement {
|
|
1500
|
+
}
|
|
1501
|
+
var HTMLSearchcraftSearchResultElement: {
|
|
1502
|
+
prototype: HTMLSearchcraftSearchResultElement;
|
|
1503
|
+
new (): HTMLSearchcraftSearchResultElement;
|
|
1504
|
+
};
|
|
1505
|
+
/**
|
|
1506
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
1507
|
+
* @react-import ```jsx
|
|
1508
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
1509
|
+
* ```
|
|
1510
|
+
* @vue-import ```jsx
|
|
1511
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
1512
|
+
* ```
|
|
1513
|
+
* @js-example ```html
|
|
1514
|
+
* <!-- index.html -->
|
|
1515
|
+
* <searchcraft-search-results
|
|
1516
|
+
* ad-interval="4"
|
|
1517
|
+
* place-ad-at-start="true"
|
|
1518
|
+
* />
|
|
1519
|
+
* ```
|
|
1520
|
+
* ```js
|
|
1521
|
+
* // index.js
|
|
1522
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
1523
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
1524
|
+
* <h2>${item.title}</h2>
|
|
1525
|
+
* `;
|
|
1526
|
+
* ```
|
|
1527
|
+
* @react-example ```jsx
|
|
1528
|
+
* <SearchcraftSearchResults
|
|
1529
|
+
* adInterval={4}
|
|
1530
|
+
* placeAdAtState={true}
|
|
1531
|
+
* template={(item, index, { html }) => html`
|
|
1532
|
+
* <h2>${item.title}</h2>
|
|
1533
|
+
* `}
|
|
1534
|
+
* />
|
|
1535
|
+
* ```
|
|
1536
|
+
* @vue-example ```jsx
|
|
1537
|
+
* <SearchcraftSearchResults
|
|
1538
|
+
* adInterval={4}
|
|
1539
|
+
* placeAdAtState={true}
|
|
1540
|
+
* :template={(item, index, { html }) => html`
|
|
1541
|
+
* <h2>${item.title}</h2>
|
|
1542
|
+
* `}
|
|
1543
|
+
* />
|
|
1544
|
+
* ```
|
|
1545
|
+
*/
|
|
1546
|
+
interface HTMLSearchcraftSearchResultsElement extends Components.SearchcraftSearchResults, HTMLStencilElement {
|
|
1547
|
+
}
|
|
1548
|
+
var HTMLSearchcraftSearchResultsElement: {
|
|
1549
|
+
prototype: HTMLSearchcraftSearchResultsElement;
|
|
1550
|
+
new (): HTMLSearchcraftSearchResultsElement;
|
|
1551
|
+
};
|
|
1552
|
+
/**
|
|
1553
|
+
* This web component is designed to choose the number of search results displayed.
|
|
1554
|
+
* @react-import ```jsx
|
|
1555
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
1556
|
+
* ```
|
|
1557
|
+
* @vue-import ```jsx
|
|
1558
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
1559
|
+
* ```
|
|
1560
|
+
* @js-example ```html
|
|
1561
|
+
* <!-- index.html -->
|
|
1562
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
1563
|
+
* ```
|
|
1564
|
+
* @react-example ```jsx
|
|
1565
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
1566
|
+
* ```
|
|
1567
|
+
* @vue-example ```jsx
|
|
1568
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
1569
|
+
* ```
|
|
1570
|
+
*/
|
|
1571
|
+
interface HTMLSearchcraftSearchResultsPerPageElement extends Components.SearchcraftSearchResultsPerPage, HTMLStencilElement {
|
|
1572
|
+
}
|
|
1573
|
+
var HTMLSearchcraftSearchResultsPerPageElement: {
|
|
1574
|
+
prototype: HTMLSearchcraftSearchResultsPerPageElement;
|
|
1575
|
+
new (): HTMLSearchcraftSearchResultsPerPageElement;
|
|
1576
|
+
};
|
|
1577
|
+
interface HTMLSearchcraftSelectElementEventMap {
|
|
1578
|
+
"selectChange": string;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* This web component is designed to allow users to select between a group of options.
|
|
1582
|
+
* @js-example ```html
|
|
1583
|
+
* <!-- index.html -->
|
|
1584
|
+
* <searchcraft-select
|
|
1585
|
+
* inputId="searchcraft-select"
|
|
1586
|
+
* name="searchcraft-select"
|
|
1587
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
1588
|
+
* />
|
|
1589
|
+
* ```
|
|
1590
|
+
*/
|
|
1591
|
+
interface HTMLSearchcraftSelectElement extends Components.SearchcraftSelect, HTMLStencilElement {
|
|
1592
|
+
addEventListener<K extends keyof HTMLSearchcraftSelectElementEventMap>(type: K, listener: (this: HTMLSearchcraftSelectElement, ev: SearchcraftSelectCustomEvent<HTMLSearchcraftSelectElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1593
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1594
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1595
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1596
|
+
removeEventListener<K extends keyof HTMLSearchcraftSelectElementEventMap>(type: K, listener: (this: HTMLSearchcraftSelectElement, ev: SearchcraftSelectCustomEvent<HTMLSearchcraftSelectElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1597
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1598
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1599
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1600
|
+
}
|
|
1601
|
+
var HTMLSearchcraftSelectElement: {
|
|
1602
|
+
prototype: HTMLSearchcraftSelectElement;
|
|
1603
|
+
new (): HTMLSearchcraftSelectElement;
|
|
1604
|
+
};
|
|
1605
|
+
interface HTMLSearchcraftSliderElementEventMap {
|
|
1606
|
+
"rangeChanged": any;
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
1610
|
+
*/
|
|
1611
|
+
interface HTMLSearchcraftSliderElement extends Components.SearchcraftSlider, HTMLStencilElement {
|
|
1612
|
+
addEventListener<K extends keyof HTMLSearchcraftSliderElementEventMap>(type: K, listener: (this: HTMLSearchcraftSliderElement, ev: SearchcraftSliderCustomEvent<HTMLSearchcraftSliderElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1613
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1614
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1615
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1616
|
+
removeEventListener<K extends keyof HTMLSearchcraftSliderElementEventMap>(type: K, listener: (this: HTMLSearchcraftSliderElement, ev: SearchcraftSliderCustomEvent<HTMLSearchcraftSliderElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1617
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1618
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1619
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1620
|
+
}
|
|
1621
|
+
var HTMLSearchcraftSliderElement: {
|
|
1622
|
+
prototype: HTMLSearchcraftSliderElement;
|
|
1623
|
+
new (): HTMLSearchcraftSliderElement;
|
|
1624
|
+
};
|
|
1625
|
+
/**
|
|
1626
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
1627
|
+
* @react-import ```jsx
|
|
1628
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
1629
|
+
* ```
|
|
1630
|
+
* @vue-import ```jsx
|
|
1631
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
1632
|
+
* ```
|
|
1633
|
+
* @js-example ```html
|
|
1634
|
+
* <searchcraft-theme />
|
|
1635
|
+
* ```
|
|
1636
|
+
* @react-example ```jsx
|
|
1637
|
+
* <SearchcraftTheme />
|
|
1638
|
+
* ```
|
|
1639
|
+
* @vue-example ```jsx
|
|
1640
|
+
* <SearchcraftTheme />
|
|
1641
|
+
* ```
|
|
1642
|
+
*/
|
|
1643
|
+
interface HTMLSearchcraftThemeElement extends Components.SearchcraftTheme, HTMLStencilElement {
|
|
1644
|
+
}
|
|
1645
|
+
var HTMLSearchcraftThemeElement: {
|
|
1646
|
+
prototype: HTMLSearchcraftThemeElement;
|
|
1647
|
+
new (): HTMLSearchcraftThemeElement;
|
|
1648
|
+
};
|
|
1649
|
+
interface HTMLSearchcraftToggleButtonElementEventMap {
|
|
1650
|
+
"toggleUpdated": boolean;
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
1654
|
+
*/
|
|
1655
|
+
interface HTMLSearchcraftToggleButtonElement extends Components.SearchcraftToggleButton, HTMLStencilElement {
|
|
1656
|
+
addEventListener<K extends keyof HTMLSearchcraftToggleButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftToggleButtonElement, ev: SearchcraftToggleButtonCustomEvent<HTMLSearchcraftToggleButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1657
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1658
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1659
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1660
|
+
removeEventListener<K extends keyof HTMLSearchcraftToggleButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftToggleButtonElement, ev: SearchcraftToggleButtonCustomEvent<HTMLSearchcraftToggleButtonElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1661
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1662
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1663
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1664
|
+
}
|
|
1665
|
+
var HTMLSearchcraftToggleButtonElement: {
|
|
1666
|
+
prototype: HTMLSearchcraftToggleButtonElement;
|
|
1667
|
+
new (): HTMLSearchcraftToggleButtonElement;
|
|
1668
|
+
};
|
|
1669
|
+
interface HTMLElementTagNameMap {
|
|
1670
|
+
"searchcraft-ad": HTMLSearchcraftAdElement;
|
|
1671
|
+
"searchcraft-button": HTMLSearchcraftButtonElement;
|
|
1672
|
+
"searchcraft-error-message": HTMLSearchcraftErrorMessageElement;
|
|
1673
|
+
"searchcraft-facet-list": HTMLSearchcraftFacetListElement;
|
|
1674
|
+
"searchcraft-filter-panel": HTMLSearchcraftFilterPanelElement;
|
|
1675
|
+
"searchcraft-input-form": HTMLSearchcraftInputFormElement;
|
|
1676
|
+
"searchcraft-input-label": HTMLSearchcraftInputLabelElement;
|
|
1677
|
+
"searchcraft-pagination": HTMLSearchcraftPaginationElement;
|
|
1678
|
+
"searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
|
|
1679
|
+
"searchcraft-popover-footer": HTMLSearchcraftPopoverFooterElement;
|
|
1680
|
+
"searchcraft-popover-form": HTMLSearchcraftPopoverFormElement;
|
|
1681
|
+
"searchcraft-popover-list-item": HTMLSearchcraftPopoverListItemElement;
|
|
1682
|
+
"searchcraft-popover-list-view": HTMLSearchcraftPopoverListViewElement;
|
|
1683
|
+
"searchcraft-results-info": HTMLSearchcraftResultsInfoElement;
|
|
1684
|
+
"searchcraft-search-result": HTMLSearchcraftSearchResultElement;
|
|
1685
|
+
"searchcraft-search-results": HTMLSearchcraftSearchResultsElement;
|
|
1686
|
+
"searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
|
|
1687
|
+
"searchcraft-select": HTMLSearchcraftSelectElement;
|
|
1688
|
+
"searchcraft-slider": HTMLSearchcraftSliderElement;
|
|
1689
|
+
"searchcraft-theme": HTMLSearchcraftThemeElement;
|
|
1690
|
+
"searchcraft-toggle-button": HTMLSearchcraftToggleButtonElement;
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
declare namespace LocalJSX {
|
|
1694
|
+
/**
|
|
1695
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
1696
|
+
*/
|
|
1697
|
+
interface SearchcraftAd {
|
|
1698
|
+
"adClientResponseItem"?: AdClientResponseItem;
|
|
1699
|
+
"adContainerId"?: string;
|
|
1700
|
+
"adSource"?: SearchcraftAdSource;
|
|
1701
|
+
}
|
|
1702
|
+
/**
|
|
1703
|
+
* This web component represents a button.
|
|
1704
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
1705
|
+
*/
|
|
1706
|
+
interface SearchcraftButton {
|
|
1707
|
+
/**
|
|
1708
|
+
* Whether the button is disabled.
|
|
1709
|
+
*/
|
|
1710
|
+
"disabled"?: boolean;
|
|
1711
|
+
/**
|
|
1712
|
+
* Controls the visual representation of the button.
|
|
1713
|
+
*/
|
|
1714
|
+
"hierarchy"?: "primary" | "tertiary";
|
|
1715
|
+
/**
|
|
1716
|
+
* The icon element.
|
|
1717
|
+
*/
|
|
1718
|
+
"icon"?: Element;
|
|
1719
|
+
/**
|
|
1720
|
+
* Should the button only display an icon.
|
|
1721
|
+
*/
|
|
1722
|
+
"iconOnly"?: boolean;
|
|
1723
|
+
/**
|
|
1724
|
+
* The position of the icon.
|
|
1725
|
+
*/
|
|
1726
|
+
"iconPosition"?: "left" | "right";
|
|
1727
|
+
/**
|
|
1728
|
+
* The label for the button.
|
|
1729
|
+
*/
|
|
1730
|
+
"label"?: string;
|
|
1731
|
+
/**
|
|
1732
|
+
* The event fired when the button is clicked.
|
|
1733
|
+
*/
|
|
1734
|
+
"onButtonClick"?: (event: SearchcraftButtonCustomEvent<void>) => void;
|
|
1735
|
+
/**
|
|
1736
|
+
* The type of the button.
|
|
1737
|
+
*/
|
|
1738
|
+
"type"?: "submit" | "reset" | "button";
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
1742
|
+
* @js-example ```html
|
|
1743
|
+
* <searchcraft-error-message>
|
|
1744
|
+
* No search results found for query
|
|
1745
|
+
* </searchcraft-error-message>
|
|
1746
|
+
* ```
|
|
1747
|
+
*/
|
|
1748
|
+
interface SearchcraftErrorMessage {
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
1752
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
1753
|
+
* @js-example ```html
|
|
1754
|
+
* <!-- index.html -->
|
|
1755
|
+
* <searchcraft-facet-list field-name="title" />
|
|
1756
|
+
* ```
|
|
1757
|
+
* ```js
|
|
1758
|
+
* // index.js
|
|
1759
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
1760
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
1761
|
+
* console.log('Facet selection updated');
|
|
1762
|
+
* });
|
|
1763
|
+
* ```
|
|
1764
|
+
*/
|
|
1765
|
+
interface SearchcraftFacetList {
|
|
1766
|
+
/**
|
|
1767
|
+
* The name of the field where facets are applied.
|
|
1768
|
+
*/
|
|
1769
|
+
"fieldName"?: string;
|
|
1770
|
+
/**
|
|
1771
|
+
* When the facets are updated.
|
|
1772
|
+
*/
|
|
1773
|
+
"onFacetSelectionUpdated"?: (event: SearchcraftFacetListCustomEvent<{
|
|
1774
|
+
paths: string[];
|
|
1775
|
+
}>) => void;
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
1779
|
+
* @react-import ```jsx
|
|
1780
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
1781
|
+
* ```
|
|
1782
|
+
* @vue-import ```jsx
|
|
1783
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
1784
|
+
* ```
|
|
1785
|
+
* @js-example ```html
|
|
1786
|
+
* <!-- index.html -->
|
|
1787
|
+
* <searchcraft-filter-panel />
|
|
1788
|
+
* ```
|
|
1789
|
+
* ```js
|
|
1790
|
+
* // index.js
|
|
1791
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
1792
|
+
* if (filterPanel) {
|
|
1793
|
+
* filterPanel.items = [];
|
|
1794
|
+
* }
|
|
1795
|
+
* ```
|
|
1796
|
+
* @react-example ```jsx
|
|
1797
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
1798
|
+
* ```
|
|
1799
|
+
* @vue-example ```jsx
|
|
1800
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
1801
|
+
* ```
|
|
1802
|
+
*/
|
|
1803
|
+
interface SearchcraftFilterPanel {
|
|
1804
|
+
/**
|
|
1805
|
+
* The items to filter.
|
|
1806
|
+
*/
|
|
1807
|
+
"items"?: FilterItem[];
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
1811
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
1812
|
+
* @react-import ```jsx
|
|
1813
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
1814
|
+
* ```
|
|
1815
|
+
* @vue-import ```jsx
|
|
1816
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
1817
|
+
* ```
|
|
1818
|
+
* @js-example ```html
|
|
1819
|
+
* <searchcraft-input-form auto-search />
|
|
1820
|
+
* ```
|
|
1821
|
+
* @react-example ```jsx
|
|
1822
|
+
* <SearchcraftInputForm autoSearch />
|
|
1823
|
+
* ```
|
|
1824
|
+
* @vue-example ```jsx
|
|
1825
|
+
* <SearchcraftInputForm autoSearch />
|
|
1826
|
+
* ```
|
|
1827
|
+
*/
|
|
1828
|
+
interface SearchcraftInputForm {
|
|
1829
|
+
/**
|
|
1830
|
+
* Whether or not to automatically submit the search term when the input changes.
|
|
1831
|
+
*/
|
|
1832
|
+
"autoSearch"?: boolean;
|
|
1833
|
+
/**
|
|
1834
|
+
* The label for the submit button.
|
|
1835
|
+
*/
|
|
1836
|
+
"buttonLabel"?: string;
|
|
1837
|
+
/**
|
|
1838
|
+
* Where to place the search button.
|
|
1839
|
+
*/
|
|
1840
|
+
"buttonPlacement"?: "left" | "right" | "none";
|
|
1841
|
+
"core"?: SearchcraftCore;
|
|
1842
|
+
/**
|
|
1843
|
+
* The label rendered above the input.
|
|
1844
|
+
*/
|
|
1845
|
+
"inputLabel"?: string;
|
|
1846
|
+
/**
|
|
1847
|
+
* When the input becomes unfocused.
|
|
1848
|
+
*/
|
|
1849
|
+
"onInputBlur"?: (event: SearchcraftInputFormCustomEvent<void>) => void;
|
|
1850
|
+
/**
|
|
1851
|
+
* When the input becomes focused.
|
|
1852
|
+
*/
|
|
1853
|
+
"onInputFocus"?: (event: SearchcraftInputFormCustomEvent<void>) => void;
|
|
1854
|
+
/**
|
|
1855
|
+
* Event emitted when input initializes.
|
|
1856
|
+
*/
|
|
1857
|
+
"onInputInit"?: (event: SearchcraftInputFormCustomEvent<void>) => void;
|
|
1858
|
+
/**
|
|
1859
|
+
* The input element's placeholder value.
|
|
1860
|
+
*/
|
|
1861
|
+
"placeholderValue"?: string;
|
|
1862
|
+
}
|
|
1863
|
+
/**
|
|
1864
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
1865
|
+
* @js-example ```html
|
|
1866
|
+
* <searchcraft-input-label label="Search" />
|
|
1867
|
+
* ```
|
|
1868
|
+
*/
|
|
1869
|
+
interface SearchcraftInputLabel {
|
|
1870
|
+
/**
|
|
1871
|
+
* The classname applied to the label element.
|
|
1872
|
+
*/
|
|
1873
|
+
"inputLabelClassName"?: string | undefined;
|
|
1874
|
+
"label"?: string;
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1878
|
+
* @react-import ```jsx
|
|
1879
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
1880
|
+
* ```
|
|
1881
|
+
* @vue-import ```jsx
|
|
1882
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
1883
|
+
* ```
|
|
1884
|
+
* @js-example ```html
|
|
1885
|
+
* <searchcraft-pagination />
|
|
1886
|
+
* ```
|
|
1887
|
+
* @react-example ```jsx
|
|
1888
|
+
* <SearchcraftPagination />
|
|
1889
|
+
* ```
|
|
1890
|
+
* @vue-example ```jsx
|
|
1891
|
+
* <SearchcraftPagination />
|
|
1892
|
+
* ```
|
|
1893
|
+
*/
|
|
1894
|
+
interface SearchcraftPagination {
|
|
1895
|
+
}
|
|
1896
|
+
/**
|
|
1897
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
1898
|
+
* @react-import ```jsx
|
|
1899
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
1900
|
+
* ````
|
|
1901
|
+
* @vue-import ```jsx
|
|
1902
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
1903
|
+
* ```
|
|
1904
|
+
* @js-example ```html
|
|
1905
|
+
* <!-- index.html -->
|
|
1906
|
+
* <searchcraft-popover-button>
|
|
1907
|
+
* Open popover
|
|
1908
|
+
* </searchcraft-popover-button>
|
|
1909
|
+
* ```
|
|
1910
|
+
* ```js
|
|
1911
|
+
* // index.js
|
|
1912
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
1913
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
1914
|
+
* <span>Click me</span>
|
|
1915
|
+
* `;
|
|
1916
|
+
* ```
|
|
1917
|
+
* @react-example ```jsx
|
|
1918
|
+
* <SearchcraftPopoverButton
|
|
1919
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
1920
|
+
* <span>Click me</span>
|
|
1921
|
+
* `}
|
|
1922
|
+
* >
|
|
1923
|
+
* Open popover
|
|
1924
|
+
* </SearchcraftPopoverButton>
|
|
1925
|
+
* ```
|
|
1926
|
+
* @vue-example ```jsx
|
|
1927
|
+
* <SearchcraftPopoverButton
|
|
1928
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
1929
|
+
* <span>Click me</span>
|
|
1930
|
+
* `}
|
|
1931
|
+
* >
|
|
1932
|
+
* Open popover
|
|
1933
|
+
* </SearchcraftPopoverButton>
|
|
1934
|
+
* ```
|
|
1935
|
+
*/
|
|
1936
|
+
interface SearchcraftPopoverButton {
|
|
1937
|
+
/**
|
|
1938
|
+
* A callback function responsible for rendering the button contents.
|
|
1939
|
+
*/
|
|
1940
|
+
"template"?: PopoverButtonTemplate;
|
|
1941
|
+
/**
|
|
1942
|
+
* The type of popover button to render.
|
|
1943
|
+
*/
|
|
1944
|
+
"type"?: "skeuomorphic";
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
1948
|
+
*/
|
|
1949
|
+
interface SearchcraftPopoverFooter {
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
1953
|
+
* @react-import ```jsx
|
|
1954
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
1955
|
+
* ```
|
|
1956
|
+
* @vue-import ```jsx
|
|
1957
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
1958
|
+
* ```
|
|
1959
|
+
* @js-example ```html
|
|
1960
|
+
* <!-- index.html -->
|
|
1961
|
+
* <searchcraft-popover-form type="inline" />
|
|
1962
|
+
* ```
|
|
1963
|
+
* ```js
|
|
1964
|
+
* // index.js
|
|
1965
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
1966
|
+
* popoverForm.popoverResultMappings = {};
|
|
1967
|
+
* ```
|
|
1968
|
+
* @react-example ```jsx
|
|
1969
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
1970
|
+
* ```
|
|
1971
|
+
* @vue-example ```jsx
|
|
1972
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
1973
|
+
* ```
|
|
1974
|
+
*/
|
|
1975
|
+
interface SearchcraftPopoverForm {
|
|
1976
|
+
/**
|
|
1977
|
+
* The hotkey that activates the popover.
|
|
1978
|
+
*/
|
|
1979
|
+
"hotkey"?: string;
|
|
1980
|
+
/**
|
|
1981
|
+
* The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
|
|
1982
|
+
*/
|
|
1983
|
+
"hotkeyModifier"?: "ctrl" | "meta" | "alt" | "option";
|
|
1984
|
+
/**
|
|
1985
|
+
* Formats the content rendered for each result.
|
|
1986
|
+
*/
|
|
1987
|
+
"popoverResultMappings"?: PopoverResultMappings;
|
|
1988
|
+
/**
|
|
1989
|
+
* The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
|
|
1990
|
+
*/
|
|
1991
|
+
"type"?: "inline" | "fullscreen" | "modal";
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
1995
|
+
*/
|
|
1996
|
+
interface SearchcraftPopoverListItem {
|
|
1997
|
+
/**
|
|
1998
|
+
* The document position relative to the search results (For Measure)
|
|
1999
|
+
*/
|
|
2000
|
+
"documentPosition"?: number;
|
|
2001
|
+
"item"?: SearchClientResponseItem | undefined;
|
|
2002
|
+
"popoverResultMappings"?: PopoverResultMappings | undefined;
|
|
2003
|
+
}
|
|
2004
|
+
/**
|
|
2005
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
2006
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
2007
|
+
* @js-example ```html
|
|
2008
|
+
* <searchcraft-popover-list-view />
|
|
2009
|
+
* ```
|
|
2010
|
+
*/
|
|
2011
|
+
interface SearchcraftPopoverListView {
|
|
2012
|
+
"adClientResponseItems"?: AdClientResponseItem[] | undefined;
|
|
2013
|
+
/**
|
|
2014
|
+
* The mappings that define how the data in the documents are mapped to the list-view-item elements.
|
|
2015
|
+
*/
|
|
2016
|
+
"popoverResultMappings"?: PopoverResultMappings | undefined;
|
|
2017
|
+
/**
|
|
2018
|
+
* The items to render in the list view.
|
|
2019
|
+
*/
|
|
2020
|
+
"searchClientResponseItems"?: SearchClientResponseItem[] | undefined;
|
|
2021
|
+
"searchResultsPage": number;
|
|
2022
|
+
"searchResultsPerPage": number;
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
2026
|
+
* @react-import ```jsx
|
|
2027
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
2028
|
+
* ```
|
|
2029
|
+
* @vue-import ```jsx
|
|
2030
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
2031
|
+
* ```
|
|
2032
|
+
* @js-example ```html
|
|
2033
|
+
* <!-- index.html -->
|
|
2034
|
+
* <searchcraft-results-info />
|
|
2035
|
+
* ```
|
|
2036
|
+
* ```js
|
|
2037
|
+
* // index.js
|
|
2038
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
2039
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
2040
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2041
|
+
* `;
|
|
2042
|
+
* ```
|
|
2043
|
+
* @react-example ```jsx
|
|
2044
|
+
* <SearchcraftResultsInfo
|
|
2045
|
+
* template={(info, { html }) => html`
|
|
2046
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2047
|
+
* `}
|
|
2048
|
+
* />
|
|
2049
|
+
* ```
|
|
2050
|
+
* @vue-example ```jsx
|
|
2051
|
+
* <SearchcraftResultsInfo
|
|
2052
|
+
* :template={(info, { html }) => html`
|
|
2053
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2054
|
+
* `}
|
|
2055
|
+
* />
|
|
2056
|
+
* ```
|
|
2057
|
+
*/
|
|
2058
|
+
interface SearchcraftResultsInfo {
|
|
2059
|
+
/**
|
|
2060
|
+
* A callback function responsible for rendering the results info.
|
|
2061
|
+
*/
|
|
2062
|
+
"template"?: ResultsInfoTemplate;
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
2066
|
+
*/
|
|
2067
|
+
interface SearchcraftSearchResult {
|
|
2068
|
+
/**
|
|
2069
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
2070
|
+
*/
|
|
2071
|
+
"documentPosition"?: number;
|
|
2072
|
+
/**
|
|
2073
|
+
* The index.
|
|
2074
|
+
*/
|
|
2075
|
+
"index": number;
|
|
2076
|
+
"item"?: SearchClientResponseItem;
|
|
2077
|
+
/**
|
|
2078
|
+
* A callback function responsible for rendering a result.
|
|
2079
|
+
*/
|
|
2080
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
2084
|
+
* @react-import ```jsx
|
|
2085
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
2086
|
+
* ```
|
|
2087
|
+
* @vue-import ```jsx
|
|
2088
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
2089
|
+
* ```
|
|
2090
|
+
* @js-example ```html
|
|
2091
|
+
* <!-- index.html -->
|
|
2092
|
+
* <searchcraft-search-results
|
|
2093
|
+
* ad-interval="4"
|
|
2094
|
+
* place-ad-at-start="true"
|
|
2095
|
+
* />
|
|
2096
|
+
* ```
|
|
2097
|
+
* ```js
|
|
2098
|
+
* // index.js
|
|
2099
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
2100
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
2101
|
+
* <h2>${item.title}</h2>
|
|
2102
|
+
* `;
|
|
2103
|
+
* ```
|
|
2104
|
+
* @react-example ```jsx
|
|
2105
|
+
* <SearchcraftSearchResults
|
|
2106
|
+
* adInterval={4}
|
|
2107
|
+
* placeAdAtState={true}
|
|
2108
|
+
* template={(item, index, { html }) => html`
|
|
2109
|
+
* <h2>${item.title}</h2>
|
|
2110
|
+
* `}
|
|
2111
|
+
* />
|
|
2112
|
+
* ```
|
|
2113
|
+
* @vue-example ```jsx
|
|
2114
|
+
* <SearchcraftSearchResults
|
|
2115
|
+
* adInterval={4}
|
|
2116
|
+
* placeAdAtState={true}
|
|
2117
|
+
* :template={(item, index, { html }) => html`
|
|
2118
|
+
* <h2>${item.title}</h2>
|
|
2119
|
+
* `}
|
|
2120
|
+
* />
|
|
2121
|
+
* ```
|
|
2122
|
+
*/
|
|
2123
|
+
interface SearchcraftSearchResults {
|
|
2124
|
+
/**
|
|
2125
|
+
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
2126
|
+
*/
|
|
2127
|
+
"template"?: SearchResultTemplate<SearchResultTemplateData>;
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* This web component is designed to choose the number of search results displayed.
|
|
2131
|
+
* @react-import ```jsx
|
|
2132
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
2133
|
+
* ```
|
|
2134
|
+
* @vue-import ```jsx
|
|
2135
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
2136
|
+
* ```
|
|
2137
|
+
* @js-example ```html
|
|
2138
|
+
* <!-- index.html -->
|
|
2139
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
2140
|
+
* ```
|
|
2141
|
+
* @react-example ```jsx
|
|
2142
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
2143
|
+
* ```
|
|
2144
|
+
* @vue-example ```jsx
|
|
2145
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
2146
|
+
* ```
|
|
2147
|
+
*/
|
|
2148
|
+
interface SearchcraftSearchResultsPerPage {
|
|
2149
|
+
/**
|
|
2150
|
+
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
2151
|
+
*/
|
|
2152
|
+
"increment"?: string | number;
|
|
2153
|
+
}
|
|
2154
|
+
/**
|
|
2155
|
+
* This web component is designed to allow users to select between a group of options.
|
|
2156
|
+
* @js-example ```html
|
|
2157
|
+
* <!-- index.html -->
|
|
2158
|
+
* <searchcraft-select
|
|
2159
|
+
* inputId="searchcraft-select"
|
|
2160
|
+
* name="searchcraft-select"
|
|
2161
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
2162
|
+
* />
|
|
2163
|
+
* ```
|
|
2164
|
+
*/
|
|
2165
|
+
interface SearchcraftSelect {
|
|
2166
|
+
/**
|
|
2167
|
+
* The caption displayed below the select input.
|
|
2168
|
+
*/
|
|
2169
|
+
"caption"?: string;
|
|
2170
|
+
/**
|
|
2171
|
+
* Whether the select input is disabled.
|
|
2172
|
+
*/
|
|
2173
|
+
"disabled"?: boolean;
|
|
2174
|
+
/**
|
|
2175
|
+
* The ID for the select input.
|
|
2176
|
+
*/
|
|
2177
|
+
"inputId": string;
|
|
2178
|
+
/**
|
|
2179
|
+
* The label of the select input.
|
|
2180
|
+
*/
|
|
2181
|
+
"label"?: string;
|
|
2182
|
+
/**
|
|
2183
|
+
* The ID for the label of the select input.
|
|
2184
|
+
*/
|
|
2185
|
+
"labelId"?: string;
|
|
2186
|
+
/**
|
|
2187
|
+
* The name of the select input.
|
|
2188
|
+
*/
|
|
2189
|
+
"name": string;
|
|
2190
|
+
/**
|
|
2191
|
+
* The event fired when the select is changed.
|
|
2192
|
+
*/
|
|
2193
|
+
"onSelectChange"?: (event: SearchcraftSelectCustomEvent<string>) => void;
|
|
2194
|
+
/**
|
|
2195
|
+
* The options for the select input.
|
|
2196
|
+
*/
|
|
2197
|
+
"options"?: SearchcraftSelectOption[] | string;
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
2201
|
+
*/
|
|
2202
|
+
interface SearchcraftSlider {
|
|
2203
|
+
/**
|
|
2204
|
+
* The type of data allowed.
|
|
2205
|
+
*/
|
|
2206
|
+
"dataType"?: "number" | "date";
|
|
2207
|
+
/**
|
|
2208
|
+
* The granularity that the value must adhere to.
|
|
2209
|
+
*/
|
|
2210
|
+
"granularity"?: number;
|
|
2211
|
+
/**
|
|
2212
|
+
* The maximum value allowed.
|
|
2213
|
+
*/
|
|
2214
|
+
"max"?: number;
|
|
2215
|
+
/**
|
|
2216
|
+
* The minimum value allowed.
|
|
2217
|
+
*/
|
|
2218
|
+
"min"?: number;
|
|
2219
|
+
/**
|
|
2220
|
+
* When the range has changed.
|
|
2221
|
+
*/
|
|
2222
|
+
"onRangeChanged"?: (event: SearchcraftSliderCustomEvent<any>) => void;
|
|
2223
|
+
}
|
|
2224
|
+
/**
|
|
2225
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
2226
|
+
* @react-import ```jsx
|
|
2227
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
2228
|
+
* ```
|
|
2229
|
+
* @vue-import ```jsx
|
|
2230
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
2231
|
+
* ```
|
|
2232
|
+
* @js-example ```html
|
|
2233
|
+
* <searchcraft-theme />
|
|
2234
|
+
* ```
|
|
2235
|
+
* @react-example ```jsx
|
|
2236
|
+
* <SearchcraftTheme />
|
|
2237
|
+
* ```
|
|
2238
|
+
* @vue-example ```jsx
|
|
2239
|
+
* <SearchcraftTheme />
|
|
2240
|
+
* ```
|
|
2241
|
+
*/
|
|
2242
|
+
interface SearchcraftTheme {
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
2246
|
+
*/
|
|
2247
|
+
interface SearchcraftToggleButton {
|
|
2248
|
+
/**
|
|
2249
|
+
* The label.
|
|
2250
|
+
*/
|
|
2251
|
+
"label"?: string;
|
|
2252
|
+
/**
|
|
2253
|
+
* When the toggle element is changed.
|
|
2254
|
+
*/
|
|
2255
|
+
"onToggleUpdated"?: (event: SearchcraftToggleButtonCustomEvent<boolean>) => void;
|
|
2256
|
+
/**
|
|
2257
|
+
* The secondary label displayed below the main label.
|
|
2258
|
+
*/
|
|
2259
|
+
"subLabel"?: string | undefined;
|
|
2260
|
+
}
|
|
2261
|
+
interface IntrinsicElements {
|
|
2262
|
+
"searchcraft-ad": SearchcraftAd;
|
|
2263
|
+
"searchcraft-button": SearchcraftButton;
|
|
2264
|
+
"searchcraft-error-message": SearchcraftErrorMessage;
|
|
2265
|
+
"searchcraft-facet-list": SearchcraftFacetList;
|
|
2266
|
+
"searchcraft-filter-panel": SearchcraftFilterPanel;
|
|
2267
|
+
"searchcraft-input-form": SearchcraftInputForm;
|
|
2268
|
+
"searchcraft-input-label": SearchcraftInputLabel;
|
|
2269
|
+
"searchcraft-pagination": SearchcraftPagination;
|
|
2270
|
+
"searchcraft-popover-button": SearchcraftPopoverButton;
|
|
2271
|
+
"searchcraft-popover-footer": SearchcraftPopoverFooter;
|
|
2272
|
+
"searchcraft-popover-form": SearchcraftPopoverForm;
|
|
2273
|
+
"searchcraft-popover-list-item": SearchcraftPopoverListItem;
|
|
2274
|
+
"searchcraft-popover-list-view": SearchcraftPopoverListView;
|
|
2275
|
+
"searchcraft-results-info": SearchcraftResultsInfo;
|
|
2276
|
+
"searchcraft-search-result": SearchcraftSearchResult;
|
|
2277
|
+
"searchcraft-search-results": SearchcraftSearchResults;
|
|
2278
|
+
"searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
|
|
2279
|
+
"searchcraft-select": SearchcraftSelect;
|
|
2280
|
+
"searchcraft-slider": SearchcraftSlider;
|
|
2281
|
+
"searchcraft-theme": SearchcraftTheme;
|
|
2282
|
+
"searchcraft-toggle-button": SearchcraftToggleButton;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
declare module "@stencil/core" {
|
|
2286
|
+
export namespace JSX {
|
|
2287
|
+
interface IntrinsicElements {
|
|
2288
|
+
/**
|
|
2289
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
2290
|
+
*/
|
|
2291
|
+
"searchcraft-ad": LocalJSX.SearchcraftAd & JSXBase.HTMLAttributes<HTMLSearchcraftAdElement>;
|
|
2292
|
+
/**
|
|
2293
|
+
* This web component represents a button.
|
|
2294
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
2295
|
+
*/
|
|
2296
|
+
"searchcraft-button": LocalJSX.SearchcraftButton & JSXBase.HTMLAttributes<HTMLSearchcraftButtonElement>;
|
|
2297
|
+
/**
|
|
2298
|
+
* This web component is designed to display a user-friendly error message when a search query fails, providing clear feedback to users and enhancing their experience when an issue arises during the search process.
|
|
2299
|
+
* @js-example ```html
|
|
2300
|
+
* <searchcraft-error-message>
|
|
2301
|
+
* No search results found for query
|
|
2302
|
+
* </searchcraft-error-message>
|
|
2303
|
+
* ```
|
|
2304
|
+
*/
|
|
2305
|
+
"searchcraft-error-message": LocalJSX.SearchcraftErrorMessage & JSXBase.HTMLAttributes<HTMLSearchcraftErrorMessageElement>;
|
|
2306
|
+
/**
|
|
2307
|
+
* This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.
|
|
2308
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
2309
|
+
* @js-example ```html
|
|
2310
|
+
* <!-- index.html -->
|
|
2311
|
+
* <searchcraft-facet-list field-name="title" />
|
|
2312
|
+
* ```
|
|
2313
|
+
* ```js
|
|
2314
|
+
* // index.js
|
|
2315
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
2316
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
2317
|
+
* console.log('Facet selection updated');
|
|
2318
|
+
* });
|
|
2319
|
+
* ```
|
|
2320
|
+
*/
|
|
2321
|
+
"searchcraft-facet-list": LocalJSX.SearchcraftFacetList & JSXBase.HTMLAttributes<HTMLSearchcraftFacetListElement>;
|
|
2322
|
+
/**
|
|
2323
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
2324
|
+
* @react-import ```jsx
|
|
2325
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/react-sdk";
|
|
2326
|
+
* ```
|
|
2327
|
+
* @vue-import ```jsx
|
|
2328
|
+
* import { SearchcraftFilterPanel } from "@searchcraft/vue-sdk";
|
|
2329
|
+
* ```
|
|
2330
|
+
* @js-example ```html
|
|
2331
|
+
* <!-- index.html -->
|
|
2332
|
+
* <searchcraft-filter-panel />
|
|
2333
|
+
* ```
|
|
2334
|
+
* ```js
|
|
2335
|
+
* // index.js
|
|
2336
|
+
* const filterPanel = document.querySelector('searchcraft-filter-panel');
|
|
2337
|
+
* if (filterPanel) {
|
|
2338
|
+
* filterPanel.items = [];
|
|
2339
|
+
* }
|
|
2340
|
+
* ```
|
|
2341
|
+
* @react-example ```jsx
|
|
2342
|
+
* <SearchcraftFilterPanel items={[]} />
|
|
2343
|
+
* ```
|
|
2344
|
+
* @vue-example ```jsx
|
|
2345
|
+
* <SearchcraftFilterPanel :items="[]" />
|
|
2346
|
+
* ```
|
|
2347
|
+
*/
|
|
2348
|
+
"searchcraft-filter-panel": LocalJSX.SearchcraftFilterPanel & JSXBase.HTMLAttributes<HTMLSearchcraftFilterPanelElement>;
|
|
2349
|
+
/**
|
|
2350
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
2351
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
2352
|
+
* @react-import ```jsx
|
|
2353
|
+
* import { SearchcraftInputForm } from "@searchcraft/react-sdk";
|
|
2354
|
+
* ```
|
|
2355
|
+
* @vue-import ```jsx
|
|
2356
|
+
* import { SearchcraftInputForm } from "@searchcraft/vue-sdk";
|
|
2357
|
+
* ```
|
|
2358
|
+
* @js-example ```html
|
|
2359
|
+
* <searchcraft-input-form auto-search />
|
|
2360
|
+
* ```
|
|
2361
|
+
* @react-example ```jsx
|
|
2362
|
+
* <SearchcraftInputForm autoSearch />
|
|
2363
|
+
* ```
|
|
2364
|
+
* @vue-example ```jsx
|
|
2365
|
+
* <SearchcraftInputForm autoSearch />
|
|
2366
|
+
* ```
|
|
2367
|
+
*/
|
|
2368
|
+
"searchcraft-input-form": LocalJSX.SearchcraftInputForm & JSXBase.HTMLAttributes<HTMLSearchcraftInputFormElement>;
|
|
2369
|
+
/**
|
|
2370
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
2371
|
+
* @js-example ```html
|
|
2372
|
+
* <searchcraft-input-label label="Search" />
|
|
2373
|
+
* ```
|
|
2374
|
+
*/
|
|
2375
|
+
"searchcraft-input-label": LocalJSX.SearchcraftInputLabel & JSXBase.HTMLAttributes<HTMLSearchcraftInputLabelElement>;
|
|
2376
|
+
/**
|
|
2377
|
+
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
2378
|
+
* @react-import ```jsx
|
|
2379
|
+
* import { SearchcraftPagination } from "@searchcraft/react-sdk";
|
|
2380
|
+
* ```
|
|
2381
|
+
* @vue-import ```jsx
|
|
2382
|
+
* import { SearchcraftPagination } from "@searchcraft/vue-sdk";
|
|
2383
|
+
* ```
|
|
2384
|
+
* @js-example ```html
|
|
2385
|
+
* <searchcraft-pagination />
|
|
2386
|
+
* ```
|
|
2387
|
+
* @react-example ```jsx
|
|
2388
|
+
* <SearchcraftPagination />
|
|
2389
|
+
* ```
|
|
2390
|
+
* @vue-example ```jsx
|
|
2391
|
+
* <SearchcraftPagination />
|
|
2392
|
+
* ```
|
|
2393
|
+
*/
|
|
2394
|
+
"searchcraft-pagination": LocalJSX.SearchcraftPagination & JSXBase.HTMLAttributes<HTMLSearchcraftPaginationElement>;
|
|
2395
|
+
/**
|
|
2396
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
2397
|
+
* @react-import ```jsx
|
|
2398
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
|
|
2399
|
+
* ````
|
|
2400
|
+
* @vue-import ```jsx
|
|
2401
|
+
* import { SearchcraftPopoverButton } from "@searchcraft/vue-sdk";
|
|
2402
|
+
* ```
|
|
2403
|
+
* @js-example ```html
|
|
2404
|
+
* <!-- index.html -->
|
|
2405
|
+
* <searchcraft-popover-button>
|
|
2406
|
+
* Open popover
|
|
2407
|
+
* </searchcraft-popover-button>
|
|
2408
|
+
* ```
|
|
2409
|
+
* ```js
|
|
2410
|
+
* // index.js
|
|
2411
|
+
* const popoverButton = document.querySelector('searchcraft-popover-button');
|
|
2412
|
+
* popoverButton.template = (isPopoverVisible, { html }) => html`
|
|
2413
|
+
* <span>Click me</span>
|
|
2414
|
+
* `;
|
|
2415
|
+
* ```
|
|
2416
|
+
* @react-example ```jsx
|
|
2417
|
+
* <SearchcraftPopoverButton
|
|
2418
|
+
* template={(isPopoverVisible, { html }) => html`
|
|
2419
|
+
* <span>Click me</span>
|
|
2420
|
+
* `}
|
|
2421
|
+
* >
|
|
2422
|
+
* Open popover
|
|
2423
|
+
* </SearchcraftPopoverButton>
|
|
2424
|
+
* ```
|
|
2425
|
+
* @vue-example ```jsx
|
|
2426
|
+
* <SearchcraftPopoverButton
|
|
2427
|
+
* :template={(isPopoverVisible, { html }) => html`
|
|
2428
|
+
* <span>Click me</span>
|
|
2429
|
+
* `}
|
|
2430
|
+
* >
|
|
2431
|
+
* Open popover
|
|
2432
|
+
* </SearchcraftPopoverButton>
|
|
2433
|
+
* ```
|
|
2434
|
+
*/
|
|
2435
|
+
"searchcraft-popover-button": LocalJSX.SearchcraftPopoverButton & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverButtonElement>;
|
|
2436
|
+
/**
|
|
2437
|
+
* Renders the footer for the searchcraft-popover-form.
|
|
2438
|
+
*/
|
|
2439
|
+
"searchcraft-popover-footer": LocalJSX.SearchcraftPopoverFooter & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverFooterElement>;
|
|
2440
|
+
/**
|
|
2441
|
+
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
2442
|
+
* @react-import ```jsx
|
|
2443
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
|
|
2444
|
+
* ```
|
|
2445
|
+
* @vue-import ```jsx
|
|
2446
|
+
* import { SearchcraftPopoverForm } from "@searchcraft/vue-sdk";
|
|
2447
|
+
* ```
|
|
2448
|
+
* @js-example ```html
|
|
2449
|
+
* <!-- index.html -->
|
|
2450
|
+
* <searchcraft-popover-form type="inline" />
|
|
2451
|
+
* ```
|
|
2452
|
+
* ```js
|
|
2453
|
+
* // index.js
|
|
2454
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
2455
|
+
* popoverForm.popoverResultMappings = {};
|
|
2456
|
+
* ```
|
|
2457
|
+
* @react-example ```jsx
|
|
2458
|
+
* <SearchcraftPopoverForm type="inline" popoverResultMappings={[]} />
|
|
2459
|
+
* ```
|
|
2460
|
+
* @vue-example ```jsx
|
|
2461
|
+
* <SearchcraftPopoverForm type="inline" :popoverResultMappings="[]"" />
|
|
2462
|
+
* ```
|
|
2463
|
+
*/
|
|
2464
|
+
"searchcraft-popover-form": LocalJSX.SearchcraftPopoverForm & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverFormElement>;
|
|
2465
|
+
/**
|
|
2466
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
2467
|
+
*/
|
|
2468
|
+
"searchcraft-popover-list-item": LocalJSX.SearchcraftPopoverListItem & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverListItemElement>;
|
|
2469
|
+
/**
|
|
2470
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
2471
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
2472
|
+
* @js-example ```html
|
|
2473
|
+
* <searchcraft-popover-list-view />
|
|
2474
|
+
* ```
|
|
2475
|
+
*/
|
|
2476
|
+
"searchcraft-popover-list-view": LocalJSX.SearchcraftPopoverListView & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverListViewElement>;
|
|
2477
|
+
/**
|
|
2478
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
2479
|
+
* @react-import ```jsx
|
|
2480
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
|
|
2481
|
+
* ```
|
|
2482
|
+
* @vue-import ```jsx
|
|
2483
|
+
* import { SearchcraftResultsInfo } from "@searchcraft/vue-sdk";
|
|
2484
|
+
* ```
|
|
2485
|
+
* @js-example ```html
|
|
2486
|
+
* <!-- index.html -->
|
|
2487
|
+
* <searchcraft-results-info />
|
|
2488
|
+
* ```
|
|
2489
|
+
* ```js
|
|
2490
|
+
* // index.js
|
|
2491
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
2492
|
+
* resultsInfo.template = (info, { html }) => html`
|
|
2493
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2494
|
+
* `;
|
|
2495
|
+
* ```
|
|
2496
|
+
* @react-example ```jsx
|
|
2497
|
+
* <SearchcraftResultsInfo
|
|
2498
|
+
* template={(info, { html }) => html`
|
|
2499
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2500
|
+
* `}
|
|
2501
|
+
* />
|
|
2502
|
+
* ```
|
|
2503
|
+
* @vue-example ```jsx
|
|
2504
|
+
* <SearchcraftResultsInfo
|
|
2505
|
+
* :template={(info, { html }) => html`
|
|
2506
|
+
* ${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
|
|
2507
|
+
* `}
|
|
2508
|
+
* />
|
|
2509
|
+
* ```
|
|
2510
|
+
*/
|
|
2511
|
+
"searchcraft-results-info": LocalJSX.SearchcraftResultsInfo & JSXBase.HTMLAttributes<HTMLSearchcraftResultsInfoElement>;
|
|
2512
|
+
/**
|
|
2513
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
2514
|
+
*/
|
|
2515
|
+
"searchcraft-search-result": LocalJSX.SearchcraftSearchResult & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultElement>;
|
|
2516
|
+
/**
|
|
2517
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
2518
|
+
* @react-import ```jsx
|
|
2519
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
2520
|
+
* ```
|
|
2521
|
+
* @vue-import ```jsx
|
|
2522
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
2523
|
+
* ```
|
|
2524
|
+
* @js-example ```html
|
|
2525
|
+
* <!-- index.html -->
|
|
2526
|
+
* <searchcraft-search-results
|
|
2527
|
+
* ad-interval="4"
|
|
2528
|
+
* place-ad-at-start="true"
|
|
2529
|
+
* />
|
|
2530
|
+
* ```
|
|
2531
|
+
* ```js
|
|
2532
|
+
* // index.js
|
|
2533
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
2534
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
2535
|
+
* <h2>${item.title}</h2>
|
|
2536
|
+
* `;
|
|
2537
|
+
* ```
|
|
2538
|
+
* @react-example ```jsx
|
|
2539
|
+
* <SearchcraftSearchResults
|
|
2540
|
+
* adInterval={4}
|
|
2541
|
+
* placeAdAtState={true}
|
|
2542
|
+
* template={(item, index, { html }) => html`
|
|
2543
|
+
* <h2>${item.title}</h2>
|
|
2544
|
+
* `}
|
|
2545
|
+
* />
|
|
2546
|
+
* ```
|
|
2547
|
+
* @vue-example ```jsx
|
|
2548
|
+
* <SearchcraftSearchResults
|
|
2549
|
+
* adInterval={4}
|
|
2550
|
+
* placeAdAtState={true}
|
|
2551
|
+
* :template={(item, index, { html }) => html`
|
|
2552
|
+
* <h2>${item.title}</h2>
|
|
2553
|
+
* `}
|
|
2554
|
+
* />
|
|
2555
|
+
* ```
|
|
2556
|
+
*/
|
|
2557
|
+
"searchcraft-search-results": LocalJSX.SearchcraftSearchResults & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultsElement>;
|
|
2558
|
+
/**
|
|
2559
|
+
* This web component is designed to choose the number of search results displayed.
|
|
2560
|
+
* @react-import ```jsx
|
|
2561
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
2562
|
+
* ```
|
|
2563
|
+
* @vue-import ```jsx
|
|
2564
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
2565
|
+
* ```
|
|
2566
|
+
* @js-example ```html
|
|
2567
|
+
* <!-- index.html -->
|
|
2568
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
2569
|
+
* ```
|
|
2570
|
+
* @react-example ```jsx
|
|
2571
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
2572
|
+
* ```
|
|
2573
|
+
* @vue-example ```jsx
|
|
2574
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
2575
|
+
* ```
|
|
2576
|
+
*/
|
|
2577
|
+
"searchcraft-search-results-per-page": LocalJSX.SearchcraftSearchResultsPerPage & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultsPerPageElement>;
|
|
2578
|
+
/**
|
|
2579
|
+
* This web component is designed to allow users to select between a group of options.
|
|
2580
|
+
* @js-example ```html
|
|
2581
|
+
* <!-- index.html -->
|
|
2582
|
+
* <searchcraft-select
|
|
2583
|
+
* inputId="searchcraft-select"
|
|
2584
|
+
* name="searchcraft-select"
|
|
2585
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
2586
|
+
* />
|
|
2587
|
+
* ```
|
|
2588
|
+
*/
|
|
2589
|
+
"searchcraft-select": LocalJSX.SearchcraftSelect & JSXBase.HTMLAttributes<HTMLSearchcraftSelectElement>;
|
|
2590
|
+
/**
|
|
2591
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
2592
|
+
*/
|
|
2593
|
+
"searchcraft-slider": LocalJSX.SearchcraftSlider & JSXBase.HTMLAttributes<HTMLSearchcraftSliderElement>;
|
|
2594
|
+
/**
|
|
2595
|
+
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
2596
|
+
* @react-import ```jsx
|
|
2597
|
+
* import { SearchcraftTheme } from "@searchcraft/react-sdk";
|
|
2598
|
+
* ```
|
|
2599
|
+
* @vue-import ```jsx
|
|
2600
|
+
* import { SearchcraftTheme } from "@searchcraft/vue-sdk";
|
|
2601
|
+
* ```
|
|
2602
|
+
* @js-example ```html
|
|
2603
|
+
* <searchcraft-theme />
|
|
2604
|
+
* ```
|
|
2605
|
+
* @react-example ```jsx
|
|
2606
|
+
* <SearchcraftTheme />
|
|
2607
|
+
* ```
|
|
2608
|
+
* @vue-example ```jsx
|
|
2609
|
+
* <SearchcraftTheme />
|
|
2610
|
+
* ```
|
|
2611
|
+
*/
|
|
2612
|
+
"searchcraft-theme": LocalJSX.SearchcraftTheme & JSXBase.HTMLAttributes<HTMLSearchcraftThemeElement>;
|
|
2613
|
+
/**
|
|
2614
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
2615
|
+
*/
|
|
2616
|
+
"searchcraft-toggle-button": LocalJSX.SearchcraftToggleButton & JSXBase.HTMLAttributes<HTMLSearchcraftToggleButtonElement>;
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
/**
|
|
2621
|
+
* @fileoverview entry point for your component library
|
|
2622
|
+
*
|
|
2623
|
+
* This is the entry point for your component library. Use this file to export utilities,
|
|
2624
|
+
* constants or data structure that accompany your components.
|
|
2625
|
+
*
|
|
2626
|
+
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
2627
|
+
* to consume components of this package as outlined in the `README.md`.
|
|
2628
|
+
*/
|
|
2629
|
+
/**
|
|
2630
|
+
* The consumer-facing `Searchcraft` class.
|
|
2631
|
+
*/
|
|
2632
|
+
export declare class Searchcraft extends SearchcraftCore {
|
|
2633
|
+
constructor(config: SearchcraftConfig);
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
export {
|
|
2637
|
+
LocalJSX as JSX,
|
|
2638
|
+
};
|
|
2639
|
+
|
|
2640
|
+
export {};
|
|
77
2641
|
|
|
78
2642
|
export declare const defineCustomElements: () => void;
|