@searchcraft/javascript-sdk 0.9.3 → 0.9.5

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