@searchcraft/react-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.
- package/dist/index.d.ts +3508 -289
- package/dist/index.js +1061 -966
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,289 +1,3508 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
*/
|
|
118
|
-
export
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
*
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
*
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
*
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
*
|
|
205
|
-
*/
|
|
206
|
-
export
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
export
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
export
|
|
288
|
-
|
|
289
|
-
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The SearchcraftConfig object is used to initialize Searchcraft in your application.
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchcraftConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Host IP Address and port number configured and created using Vektron
|
|
11
|
+
*/
|
|
12
|
+
endpointURL: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name or names of search indices configured using Vektron. Given as an array of strings
|
|
15
|
+
*/
|
|
16
|
+
index: string[];
|
|
17
|
+
/**
|
|
18
|
+
* A unique user identifier for the end user.
|
|
19
|
+
*/
|
|
20
|
+
userId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The Index read key provided by Vektron.
|
|
23
|
+
*/
|
|
24
|
+
readKey: string;
|
|
25
|
+
/**
|
|
26
|
+
* The amount of delay, in milliseconds, to debounce search requests. Defaults to `0`.
|
|
27
|
+
*/
|
|
28
|
+
searchDebounceDelay?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum number of results to return per page.
|
|
31
|
+
*/
|
|
32
|
+
searchResultsPerPage?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Name of the ad source to use.
|
|
35
|
+
*/
|
|
36
|
+
adSource?: "adMarketplace" | "Nativo" | "Custom" | "None";
|
|
37
|
+
/**
|
|
38
|
+
* The maximum number of product ads to show for a single search term.
|
|
39
|
+
*/
|
|
40
|
+
admProductAdQuantity?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The maximum number of text ads to show for a single search term.
|
|
43
|
+
*/
|
|
44
|
+
admTextAdQuantity?: number;
|
|
45
|
+
/**
|
|
46
|
+
* The adm sub value.
|
|
47
|
+
*/
|
|
48
|
+
admSub?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The number of custom ads to render at the start of the search results page.
|
|
51
|
+
*/
|
|
52
|
+
customAdStartQuantity?: number;
|
|
53
|
+
/**
|
|
54
|
+
* The number of custom ads to render at the end of the search results page.
|
|
55
|
+
*/
|
|
56
|
+
customAdEndQuantity?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Renders a custom ad in between search results, at the specified interval.
|
|
59
|
+
*/
|
|
60
|
+
customAdInterstitialInterval?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Specifies the number of ads to be rendered in each interstitial in between search results.
|
|
63
|
+
*/
|
|
64
|
+
customAdInterstitialQuantity?: number;
|
|
65
|
+
/**
|
|
66
|
+
* A callback function responsible for rendering the custom ad containers.
|
|
67
|
+
*/
|
|
68
|
+
customAdTemplate?: CustomAdTemplateRenderFunction;
|
|
69
|
+
/**
|
|
70
|
+
* The placement id to use for Nativo ads.
|
|
71
|
+
*/
|
|
72
|
+
nativoPlacementId?: number;
|
|
73
|
+
/**
|
|
74
|
+
* The class name for nativo ad containers.
|
|
75
|
+
*/
|
|
76
|
+
nativoAdClassName?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The number of custom ads to render at the start of the search results page.
|
|
79
|
+
*/
|
|
80
|
+
nativoAdStartQuantity?: number;
|
|
81
|
+
/**
|
|
82
|
+
* The number of custom ads to render at the end of the search results page.
|
|
83
|
+
*/
|
|
84
|
+
nativoAdEndQuantity?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Renders a custom ad in between search results, at the specified interval.
|
|
87
|
+
*/
|
|
88
|
+
nativoAdInterstitialInterval?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Specify how many normal search results to render before rendering the first interstitial ad grouping.
|
|
91
|
+
*/
|
|
92
|
+
nativoAdInterstialStartIndex?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Specifies the number of ads to be rendered in each interstitial in between search results.
|
|
95
|
+
*/
|
|
96
|
+
nativoAdInterstitialQuantity?: number;
|
|
97
|
+
}
|
|
98
|
+
export type SearchcraftAdSource = "adMarketplace" | "Nativo" | "Custom" | "None";
|
|
99
|
+
/**
|
|
100
|
+
* Used internally by consuming packages as part of the core sdk constructor.
|
|
101
|
+
*/
|
|
102
|
+
export interface SearchcraftSDKInfo {
|
|
103
|
+
sdkName: string;
|
|
104
|
+
sdkVersion: string;
|
|
105
|
+
}
|
|
106
|
+
export interface CustomAdTemplateRenderData {
|
|
107
|
+
adContainerId: string;
|
|
108
|
+
searchTerm: string;
|
|
109
|
+
}
|
|
110
|
+
export type CustomAdTemplateRenderFunction = (data: CustomAdTemplateRenderData) => string;
|
|
111
|
+
export interface AdClientResponseItem {
|
|
112
|
+
id: string;
|
|
113
|
+
adSource: SearchcraftAdSource;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A Facet object returned in a search response.
|
|
117
|
+
*/
|
|
118
|
+
export type FacetRoot = {
|
|
119
|
+
[key: string]: FacetChild[];
|
|
120
|
+
};
|
|
121
|
+
export type FacetPrime = FacetRoot[];
|
|
122
|
+
/**
|
|
123
|
+
* Represents the structure of facets, which group search results into categories.
|
|
124
|
+
*/
|
|
125
|
+
export interface FacetChild {
|
|
126
|
+
count: number;
|
|
127
|
+
path: string;
|
|
128
|
+
children?: FacetChild[];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Types of measure requests that can be sent to the /measure/event endpoint.
|
|
132
|
+
*/
|
|
133
|
+
export type MeasureEventName = "sdk_initialized" | "search_requested" | "search_response_received" | "document_clicked";
|
|
134
|
+
/**
|
|
135
|
+
* Properties attached to a measure request.
|
|
136
|
+
*/
|
|
137
|
+
export interface MeasureRequestProperties {
|
|
138
|
+
searchcraft_organization_id?: string;
|
|
139
|
+
searchcraft_application_id?: string;
|
|
140
|
+
searchcraft_index_names: string[];
|
|
141
|
+
search_term?: string;
|
|
142
|
+
number_of_documents?: number;
|
|
143
|
+
external_document_id?: string;
|
|
144
|
+
document_position?: number;
|
|
145
|
+
session_id?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* User properties attached to a measure request.
|
|
149
|
+
*/
|
|
150
|
+
export interface MeasureRequestUser {
|
|
151
|
+
user_id: string;
|
|
152
|
+
country?: string;
|
|
153
|
+
city?: string;
|
|
154
|
+
device_id?: string;
|
|
155
|
+
client_ip?: string;
|
|
156
|
+
locale?: string;
|
|
157
|
+
os?: string;
|
|
158
|
+
platform?: string;
|
|
159
|
+
region?: string;
|
|
160
|
+
sdk_name?: string;
|
|
161
|
+
sdk_version?: string;
|
|
162
|
+
user_agent?: string;
|
|
163
|
+
latitude?: number;
|
|
164
|
+
longitude?: number;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The structure of a response returned from a Searchcraft operation.
|
|
168
|
+
*/
|
|
169
|
+
export interface SearchcraftResponse {
|
|
170
|
+
status: number;
|
|
171
|
+
data: SearchcraftResponseData | SearchcraftResponseError;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Error returned when a search is unsuccessful.
|
|
175
|
+
*/
|
|
176
|
+
export type SearchcraftResponseError = {
|
|
177
|
+
status: number;
|
|
178
|
+
message?: string;
|
|
179
|
+
code?: number;
|
|
180
|
+
hits?: [
|
|
181
|
+
];
|
|
182
|
+
facets?: null;
|
|
183
|
+
count?: number;
|
|
184
|
+
time_taken?: number;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Top-level result returned when a search is successful.
|
|
188
|
+
*/
|
|
189
|
+
export interface SearchcraftResponseData {
|
|
190
|
+
count?: number;
|
|
191
|
+
facets?: FacetPrime;
|
|
192
|
+
hits?: SearchIndexEntry[];
|
|
193
|
+
time_taken?: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Represents an entry in the search index returned as part of a search result.
|
|
197
|
+
*/
|
|
198
|
+
export interface SearchIndexEntry {
|
|
199
|
+
doc?: SearchDocument;
|
|
200
|
+
document_id?: string;
|
|
201
|
+
score?: number;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Data document returned within a SearchResult.
|
|
205
|
+
*/
|
|
206
|
+
export interface SearchDocument extends Record<string, string | number> {
|
|
207
|
+
id: number;
|
|
208
|
+
[key: string]: string | number;
|
|
209
|
+
}
|
|
210
|
+
export interface SearchClientResponseItem {
|
|
211
|
+
id: string;
|
|
212
|
+
document: SearchDocument;
|
|
213
|
+
}
|
|
214
|
+
export type FacetPathsForIndexField = {
|
|
215
|
+
fieldName: string;
|
|
216
|
+
value: string;
|
|
217
|
+
};
|
|
218
|
+
export type RangeValueForIndexField = {
|
|
219
|
+
fieldName: string;
|
|
220
|
+
value: string;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Parameters required to make a successful Search request.
|
|
224
|
+
*/
|
|
225
|
+
export type SearchParams = {
|
|
226
|
+
/**
|
|
227
|
+
* The search mode, which can be either 'fuzzy' or 'exact'.
|
|
228
|
+
*/
|
|
229
|
+
mode: "fuzzy" | "exact";
|
|
230
|
+
/**
|
|
231
|
+
* The starting point for the results, used for pagination.
|
|
232
|
+
* Optional parameter.
|
|
233
|
+
*/
|
|
234
|
+
offset?: number;
|
|
235
|
+
/**
|
|
236
|
+
* The number of results returned.
|
|
237
|
+
* Optional parameter.
|
|
238
|
+
*/
|
|
239
|
+
limit?: number;
|
|
240
|
+
/**
|
|
241
|
+
* The field to order the results by (e.g., 'date_published', 'title', etc.).
|
|
242
|
+
* Optional parameter.
|
|
243
|
+
*/
|
|
244
|
+
order_by?: string;
|
|
245
|
+
/**
|
|
246
|
+
* The search term provided by the user.
|
|
247
|
+
*/
|
|
248
|
+
searchTerm: string;
|
|
249
|
+
/**
|
|
250
|
+
* The sort order, which can be either 'asc' or 'desc'.
|
|
251
|
+
* Optional parameter.
|
|
252
|
+
*/
|
|
253
|
+
sort?: "asc" | "desc";
|
|
254
|
+
facetPathsForIndexFields?: Record<string, FacetPathsForIndexField>;
|
|
255
|
+
rangeValueForIndexFields?: Record<string, RangeValueForIndexField>;
|
|
256
|
+
};
|
|
257
|
+
export interface SubscriptionEventMap {
|
|
258
|
+
ad_container_rendered: AdContainerSubscriptionEvent;
|
|
259
|
+
query_fetched: QueryFetchedEvent;
|
|
260
|
+
query_submitted: QuerySubmittedEvent;
|
|
261
|
+
input_cleared: InputClearedEvent;
|
|
262
|
+
no_results_returned: NoResultsReturnedEvent;
|
|
263
|
+
}
|
|
264
|
+
export interface AdContainerSubscriptionEvent extends SubscriptionEvent {
|
|
265
|
+
name: "ad_container_rendered";
|
|
266
|
+
data: {
|
|
267
|
+
adContainerId: string;
|
|
268
|
+
adSource: SearchcraftAdSource;
|
|
269
|
+
searchTerm: string;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
export interface QuerySubmittedEvent extends SubscriptionEvent {
|
|
273
|
+
name: "query_submitted";
|
|
274
|
+
data: {
|
|
275
|
+
searchTerm: string;
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
export interface QueryFetchedEvent extends SubscriptionEvent {
|
|
279
|
+
name: "query_fetched";
|
|
280
|
+
data: {
|
|
281
|
+
searchTerm: string;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
export interface InputClearedEvent extends SubscriptionEvent {
|
|
285
|
+
name: "input_cleared";
|
|
286
|
+
}
|
|
287
|
+
export interface NoResultsReturnedEvent extends SubscriptionEvent {
|
|
288
|
+
name: "no_results_returned";
|
|
289
|
+
}
|
|
290
|
+
export type SubscriptionEventName = keyof SubscriptionEventMap;
|
|
291
|
+
export type SubscriptionEventCallback<T extends SubscriptionEventName> = (event: SubscriptionEventMap[T]) => void;
|
|
292
|
+
export type UnsubscribeFunction = () => void;
|
|
293
|
+
export interface SubscriptionEvent {
|
|
294
|
+
name: SubscriptionEventName;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* A data type representing an index field value, along with properties
|
|
298
|
+
* describing how to format and display the index field value.
|
|
299
|
+
*/
|
|
300
|
+
export type SearchResultFieldName = {
|
|
301
|
+
/**
|
|
302
|
+
* The index field name.
|
|
303
|
+
*/
|
|
304
|
+
fieldName: string;
|
|
305
|
+
/**
|
|
306
|
+
* The data type to treat this index field as.
|
|
307
|
+
*/
|
|
308
|
+
dataType: "text" | "date" | "number";
|
|
309
|
+
/**
|
|
310
|
+
* The locale to use when formatting dataType: `number`
|
|
311
|
+
*/
|
|
312
|
+
numberFormatLocale?: string;
|
|
313
|
+
/**
|
|
314
|
+
* If it's a number, the number format to apply.
|
|
315
|
+
* reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
316
|
+
*/
|
|
317
|
+
numberFormatOptions?: Intl.NumberFormatOptions;
|
|
318
|
+
/**
|
|
319
|
+
* A scale factor to apply to a `number` value.
|
|
320
|
+
*/
|
|
321
|
+
numberScale?: number;
|
|
322
|
+
/**
|
|
323
|
+
* TODO: Implement DateFormatOptions, for date formatting
|
|
324
|
+
*/
|
|
325
|
+
dateFormatOptions?: unknown;
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* A data type representing the mapping of index fields, for the purpose of rendering them
|
|
329
|
+
* in search result item.
|
|
330
|
+
*/
|
|
331
|
+
export type SearchResultMapping = {
|
|
332
|
+
/**
|
|
333
|
+
* The fields to map to.
|
|
334
|
+
*/
|
|
335
|
+
fieldNames: SearchResultFieldName[];
|
|
336
|
+
/**
|
|
337
|
+
* The delimiter used to join them.
|
|
338
|
+
*/
|
|
339
|
+
delimiter?: string;
|
|
340
|
+
};
|
|
341
|
+
export type SearchResultMappings = {
|
|
342
|
+
body?: SearchResultMapping;
|
|
343
|
+
buttonHref?: SearchResultMapping;
|
|
344
|
+
containerHref?: SearchResultMapping;
|
|
345
|
+
footer?: SearchResultMapping;
|
|
346
|
+
imageSource?: SearchResultMapping;
|
|
347
|
+
subtitle?: SearchResultMapping;
|
|
348
|
+
title?: SearchResultMapping;
|
|
349
|
+
};
|
|
350
|
+
export type PopoverResultMappings = {
|
|
351
|
+
title?: SearchResultMapping;
|
|
352
|
+
subtitle?: SearchResultMapping;
|
|
353
|
+
imageSource?: SearchResultMapping;
|
|
354
|
+
imageAlt?: SearchResultMapping;
|
|
355
|
+
href?: SearchResultMapping;
|
|
356
|
+
};
|
|
357
|
+
export interface FilterItem {
|
|
358
|
+
type: "facets" | "dateRange" | "numericRange" | "exactMatchToggle" | "mostRecentToggle";
|
|
359
|
+
label: string;
|
|
360
|
+
options: object | null;
|
|
361
|
+
}
|
|
362
|
+
export interface FacetsFilterItem extends FilterItem {
|
|
363
|
+
fieldName: string;
|
|
364
|
+
type: "facets";
|
|
365
|
+
options: {
|
|
366
|
+
showSublevel: boolean;
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
export interface NumericFilterItem extends FilterItem {
|
|
370
|
+
fieldName: string;
|
|
371
|
+
type: "numericRange";
|
|
372
|
+
options: {
|
|
373
|
+
min: number;
|
|
374
|
+
max: number;
|
|
375
|
+
granularity: number;
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
export interface DateRangeFilterItem extends FilterItem {
|
|
379
|
+
fieldName: string;
|
|
380
|
+
type: "dateRange";
|
|
381
|
+
options: {
|
|
382
|
+
minDate: Date;
|
|
383
|
+
maxDate: Date;
|
|
384
|
+
granularity: "year" | "month" | "day" | "hour";
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
export interface ExactMatchToggleFilterItem extends FilterItem {
|
|
388
|
+
type: "exactMatchToggle";
|
|
389
|
+
options: {
|
|
390
|
+
subLabel?: string;
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
export interface MostRecentToggleFilterItem extends FilterItem {
|
|
394
|
+
type: "mostRecentToggle";
|
|
395
|
+
options: {
|
|
396
|
+
subLabel?: string;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
declare class AdClient {
|
|
400
|
+
config: SearchcraftConfig;
|
|
401
|
+
constructor(config: SearchcraftConfig);
|
|
402
|
+
getAdsForSearchParams(_params: SearchParams): Promise<AdClientResponseItem[]>;
|
|
403
|
+
onQuerySubmitted(_params: SearchParams): Promise<void>;
|
|
404
|
+
onQueryFetched(_params: SearchParams, _response: SearchcraftResponse): Promise<void>;
|
|
405
|
+
onInputCleared(): Promise<void>;
|
|
406
|
+
}
|
|
407
|
+
declare class MeasureClient {
|
|
408
|
+
private measureRequestTimeout;
|
|
409
|
+
private measureRequestsBatched;
|
|
410
|
+
private config;
|
|
411
|
+
private sdkInfo;
|
|
412
|
+
private userId;
|
|
413
|
+
private sessionId;
|
|
414
|
+
constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo, userId: string);
|
|
415
|
+
/**
|
|
416
|
+
* Getter for the base url used by the /measure endpoints.
|
|
417
|
+
*/
|
|
418
|
+
private get baseMeasureUrl();
|
|
419
|
+
/**
|
|
420
|
+
* Getter for the measure request user. Uses config values + navigator values.
|
|
421
|
+
*/
|
|
422
|
+
private get measureRequestUser();
|
|
423
|
+
/**
|
|
424
|
+
* Sends a measure event to the `/measure/event` endpoint for analytics purposes.
|
|
425
|
+
*
|
|
426
|
+
* @param {MeasureEventName} eventName - Name of the event.
|
|
427
|
+
* @param {Partial<MeasureRequestProperties>} properties - Additional properties to send with the event.
|
|
428
|
+
* @param {Partial<MeasureRequestUser>} user - Additional user properites to send with the event.
|
|
429
|
+
*/
|
|
430
|
+
sendMeasureEvent: (eventName: MeasureEventName, properties?: Partial<MeasureRequestProperties>, user?: Partial<MeasureRequestUser>) => void;
|
|
431
|
+
}
|
|
432
|
+
declare class SearchClient {
|
|
433
|
+
private config;
|
|
434
|
+
private userId;
|
|
435
|
+
private parent;
|
|
436
|
+
constructor(parent: SearchcraftCore, config: SearchcraftConfig, userId: string);
|
|
437
|
+
/**
|
|
438
|
+
* Getter for the base url used by the /search endpoint.
|
|
439
|
+
*/
|
|
440
|
+
private get baseSearchUrl();
|
|
441
|
+
/**
|
|
442
|
+
* Performs a search operation.
|
|
443
|
+
* @param {SearchParams} searchParams - The parameters for the search.
|
|
444
|
+
*/
|
|
445
|
+
getSearchResponse: (searchParams: SearchParams) => Promise<SearchcraftResponse>;
|
|
446
|
+
}
|
|
447
|
+
declare class SearchcraftCore {
|
|
448
|
+
config: SearchcraftConfig;
|
|
449
|
+
measureClient: MeasureClient | undefined;
|
|
450
|
+
searchClient: SearchClient | undefined;
|
|
451
|
+
adClient: AdClient | undefined;
|
|
452
|
+
userId: string;
|
|
453
|
+
private requestTimeout;
|
|
454
|
+
private subscriptionEvents;
|
|
455
|
+
constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo);
|
|
456
|
+
private initInputForms;
|
|
457
|
+
/**
|
|
458
|
+
* When changes happen in the DOM, we want to link any input forms found to the instance of the core.
|
|
459
|
+
*/
|
|
460
|
+
private startObservingMutations;
|
|
461
|
+
private initClients;
|
|
462
|
+
emitEvent<T extends SubscriptionEventName>(eventName: T, event: SubscriptionEventMap[T]): void;
|
|
463
|
+
subscribe<T extends SubscriptionEventName>(eventName: T, callback: SubscriptionEventCallback<T>): UnsubscribeFunction;
|
|
464
|
+
/**
|
|
465
|
+
* Called when a `<searchcraft-ad>` component is rendered
|
|
466
|
+
*/
|
|
467
|
+
handleAdContainerRendered(data: {
|
|
468
|
+
adClientResponseItem?: AdClientResponseItem;
|
|
469
|
+
adContainerId: string;
|
|
470
|
+
adSource: SearchcraftAdSource;
|
|
471
|
+
searchTerm: string;
|
|
472
|
+
}): void;
|
|
473
|
+
/**
|
|
474
|
+
* Perform various actions when the input is cleared
|
|
475
|
+
*/
|
|
476
|
+
handleInputCleared(): void;
|
|
477
|
+
/**
|
|
478
|
+
* Gets items from the SearchClient and the AdClient.
|
|
479
|
+
*/
|
|
480
|
+
getItems: (searchParams: SearchParams, itemsCallback: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void, adCallback: (adClientResponseItems: AdClientResponseItem[]) => void) => void;
|
|
481
|
+
}
|
|
482
|
+
export interface HTMLStencilElement extends HTMLElement {
|
|
483
|
+
componentOnReady(): Promise<this>;
|
|
484
|
+
}
|
|
485
|
+
declare namespace JSXBase {
|
|
486
|
+
interface IntrinsicElements {
|
|
487
|
+
slot: JSXBase.SlotAttributes;
|
|
488
|
+
a: JSXBase.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
489
|
+
abbr: JSXBase.HTMLAttributes;
|
|
490
|
+
address: JSXBase.HTMLAttributes;
|
|
491
|
+
area: JSXBase.AreaHTMLAttributes<HTMLAreaElement>;
|
|
492
|
+
article: JSXBase.HTMLAttributes;
|
|
493
|
+
aside: JSXBase.HTMLAttributes;
|
|
494
|
+
audio: JSXBase.AudioHTMLAttributes<HTMLAudioElement>;
|
|
495
|
+
b: JSXBase.HTMLAttributes;
|
|
496
|
+
base: JSXBase.BaseHTMLAttributes<HTMLBaseElement>;
|
|
497
|
+
bdi: JSXBase.HTMLAttributes;
|
|
498
|
+
bdo: JSXBase.HTMLAttributes;
|
|
499
|
+
big: JSXBase.HTMLAttributes;
|
|
500
|
+
blockquote: JSXBase.BlockquoteHTMLAttributes<HTMLQuoteElement>;
|
|
501
|
+
body: JSXBase.HTMLAttributes<HTMLBodyElement>;
|
|
502
|
+
br: JSXBase.HTMLAttributes<HTMLBRElement>;
|
|
503
|
+
button: JSXBase.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
504
|
+
canvas: JSXBase.CanvasHTMLAttributes<HTMLCanvasElement>;
|
|
505
|
+
caption: JSXBase.HTMLAttributes<HTMLTableCaptionElement>;
|
|
506
|
+
cite: JSXBase.HTMLAttributes;
|
|
507
|
+
code: JSXBase.HTMLAttributes;
|
|
508
|
+
col: JSXBase.ColHTMLAttributes<HTMLTableColElement>;
|
|
509
|
+
colgroup: JSXBase.ColgroupHTMLAttributes<HTMLTableColElement>;
|
|
510
|
+
data: JSXBase.HTMLAttributes<HTMLDataElement>;
|
|
511
|
+
datalist: JSXBase.HTMLAttributes<HTMLDataListElement>;
|
|
512
|
+
dd: JSXBase.HTMLAttributes;
|
|
513
|
+
del: JSXBase.DelHTMLAttributes<HTMLModElement>;
|
|
514
|
+
details: JSXBase.DetailsHTMLAttributes<HTMLElement>;
|
|
515
|
+
dfn: JSXBase.HTMLAttributes;
|
|
516
|
+
dialog: JSXBase.DialogHTMLAttributes<HTMLDialogElement>;
|
|
517
|
+
div: JSXBase.HTMLAttributes<HTMLDivElement>;
|
|
518
|
+
dl: JSXBase.HTMLAttributes<HTMLDListElement>;
|
|
519
|
+
dt: JSXBase.HTMLAttributes;
|
|
520
|
+
em: JSXBase.HTMLAttributes;
|
|
521
|
+
embed: JSXBase.EmbedHTMLAttributes<HTMLEmbedElement>;
|
|
522
|
+
fieldset: JSXBase.FieldsetHTMLAttributes<HTMLFieldSetElement>;
|
|
523
|
+
figcaption: JSXBase.HTMLAttributes;
|
|
524
|
+
figure: JSXBase.HTMLAttributes;
|
|
525
|
+
footer: JSXBase.HTMLAttributes;
|
|
526
|
+
form: JSXBase.FormHTMLAttributes<HTMLFormElement>;
|
|
527
|
+
h1: JSXBase.HTMLAttributes<HTMLHeadingElement>;
|
|
528
|
+
h2: JSXBase.HTMLAttributes<HTMLHeadingElement>;
|
|
529
|
+
h3: JSXBase.HTMLAttributes<HTMLHeadingElement>;
|
|
530
|
+
h4: JSXBase.HTMLAttributes<HTMLHeadingElement>;
|
|
531
|
+
h5: JSXBase.HTMLAttributes<HTMLHeadingElement>;
|
|
532
|
+
h6: JSXBase.HTMLAttributes<HTMLHeadingElement>;
|
|
533
|
+
head: JSXBase.HTMLAttributes<HTMLHeadElement>;
|
|
534
|
+
header: JSXBase.HTMLAttributes;
|
|
535
|
+
hgroup: JSXBase.HTMLAttributes;
|
|
536
|
+
hr: JSXBase.HTMLAttributes<HTMLHRElement>;
|
|
537
|
+
html: JSXBase.HTMLAttributes<HTMLHtmlElement>;
|
|
538
|
+
i: JSXBase.HTMLAttributes;
|
|
539
|
+
iframe: JSXBase.IframeHTMLAttributes<HTMLIFrameElement>;
|
|
540
|
+
img: JSXBase.ImgHTMLAttributes<HTMLImageElement>;
|
|
541
|
+
input: JSXBase.InputHTMLAttributes<HTMLInputElement>;
|
|
542
|
+
ins: JSXBase.InsHTMLAttributes<HTMLModElement>;
|
|
543
|
+
kbd: JSXBase.HTMLAttributes;
|
|
544
|
+
keygen: JSXBase.KeygenHTMLAttributes<HTMLElement>;
|
|
545
|
+
label: JSXBase.LabelHTMLAttributes<HTMLLabelElement>;
|
|
546
|
+
legend: JSXBase.HTMLAttributes<HTMLLegendElement>;
|
|
547
|
+
li: JSXBase.LiHTMLAttributes<HTMLLIElement>;
|
|
548
|
+
link: JSXBase.LinkHTMLAttributes<HTMLLinkElement>;
|
|
549
|
+
main: JSXBase.HTMLAttributes;
|
|
550
|
+
map: JSXBase.MapHTMLAttributes<HTMLMapElement>;
|
|
551
|
+
mark: JSXBase.HTMLAttributes;
|
|
552
|
+
menu: JSXBase.MenuHTMLAttributes<HTMLMenuElement>;
|
|
553
|
+
menuitem: JSXBase.HTMLAttributes;
|
|
554
|
+
meta: JSXBase.MetaHTMLAttributes<HTMLMetaElement>;
|
|
555
|
+
meter: JSXBase.MeterHTMLAttributes<HTMLMeterElement>;
|
|
556
|
+
nav: JSXBase.HTMLAttributes;
|
|
557
|
+
noscript: JSXBase.HTMLAttributes;
|
|
558
|
+
object: JSXBase.ObjectHTMLAttributes<HTMLObjectElement>;
|
|
559
|
+
ol: JSXBase.OlHTMLAttributes<HTMLOListElement>;
|
|
560
|
+
optgroup: JSXBase.OptgroupHTMLAttributes<HTMLOptGroupElement>;
|
|
561
|
+
option: JSXBase.OptionHTMLAttributes<HTMLOptionElement>;
|
|
562
|
+
output: JSXBase.OutputHTMLAttributes<HTMLOutputElement>;
|
|
563
|
+
p: JSXBase.HTMLAttributes<HTMLParagraphElement>;
|
|
564
|
+
param: JSXBase.ParamHTMLAttributes<HTMLParamElement>;
|
|
565
|
+
picture: JSXBase.HTMLAttributes<HTMLPictureElement>;
|
|
566
|
+
pre: JSXBase.HTMLAttributes<HTMLPreElement>;
|
|
567
|
+
progress: JSXBase.ProgressHTMLAttributes<HTMLProgressElement>;
|
|
568
|
+
q: JSXBase.QuoteHTMLAttributes<HTMLQuoteElement>;
|
|
569
|
+
rp: JSXBase.HTMLAttributes;
|
|
570
|
+
rt: JSXBase.HTMLAttributes;
|
|
571
|
+
ruby: JSXBase.HTMLAttributes;
|
|
572
|
+
s: JSXBase.HTMLAttributes;
|
|
573
|
+
samp: JSXBase.HTMLAttributes;
|
|
574
|
+
script: JSXBase.ScriptHTMLAttributes<HTMLScriptElement>;
|
|
575
|
+
section: JSXBase.HTMLAttributes;
|
|
576
|
+
select: JSXBase.SelectHTMLAttributes<HTMLSelectElement>;
|
|
577
|
+
small: JSXBase.HTMLAttributes;
|
|
578
|
+
source: JSXBase.SourceHTMLAttributes<HTMLSourceElement>;
|
|
579
|
+
span: JSXBase.HTMLAttributes<HTMLSpanElement>;
|
|
580
|
+
strong: JSXBase.HTMLAttributes;
|
|
581
|
+
style: JSXBase.StyleHTMLAttributes<HTMLStyleElement>;
|
|
582
|
+
sub: JSXBase.HTMLAttributes;
|
|
583
|
+
summary: JSXBase.HTMLAttributes;
|
|
584
|
+
sup: JSXBase.HTMLAttributes;
|
|
585
|
+
table: JSXBase.TableHTMLAttributes<HTMLTableElement>;
|
|
586
|
+
tbody: JSXBase.HTMLAttributes<HTMLTableSectionElement>;
|
|
587
|
+
td: JSXBase.TdHTMLAttributes<HTMLTableDataCellElement>;
|
|
588
|
+
textarea: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
589
|
+
tfoot: JSXBase.HTMLAttributes<HTMLTableSectionElement>;
|
|
590
|
+
th: JSXBase.ThHTMLAttributes<HTMLTableHeaderCellElement>;
|
|
591
|
+
thead: JSXBase.HTMLAttributes<HTMLTableSectionElement>;
|
|
592
|
+
time: JSXBase.TimeHTMLAttributes<HTMLTimeElement>;
|
|
593
|
+
title: JSXBase.HTMLAttributes<HTMLTitleElement>;
|
|
594
|
+
tr: JSXBase.HTMLAttributes<HTMLTableRowElement>;
|
|
595
|
+
track: JSXBase.TrackHTMLAttributes<HTMLTrackElement>;
|
|
596
|
+
u: JSXBase.HTMLAttributes;
|
|
597
|
+
ul: JSXBase.HTMLAttributes<HTMLUListElement>;
|
|
598
|
+
var: JSXBase.HTMLAttributes;
|
|
599
|
+
video: JSXBase.VideoHTMLAttributes<HTMLVideoElement>;
|
|
600
|
+
wbr: JSXBase.HTMLAttributes;
|
|
601
|
+
animate: JSXBase.SVGAttributes;
|
|
602
|
+
circle: JSXBase.SVGAttributes;
|
|
603
|
+
clipPath: JSXBase.SVGAttributes;
|
|
604
|
+
defs: JSXBase.SVGAttributes;
|
|
605
|
+
desc: JSXBase.SVGAttributes;
|
|
606
|
+
ellipse: JSXBase.SVGAttributes;
|
|
607
|
+
feBlend: JSXBase.SVGAttributes;
|
|
608
|
+
feColorMatrix: JSXBase.SVGAttributes;
|
|
609
|
+
feComponentTransfer: JSXBase.SVGAttributes;
|
|
610
|
+
feComposite: JSXBase.SVGAttributes;
|
|
611
|
+
feConvolveMatrix: JSXBase.SVGAttributes;
|
|
612
|
+
feDiffuseLighting: JSXBase.SVGAttributes;
|
|
613
|
+
feDisplacementMap: JSXBase.SVGAttributes;
|
|
614
|
+
feDistantLight: JSXBase.SVGAttributes;
|
|
615
|
+
feDropShadow: JSXBase.SVGAttributes;
|
|
616
|
+
feFlood: JSXBase.SVGAttributes;
|
|
617
|
+
feFuncA: JSXBase.SVGAttributes;
|
|
618
|
+
feFuncB: JSXBase.SVGAttributes;
|
|
619
|
+
feFuncG: JSXBase.SVGAttributes;
|
|
620
|
+
feFuncR: JSXBase.SVGAttributes;
|
|
621
|
+
feGaussianBlur: JSXBase.SVGAttributes;
|
|
622
|
+
feImage: JSXBase.SVGAttributes;
|
|
623
|
+
feMerge: JSXBase.SVGAttributes;
|
|
624
|
+
feMergeNode: JSXBase.SVGAttributes;
|
|
625
|
+
feMorphology: JSXBase.SVGAttributes;
|
|
626
|
+
feOffset: JSXBase.SVGAttributes;
|
|
627
|
+
fePointLight: JSXBase.SVGAttributes;
|
|
628
|
+
feSpecularLighting: JSXBase.SVGAttributes;
|
|
629
|
+
feSpotLight: JSXBase.SVGAttributes;
|
|
630
|
+
feTile: JSXBase.SVGAttributes;
|
|
631
|
+
feTurbulence: JSXBase.SVGAttributes;
|
|
632
|
+
filter: JSXBase.SVGAttributes;
|
|
633
|
+
foreignObject: JSXBase.SVGAttributes;
|
|
634
|
+
g: JSXBase.SVGAttributes;
|
|
635
|
+
image: JSXBase.SVGAttributes;
|
|
636
|
+
line: JSXBase.SVGAttributes;
|
|
637
|
+
linearGradient: JSXBase.SVGAttributes;
|
|
638
|
+
marker: JSXBase.SVGAttributes;
|
|
639
|
+
mask: JSXBase.SVGAttributes;
|
|
640
|
+
metadata: JSXBase.SVGAttributes;
|
|
641
|
+
path: JSXBase.SVGAttributes;
|
|
642
|
+
pattern: JSXBase.SVGAttributes;
|
|
643
|
+
polygon: JSXBase.SVGAttributes;
|
|
644
|
+
polyline: JSXBase.SVGAttributes;
|
|
645
|
+
radialGradient: JSXBase.SVGAttributes;
|
|
646
|
+
rect: JSXBase.SVGAttributes;
|
|
647
|
+
stop: JSXBase.SVGAttributes;
|
|
648
|
+
svg: JSXBase.SVGAttributes;
|
|
649
|
+
switch: JSXBase.SVGAttributes;
|
|
650
|
+
symbol: JSXBase.SVGAttributes;
|
|
651
|
+
text: JSXBase.SVGAttributes;
|
|
652
|
+
textPath: JSXBase.SVGAttributes;
|
|
653
|
+
tspan: JSXBase.SVGAttributes;
|
|
654
|
+
use: JSXBase.SVGAttributes;
|
|
655
|
+
view: JSXBase.SVGAttributes;
|
|
656
|
+
}
|
|
657
|
+
interface SlotAttributes extends JSXAttributes {
|
|
658
|
+
name?: string;
|
|
659
|
+
slot?: string;
|
|
660
|
+
onSlotchange?: (event: Event) => void;
|
|
661
|
+
}
|
|
662
|
+
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
663
|
+
download?: any;
|
|
664
|
+
href?: string;
|
|
665
|
+
hrefLang?: string;
|
|
666
|
+
hreflang?: string;
|
|
667
|
+
media?: string;
|
|
668
|
+
ping?: string;
|
|
669
|
+
rel?: string;
|
|
670
|
+
target?: string;
|
|
671
|
+
referrerPolicy?: ReferrerPolicy;
|
|
672
|
+
}
|
|
673
|
+
interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
674
|
+
}
|
|
675
|
+
interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
676
|
+
alt?: string;
|
|
677
|
+
coords?: string;
|
|
678
|
+
download?: any;
|
|
679
|
+
href?: string;
|
|
680
|
+
hrefLang?: string;
|
|
681
|
+
hreflang?: string;
|
|
682
|
+
media?: string;
|
|
683
|
+
rel?: string;
|
|
684
|
+
shape?: string;
|
|
685
|
+
target?: string;
|
|
686
|
+
}
|
|
687
|
+
interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
688
|
+
href?: string;
|
|
689
|
+
target?: string;
|
|
690
|
+
}
|
|
691
|
+
interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
692
|
+
cite?: string;
|
|
693
|
+
}
|
|
694
|
+
interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
695
|
+
disabled?: boolean;
|
|
696
|
+
form?: string;
|
|
697
|
+
formAction?: string;
|
|
698
|
+
formaction?: string;
|
|
699
|
+
formEncType?: string;
|
|
700
|
+
formenctype?: string;
|
|
701
|
+
formMethod?: string;
|
|
702
|
+
formmethod?: string;
|
|
703
|
+
formNoValidate?: boolean;
|
|
704
|
+
formnovalidate?: boolean;
|
|
705
|
+
formTarget?: string;
|
|
706
|
+
formtarget?: string;
|
|
707
|
+
name?: string;
|
|
708
|
+
type?: string;
|
|
709
|
+
value?: string | string[] | number;
|
|
710
|
+
popoverTargetAction?: string;
|
|
711
|
+
popoverTargetElement?: Element | null;
|
|
712
|
+
popoverTarget?: string;
|
|
713
|
+
}
|
|
714
|
+
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
715
|
+
height?: number | string;
|
|
716
|
+
width?: number | string;
|
|
717
|
+
}
|
|
718
|
+
interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
719
|
+
span?: number;
|
|
720
|
+
}
|
|
721
|
+
interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
722
|
+
span?: number;
|
|
723
|
+
}
|
|
724
|
+
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
725
|
+
open?: boolean;
|
|
726
|
+
onToggle?: (event: Event) => void;
|
|
727
|
+
}
|
|
728
|
+
interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
729
|
+
cite?: string;
|
|
730
|
+
dateTime?: string;
|
|
731
|
+
datetime?: string;
|
|
732
|
+
}
|
|
733
|
+
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
734
|
+
onCancel?: (event: Event) => void;
|
|
735
|
+
onClose?: (event: Event) => void;
|
|
736
|
+
open?: boolean;
|
|
737
|
+
returnValue?: string;
|
|
738
|
+
}
|
|
739
|
+
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
740
|
+
height?: number | string;
|
|
741
|
+
src?: string;
|
|
742
|
+
type?: string;
|
|
743
|
+
width?: number | string;
|
|
744
|
+
}
|
|
745
|
+
interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
746
|
+
disabled?: boolean;
|
|
747
|
+
form?: string;
|
|
748
|
+
name?: string;
|
|
749
|
+
}
|
|
750
|
+
interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
751
|
+
acceptCharset?: string;
|
|
752
|
+
acceptcharset?: string;
|
|
753
|
+
action?: string;
|
|
754
|
+
autoComplete?: string;
|
|
755
|
+
autocomplete?: string;
|
|
756
|
+
encType?: string;
|
|
757
|
+
enctype?: string;
|
|
758
|
+
method?: string;
|
|
759
|
+
name?: string;
|
|
760
|
+
noValidate?: boolean;
|
|
761
|
+
novalidate?: boolean | string;
|
|
762
|
+
target?: string;
|
|
763
|
+
}
|
|
764
|
+
interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
765
|
+
manifest?: string;
|
|
766
|
+
}
|
|
767
|
+
interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
768
|
+
allow?: string;
|
|
769
|
+
allowFullScreen?: boolean;
|
|
770
|
+
allowfullScreen?: string | boolean;
|
|
771
|
+
allowTransparency?: boolean;
|
|
772
|
+
allowtransparency?: string | boolean;
|
|
773
|
+
frameBorder?: number | string;
|
|
774
|
+
frameborder?: number | string;
|
|
775
|
+
importance?: "low" | "auto" | "high";
|
|
776
|
+
height?: number | string;
|
|
777
|
+
loading?: "lazy" | "auto" | "eager";
|
|
778
|
+
marginHeight?: number;
|
|
779
|
+
marginheight?: string | number;
|
|
780
|
+
marginWidth?: number;
|
|
781
|
+
marginwidth?: string | number;
|
|
782
|
+
name?: string;
|
|
783
|
+
referrerPolicy?: ReferrerPolicy;
|
|
784
|
+
sandbox?: string;
|
|
785
|
+
scrolling?: string;
|
|
786
|
+
seamless?: boolean;
|
|
787
|
+
src?: string;
|
|
788
|
+
srcDoc?: string;
|
|
789
|
+
srcdoc?: string;
|
|
790
|
+
width?: number | string;
|
|
791
|
+
}
|
|
792
|
+
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
793
|
+
alt?: string;
|
|
794
|
+
crossOrigin?: string;
|
|
795
|
+
crossorigin?: string;
|
|
796
|
+
decoding?: "async" | "auto" | "sync";
|
|
797
|
+
importance?: "low" | "auto" | "high";
|
|
798
|
+
height?: number | string;
|
|
799
|
+
loading?: "lazy" | "auto" | "eager";
|
|
800
|
+
sizes?: string;
|
|
801
|
+
src?: string;
|
|
802
|
+
srcSet?: string;
|
|
803
|
+
srcset?: string;
|
|
804
|
+
useMap?: string;
|
|
805
|
+
usemap?: string;
|
|
806
|
+
width?: number | string;
|
|
807
|
+
}
|
|
808
|
+
interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
809
|
+
cite?: string;
|
|
810
|
+
dateTime?: string;
|
|
811
|
+
datetime?: string;
|
|
812
|
+
}
|
|
813
|
+
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
814
|
+
accept?: string;
|
|
815
|
+
allowdirs?: boolean;
|
|
816
|
+
alt?: string;
|
|
817
|
+
autoCapitalize?: string;
|
|
818
|
+
autocapitalize?: string;
|
|
819
|
+
autoComplete?: string;
|
|
820
|
+
autocomplete?: string;
|
|
821
|
+
capture?: string;
|
|
822
|
+
checked?: boolean;
|
|
823
|
+
crossOrigin?: string;
|
|
824
|
+
crossorigin?: string;
|
|
825
|
+
defaultChecked?: boolean;
|
|
826
|
+
defaultValue?: string;
|
|
827
|
+
dirName?: string;
|
|
828
|
+
disabled?: boolean;
|
|
829
|
+
files?: any;
|
|
830
|
+
form?: string;
|
|
831
|
+
formAction?: string;
|
|
832
|
+
formaction?: string;
|
|
833
|
+
formEncType?: string;
|
|
834
|
+
formenctype?: string;
|
|
835
|
+
formMethod?: string;
|
|
836
|
+
formmethod?: string;
|
|
837
|
+
formNoValidate?: boolean;
|
|
838
|
+
formnovalidate?: boolean;
|
|
839
|
+
formTarget?: string;
|
|
840
|
+
formtarget?: string;
|
|
841
|
+
height?: number | string;
|
|
842
|
+
indeterminate?: boolean;
|
|
843
|
+
list?: string;
|
|
844
|
+
max?: number | string;
|
|
845
|
+
maxLength?: number;
|
|
846
|
+
maxlength?: number | string;
|
|
847
|
+
min?: number | string;
|
|
848
|
+
minLength?: number;
|
|
849
|
+
minlength?: number | string;
|
|
850
|
+
multiple?: boolean;
|
|
851
|
+
name?: string;
|
|
852
|
+
onSelect?: (event: Event) => void;
|
|
853
|
+
onselect?: (event: Event) => void;
|
|
854
|
+
pattern?: string;
|
|
855
|
+
placeholder?: string;
|
|
856
|
+
readOnly?: boolean;
|
|
857
|
+
readonly?: boolean | string;
|
|
858
|
+
required?: boolean;
|
|
859
|
+
selectionStart?: number | string;
|
|
860
|
+
selectionEnd?: number | string;
|
|
861
|
+
selectionDirection?: string;
|
|
862
|
+
size?: number;
|
|
863
|
+
src?: string;
|
|
864
|
+
step?: number | string;
|
|
865
|
+
type?: string;
|
|
866
|
+
value?: string | string[] | number;
|
|
867
|
+
valueAsDate?: any;
|
|
868
|
+
valueAsNumber?: any;
|
|
869
|
+
webkitdirectory?: boolean;
|
|
870
|
+
webkitEntries?: any;
|
|
871
|
+
width?: number | string;
|
|
872
|
+
popoverTargetAction?: string;
|
|
873
|
+
popoverTargetElement?: Element | null;
|
|
874
|
+
popoverTarget?: string;
|
|
875
|
+
}
|
|
876
|
+
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
877
|
+
challenge?: string;
|
|
878
|
+
disabled?: boolean;
|
|
879
|
+
form?: string;
|
|
880
|
+
keyType?: string;
|
|
881
|
+
keytype?: string;
|
|
882
|
+
keyParams?: string;
|
|
883
|
+
keyparams?: string;
|
|
884
|
+
name?: string;
|
|
885
|
+
}
|
|
886
|
+
interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
887
|
+
form?: string;
|
|
888
|
+
htmlFor?: string;
|
|
889
|
+
}
|
|
890
|
+
interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
891
|
+
value?: string | string[] | number;
|
|
892
|
+
}
|
|
893
|
+
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
894
|
+
as?: string;
|
|
895
|
+
href?: string;
|
|
896
|
+
hrefLang?: string;
|
|
897
|
+
hreflang?: string;
|
|
898
|
+
importance?: "low" | "auto" | "high";
|
|
899
|
+
integrity?: string;
|
|
900
|
+
media?: string;
|
|
901
|
+
rel?: string;
|
|
902
|
+
sizes?: string;
|
|
903
|
+
type?: string;
|
|
904
|
+
}
|
|
905
|
+
interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
906
|
+
name?: string;
|
|
907
|
+
}
|
|
908
|
+
interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
909
|
+
type?: string;
|
|
910
|
+
}
|
|
911
|
+
interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
912
|
+
autoPlay?: boolean;
|
|
913
|
+
autoplay?: boolean | string;
|
|
914
|
+
controls?: boolean;
|
|
915
|
+
controlslist?: "nodownload" | "nofullscreen" | "noremoteplayback";
|
|
916
|
+
controlsList?: "nodownload" | "nofullscreen" | "noremoteplayback";
|
|
917
|
+
crossOrigin?: string;
|
|
918
|
+
crossorigin?: string;
|
|
919
|
+
loop?: boolean;
|
|
920
|
+
mediaGroup?: string;
|
|
921
|
+
mediagroup?: string;
|
|
922
|
+
muted?: boolean;
|
|
923
|
+
preload?: string;
|
|
924
|
+
src?: string;
|
|
925
|
+
onAbort?: (event: Event) => void;
|
|
926
|
+
onCanPlay?: (event: Event) => void;
|
|
927
|
+
onCanPlayThrough?: (event: Event) => void;
|
|
928
|
+
onDurationChange?: (event: Event) => void;
|
|
929
|
+
onEmptied?: (event: Event) => void;
|
|
930
|
+
onEnded?: (event: Event) => void;
|
|
931
|
+
onError?: (event: Event) => void;
|
|
932
|
+
onInterruptBegin?: (event: Event) => void;
|
|
933
|
+
onInterruptEnd?: (event: Event) => void;
|
|
934
|
+
onLoadedData?: (event: Event) => void;
|
|
935
|
+
onLoadedMetaData?: (event: Event) => void;
|
|
936
|
+
onLoadStart?: (event: Event) => void;
|
|
937
|
+
onMozAudioAvailable?: (event: Event) => void;
|
|
938
|
+
onPause?: (event: Event) => void;
|
|
939
|
+
onPlay?: (event: Event) => void;
|
|
940
|
+
onPlaying?: (event: Event) => void;
|
|
941
|
+
onProgress?: (event: Event) => void;
|
|
942
|
+
onRateChange?: (event: Event) => void;
|
|
943
|
+
onSeeked?: (event: Event) => void;
|
|
944
|
+
onSeeking?: (event: Event) => void;
|
|
945
|
+
onStalled?: (event: Event) => void;
|
|
946
|
+
onSuspend?: (event: Event) => void;
|
|
947
|
+
onTimeUpdate?: (event: Event) => void;
|
|
948
|
+
onVolumeChange?: (event: Event) => void;
|
|
949
|
+
onWaiting?: (event: Event) => void;
|
|
950
|
+
}
|
|
951
|
+
interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
952
|
+
charSet?: string;
|
|
953
|
+
charset?: string;
|
|
954
|
+
content?: string;
|
|
955
|
+
httpEquiv?: string;
|
|
956
|
+
httpequiv?: string;
|
|
957
|
+
name?: string;
|
|
958
|
+
}
|
|
959
|
+
interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
960
|
+
form?: string;
|
|
961
|
+
high?: number;
|
|
962
|
+
low?: number;
|
|
963
|
+
max?: number | string;
|
|
964
|
+
min?: number | string;
|
|
965
|
+
optimum?: number;
|
|
966
|
+
value?: string | string[] | number;
|
|
967
|
+
}
|
|
968
|
+
interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
969
|
+
cite?: string;
|
|
970
|
+
}
|
|
971
|
+
interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
972
|
+
classID?: string;
|
|
973
|
+
classid?: string;
|
|
974
|
+
data?: string;
|
|
975
|
+
form?: string;
|
|
976
|
+
height?: number | string;
|
|
977
|
+
name?: string;
|
|
978
|
+
type?: string;
|
|
979
|
+
useMap?: string;
|
|
980
|
+
usemap?: string;
|
|
981
|
+
width?: number | string;
|
|
982
|
+
wmode?: string;
|
|
983
|
+
}
|
|
984
|
+
interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
985
|
+
reversed?: boolean;
|
|
986
|
+
start?: number;
|
|
987
|
+
}
|
|
988
|
+
interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
989
|
+
disabled?: boolean;
|
|
990
|
+
label?: string;
|
|
991
|
+
}
|
|
992
|
+
interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
993
|
+
disabled?: boolean;
|
|
994
|
+
label?: string;
|
|
995
|
+
selected?: boolean;
|
|
996
|
+
value?: string | string[] | number;
|
|
997
|
+
}
|
|
998
|
+
interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
999
|
+
form?: string;
|
|
1000
|
+
htmlFor?: string;
|
|
1001
|
+
name?: string;
|
|
1002
|
+
}
|
|
1003
|
+
interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1004
|
+
name?: string;
|
|
1005
|
+
value?: string | string[] | number;
|
|
1006
|
+
}
|
|
1007
|
+
interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1008
|
+
max?: number | string;
|
|
1009
|
+
value?: string | string[] | number;
|
|
1010
|
+
}
|
|
1011
|
+
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1012
|
+
async?: boolean;
|
|
1013
|
+
charSet?: string;
|
|
1014
|
+
charset?: string;
|
|
1015
|
+
crossOrigin?: string;
|
|
1016
|
+
crossorigin?: string;
|
|
1017
|
+
defer?: boolean;
|
|
1018
|
+
importance?: "low" | "auto" | "high";
|
|
1019
|
+
integrity?: string;
|
|
1020
|
+
nonce?: string;
|
|
1021
|
+
src?: string;
|
|
1022
|
+
type?: string;
|
|
1023
|
+
}
|
|
1024
|
+
interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1025
|
+
disabled?: boolean;
|
|
1026
|
+
form?: string;
|
|
1027
|
+
multiple?: boolean;
|
|
1028
|
+
name?: string;
|
|
1029
|
+
required?: boolean;
|
|
1030
|
+
size?: number;
|
|
1031
|
+
autoComplete?: string;
|
|
1032
|
+
autocomplete?: string;
|
|
1033
|
+
}
|
|
1034
|
+
interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1035
|
+
height?: number;
|
|
1036
|
+
media?: string;
|
|
1037
|
+
sizes?: string;
|
|
1038
|
+
src?: string;
|
|
1039
|
+
srcSet?: string;
|
|
1040
|
+
type?: string;
|
|
1041
|
+
width?: number;
|
|
1042
|
+
}
|
|
1043
|
+
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1044
|
+
media?: string;
|
|
1045
|
+
nonce?: string;
|
|
1046
|
+
scoped?: boolean;
|
|
1047
|
+
type?: string;
|
|
1048
|
+
}
|
|
1049
|
+
interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1050
|
+
cellPadding?: number | string;
|
|
1051
|
+
cellpadding?: number | string;
|
|
1052
|
+
cellSpacing?: number | string;
|
|
1053
|
+
cellspacing?: number | string;
|
|
1054
|
+
summary?: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1057
|
+
autoComplete?: string;
|
|
1058
|
+
autocomplete?: string;
|
|
1059
|
+
cols?: number;
|
|
1060
|
+
disabled?: boolean;
|
|
1061
|
+
form?: string;
|
|
1062
|
+
maxLength?: number;
|
|
1063
|
+
maxlength?: number | string;
|
|
1064
|
+
minLength?: number;
|
|
1065
|
+
minlength?: number | string;
|
|
1066
|
+
name?: string;
|
|
1067
|
+
onSelect?: (event: Event) => void;
|
|
1068
|
+
onselect?: (event: Event) => void;
|
|
1069
|
+
placeholder?: string;
|
|
1070
|
+
readOnly?: boolean;
|
|
1071
|
+
readonly?: boolean | string;
|
|
1072
|
+
required?: boolean;
|
|
1073
|
+
rows?: number;
|
|
1074
|
+
value?: string | string[] | number;
|
|
1075
|
+
wrap?: string;
|
|
1076
|
+
}
|
|
1077
|
+
interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1078
|
+
colSpan?: number;
|
|
1079
|
+
headers?: string;
|
|
1080
|
+
rowSpan?: number;
|
|
1081
|
+
}
|
|
1082
|
+
interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1083
|
+
abbr?: string;
|
|
1084
|
+
colSpan?: number;
|
|
1085
|
+
headers?: string;
|
|
1086
|
+
rowSpan?: number;
|
|
1087
|
+
rowspan?: number | string;
|
|
1088
|
+
scope?: string;
|
|
1089
|
+
}
|
|
1090
|
+
interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1091
|
+
dateTime?: string;
|
|
1092
|
+
}
|
|
1093
|
+
interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1094
|
+
default?: boolean;
|
|
1095
|
+
kind?: string;
|
|
1096
|
+
label?: string;
|
|
1097
|
+
src?: string;
|
|
1098
|
+
srcLang?: string;
|
|
1099
|
+
srclang?: string;
|
|
1100
|
+
}
|
|
1101
|
+
interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
1102
|
+
height?: number | string;
|
|
1103
|
+
playsInline?: boolean;
|
|
1104
|
+
playsinline?: boolean | string;
|
|
1105
|
+
poster?: string;
|
|
1106
|
+
width?: number | string;
|
|
1107
|
+
}
|
|
1108
|
+
interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
|
|
1109
|
+
innerHTML?: string;
|
|
1110
|
+
accessKey?: string;
|
|
1111
|
+
autoFocus?: boolean;
|
|
1112
|
+
autofocus?: boolean | string;
|
|
1113
|
+
class?: string | {
|
|
1114
|
+
[className: string]: boolean;
|
|
1115
|
+
};
|
|
1116
|
+
contentEditable?: boolean | string;
|
|
1117
|
+
contenteditable?: boolean | string;
|
|
1118
|
+
contextMenu?: string;
|
|
1119
|
+
contextmenu?: string;
|
|
1120
|
+
dir?: string;
|
|
1121
|
+
draggable?: boolean;
|
|
1122
|
+
hidden?: boolean;
|
|
1123
|
+
id?: string;
|
|
1124
|
+
inert?: boolean;
|
|
1125
|
+
lang?: string;
|
|
1126
|
+
spellcheck?: "true" | "false" | any;
|
|
1127
|
+
style?: {
|
|
1128
|
+
[key: string]: string | undefined;
|
|
1129
|
+
};
|
|
1130
|
+
tabIndex?: number;
|
|
1131
|
+
tabindex?: number | string;
|
|
1132
|
+
title?: string;
|
|
1133
|
+
popover?: string | null;
|
|
1134
|
+
inputMode?: string;
|
|
1135
|
+
inputmode?: string;
|
|
1136
|
+
enterKeyHint?: string;
|
|
1137
|
+
enterkeyhint?: string;
|
|
1138
|
+
is?: string;
|
|
1139
|
+
radioGroup?: string;
|
|
1140
|
+
radiogroup?: string;
|
|
1141
|
+
role?: string;
|
|
1142
|
+
about?: string;
|
|
1143
|
+
datatype?: string;
|
|
1144
|
+
inlist?: any;
|
|
1145
|
+
prefix?: string;
|
|
1146
|
+
property?: string;
|
|
1147
|
+
resource?: string;
|
|
1148
|
+
typeof?: string;
|
|
1149
|
+
vocab?: string;
|
|
1150
|
+
autoCapitalize?: string;
|
|
1151
|
+
autocapitalize?: string;
|
|
1152
|
+
autoCorrect?: string;
|
|
1153
|
+
autocorrect?: string;
|
|
1154
|
+
autoSave?: string;
|
|
1155
|
+
autosave?: string;
|
|
1156
|
+
color?: string;
|
|
1157
|
+
itemProp?: string;
|
|
1158
|
+
itemprop?: string;
|
|
1159
|
+
itemScope?: boolean;
|
|
1160
|
+
itemscope?: boolean;
|
|
1161
|
+
itemType?: string;
|
|
1162
|
+
itemtype?: string;
|
|
1163
|
+
itemID?: string;
|
|
1164
|
+
itemid?: string;
|
|
1165
|
+
itemRef?: string;
|
|
1166
|
+
itemref?: string;
|
|
1167
|
+
results?: number;
|
|
1168
|
+
security?: string;
|
|
1169
|
+
unselectable?: boolean;
|
|
1170
|
+
}
|
|
1171
|
+
interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
|
|
1172
|
+
class?: string | {
|
|
1173
|
+
[className: string]: boolean;
|
|
1174
|
+
};
|
|
1175
|
+
color?: string;
|
|
1176
|
+
height?: number | string;
|
|
1177
|
+
id?: string;
|
|
1178
|
+
lang?: string;
|
|
1179
|
+
max?: number | string;
|
|
1180
|
+
media?: string;
|
|
1181
|
+
method?: string;
|
|
1182
|
+
min?: number | string;
|
|
1183
|
+
name?: string;
|
|
1184
|
+
style?: {
|
|
1185
|
+
[key: string]: string | undefined;
|
|
1186
|
+
};
|
|
1187
|
+
target?: string;
|
|
1188
|
+
type?: string;
|
|
1189
|
+
width?: number | string;
|
|
1190
|
+
role?: string;
|
|
1191
|
+
tabindex?: number;
|
|
1192
|
+
"accent-height"?: number | string;
|
|
1193
|
+
accumulate?: "none" | "sum";
|
|
1194
|
+
additive?: "replace" | "sum";
|
|
1195
|
+
"alignment-baseline"?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit";
|
|
1196
|
+
allowReorder?: "no" | "yes";
|
|
1197
|
+
alphabetic?: number | string;
|
|
1198
|
+
amplitude?: number | string;
|
|
1199
|
+
"arabic-form"?: "initial" | "medial" | "terminal" | "isolated";
|
|
1200
|
+
ascent?: number | string;
|
|
1201
|
+
attributeName?: string;
|
|
1202
|
+
attributeType?: string;
|
|
1203
|
+
autoReverse?: number | string;
|
|
1204
|
+
azimuth?: number | string;
|
|
1205
|
+
baseFrequency?: number | string;
|
|
1206
|
+
"baseline-shift"?: number | string;
|
|
1207
|
+
baseProfile?: number | string;
|
|
1208
|
+
bbox?: number | string;
|
|
1209
|
+
begin?: number | string;
|
|
1210
|
+
bias?: number | string;
|
|
1211
|
+
by?: number | string;
|
|
1212
|
+
calcMode?: number | string;
|
|
1213
|
+
"cap-height"?: number | string;
|
|
1214
|
+
clip?: number | string;
|
|
1215
|
+
"clip-path"?: string;
|
|
1216
|
+
clipPathUnits?: number | string;
|
|
1217
|
+
"clip-rule"?: number | string;
|
|
1218
|
+
"color-interpolation"?: number | string;
|
|
1219
|
+
"color-interpolation-filters"?: "auto" | "sRGB" | "linearRGB";
|
|
1220
|
+
"color-profile"?: number | string;
|
|
1221
|
+
"color-rendering"?: number | string;
|
|
1222
|
+
contentScriptType?: number | string;
|
|
1223
|
+
contentStyleType?: number | string;
|
|
1224
|
+
cursor?: number | string;
|
|
1225
|
+
cx?: number | string;
|
|
1226
|
+
cy?: number | string;
|
|
1227
|
+
d?: string;
|
|
1228
|
+
decelerate?: number | string;
|
|
1229
|
+
descent?: number | string;
|
|
1230
|
+
diffuseConstant?: number | string;
|
|
1231
|
+
direction?: number | string;
|
|
1232
|
+
display?: number | string;
|
|
1233
|
+
divisor?: number | string;
|
|
1234
|
+
"dominant-baseline"?: number | string;
|
|
1235
|
+
dur?: number | string;
|
|
1236
|
+
dx?: number | string;
|
|
1237
|
+
dy?: number | string;
|
|
1238
|
+
"edge-mode"?: number | string;
|
|
1239
|
+
elevation?: number | string;
|
|
1240
|
+
"enable-background"?: number | string;
|
|
1241
|
+
end?: number | string;
|
|
1242
|
+
exponent?: number | string;
|
|
1243
|
+
externalResourcesRequired?: number | string;
|
|
1244
|
+
fill?: string;
|
|
1245
|
+
"fill-opacity"?: number | string;
|
|
1246
|
+
"fill-rule"?: "nonzero" | "evenodd" | "inherit";
|
|
1247
|
+
filter?: string;
|
|
1248
|
+
filterRes?: number | string;
|
|
1249
|
+
filterUnits?: number | string;
|
|
1250
|
+
"flood-color"?: number | string;
|
|
1251
|
+
"flood-opacity"?: number | string;
|
|
1252
|
+
focusable?: number | string;
|
|
1253
|
+
"font-family"?: string;
|
|
1254
|
+
"font-size"?: number | string;
|
|
1255
|
+
"font-size-adjust"?: number | string;
|
|
1256
|
+
"font-stretch"?: number | string;
|
|
1257
|
+
"font-style"?: number | string;
|
|
1258
|
+
"font-variant"?: number | string;
|
|
1259
|
+
"font-weight"?: number | string;
|
|
1260
|
+
format?: number | string;
|
|
1261
|
+
from?: number | string;
|
|
1262
|
+
fx?: number | string;
|
|
1263
|
+
fy?: number | string;
|
|
1264
|
+
g1?: number | string;
|
|
1265
|
+
g2?: number | string;
|
|
1266
|
+
"glyph-name"?: number | string;
|
|
1267
|
+
"glyph-orientation-horizontal"?: number | string;
|
|
1268
|
+
"glyph-orientation-vertical"?: number | string;
|
|
1269
|
+
glyphRef?: number | string;
|
|
1270
|
+
gradientTransform?: string;
|
|
1271
|
+
gradientUnits?: string;
|
|
1272
|
+
hanging?: number | string;
|
|
1273
|
+
"horiz-adv-x"?: number | string;
|
|
1274
|
+
"horiz-origin-x"?: number | string;
|
|
1275
|
+
href?: string;
|
|
1276
|
+
ideographic?: number | string;
|
|
1277
|
+
"image-rendering"?: number | string;
|
|
1278
|
+
in2?: number | string;
|
|
1279
|
+
in?: string;
|
|
1280
|
+
intercept?: number | string;
|
|
1281
|
+
k1?: number | string;
|
|
1282
|
+
k2?: number | string;
|
|
1283
|
+
k3?: number | string;
|
|
1284
|
+
k4?: number | string;
|
|
1285
|
+
k?: number | string;
|
|
1286
|
+
kernelMatrix?: number | string;
|
|
1287
|
+
kernelUnitLength?: number | string;
|
|
1288
|
+
kerning?: number | string;
|
|
1289
|
+
keyPoints?: number | string;
|
|
1290
|
+
keySplines?: number | string;
|
|
1291
|
+
keyTimes?: number | string;
|
|
1292
|
+
lengthAdjust?: number | string;
|
|
1293
|
+
"letter-spacing"?: number | string;
|
|
1294
|
+
"lighting-color"?: number | string;
|
|
1295
|
+
limitingConeAngle?: number | string;
|
|
1296
|
+
local?: number | string;
|
|
1297
|
+
"marker-end"?: string;
|
|
1298
|
+
markerHeight?: number | string;
|
|
1299
|
+
"marker-mid"?: string;
|
|
1300
|
+
"marker-start"?: string;
|
|
1301
|
+
markerUnits?: number | string;
|
|
1302
|
+
markerWidth?: number | string;
|
|
1303
|
+
mask?: string;
|
|
1304
|
+
maskContentUnits?: number | string;
|
|
1305
|
+
maskUnits?: number | string;
|
|
1306
|
+
mathematical?: number | string;
|
|
1307
|
+
mode?: number | string;
|
|
1308
|
+
numOctaves?: number | string;
|
|
1309
|
+
offset?: number | string;
|
|
1310
|
+
opacity?: number | string;
|
|
1311
|
+
operator?: number | string;
|
|
1312
|
+
order?: number | string;
|
|
1313
|
+
orient?: number | string;
|
|
1314
|
+
orientation?: number | string;
|
|
1315
|
+
origin?: number | string;
|
|
1316
|
+
overflow?: number | string;
|
|
1317
|
+
"overline-position"?: number | string;
|
|
1318
|
+
"overline-thickness"?: number | string;
|
|
1319
|
+
"paint-order"?: number | string;
|
|
1320
|
+
panose1?: number | string;
|
|
1321
|
+
pathLength?: number | string;
|
|
1322
|
+
patternContentUnits?: string;
|
|
1323
|
+
patternTransform?: number | string;
|
|
1324
|
+
patternUnits?: string;
|
|
1325
|
+
"pointer-events"?: number | string;
|
|
1326
|
+
points?: string;
|
|
1327
|
+
pointsAtX?: number | string;
|
|
1328
|
+
pointsAtY?: number | string;
|
|
1329
|
+
pointsAtZ?: number | string;
|
|
1330
|
+
preserveAlpha?: number | string;
|
|
1331
|
+
preserveAspectRatio?: string;
|
|
1332
|
+
primitiveUnits?: number | string;
|
|
1333
|
+
r?: number | string;
|
|
1334
|
+
radius?: number | string;
|
|
1335
|
+
refX?: number | string;
|
|
1336
|
+
refY?: number | string;
|
|
1337
|
+
"rendering-intent"?: number | string;
|
|
1338
|
+
repeatCount?: number | string;
|
|
1339
|
+
repeatDur?: number | string;
|
|
1340
|
+
requiredextensions?: number | string;
|
|
1341
|
+
requiredFeatures?: number | string;
|
|
1342
|
+
restart?: number | string;
|
|
1343
|
+
result?: string;
|
|
1344
|
+
rotate?: number | string;
|
|
1345
|
+
rx?: number | string;
|
|
1346
|
+
ry?: number | string;
|
|
1347
|
+
scale?: number | string;
|
|
1348
|
+
seed?: number | string;
|
|
1349
|
+
"shape-rendering"?: number | string;
|
|
1350
|
+
slope?: number | string;
|
|
1351
|
+
spacing?: number | string;
|
|
1352
|
+
specularConstant?: number | string;
|
|
1353
|
+
specularExponent?: number | string;
|
|
1354
|
+
speed?: number | string;
|
|
1355
|
+
spreadMethod?: string;
|
|
1356
|
+
startOffset?: number | string;
|
|
1357
|
+
stdDeviation?: number | string;
|
|
1358
|
+
stemh?: number | string;
|
|
1359
|
+
stemv?: number | string;
|
|
1360
|
+
stitchTiles?: number | string;
|
|
1361
|
+
"stop-color"?: string;
|
|
1362
|
+
"stop-opacity"?: number | string;
|
|
1363
|
+
"strikethrough-position"?: number | string;
|
|
1364
|
+
"strikethrough-thickness"?: number | string;
|
|
1365
|
+
string?: number | string;
|
|
1366
|
+
stroke?: string;
|
|
1367
|
+
"stroke-dasharray"?: string | number;
|
|
1368
|
+
"stroke-dashoffset"?: string | number;
|
|
1369
|
+
"stroke-linecap"?: "butt" | "round" | "square" | "inherit";
|
|
1370
|
+
"stroke-linejoin"?: "miter" | "round" | "bevel" | "inherit";
|
|
1371
|
+
"stroke-miterlimit"?: string;
|
|
1372
|
+
"stroke-opacity"?: number | string;
|
|
1373
|
+
"stroke-width"?: number | string;
|
|
1374
|
+
surfaceScale?: number | string;
|
|
1375
|
+
systemLanguage?: number | string;
|
|
1376
|
+
tableValues?: number | string;
|
|
1377
|
+
targetX?: number | string;
|
|
1378
|
+
targetY?: number | string;
|
|
1379
|
+
"text-anchor"?: string;
|
|
1380
|
+
"text-decoration"?: number | string;
|
|
1381
|
+
textLength?: number | string;
|
|
1382
|
+
"text-rendering"?: number | string;
|
|
1383
|
+
to?: number | string;
|
|
1384
|
+
transform?: string;
|
|
1385
|
+
u1?: number | string;
|
|
1386
|
+
u2?: number | string;
|
|
1387
|
+
"underline-position"?: number | string;
|
|
1388
|
+
"underline-thickness"?: number | string;
|
|
1389
|
+
unicode?: number | string;
|
|
1390
|
+
"unicode-bidi"?: number | string;
|
|
1391
|
+
"unicode-range"?: number | string;
|
|
1392
|
+
"units-per-em"?: number | string;
|
|
1393
|
+
"v-alphabetic"?: number | string;
|
|
1394
|
+
values?: string;
|
|
1395
|
+
"vector-effect"?: number | string;
|
|
1396
|
+
version?: string;
|
|
1397
|
+
"vert-adv-y"?: number | string;
|
|
1398
|
+
"vert-origin-x"?: number | string;
|
|
1399
|
+
"vert-origin-y"?: number | string;
|
|
1400
|
+
"v-hanging"?: number | string;
|
|
1401
|
+
"v-ideographic"?: number | string;
|
|
1402
|
+
viewBox?: string;
|
|
1403
|
+
viewTarget?: number | string;
|
|
1404
|
+
visibility?: number | string;
|
|
1405
|
+
"v-mathematical"?: number | string;
|
|
1406
|
+
widths?: number | string;
|
|
1407
|
+
"word-spacing"?: number | string;
|
|
1408
|
+
"writing-mode"?: number | string;
|
|
1409
|
+
x1?: number | string;
|
|
1410
|
+
x2?: number | string;
|
|
1411
|
+
x?: number | string;
|
|
1412
|
+
"x-channel-selector"?: string;
|
|
1413
|
+
"x-height"?: number | string;
|
|
1414
|
+
xlinkActuate?: string;
|
|
1415
|
+
xlinkArcrole?: string;
|
|
1416
|
+
xlinkHref?: string;
|
|
1417
|
+
xlinkRole?: string;
|
|
1418
|
+
xlinkShow?: string;
|
|
1419
|
+
xlinkTitle?: string;
|
|
1420
|
+
xlinkType?: string;
|
|
1421
|
+
xmlBase?: string;
|
|
1422
|
+
xmlLang?: string;
|
|
1423
|
+
xmlns?: string;
|
|
1424
|
+
xmlSpace?: string;
|
|
1425
|
+
y1?: number | string;
|
|
1426
|
+
y2?: number | string;
|
|
1427
|
+
y?: number | string;
|
|
1428
|
+
yChannelSelector?: string;
|
|
1429
|
+
z?: number | string;
|
|
1430
|
+
zoomAndPan?: string;
|
|
1431
|
+
}
|
|
1432
|
+
interface DOMAttributes<T> extends JSXAttributes<T> {
|
|
1433
|
+
slot?: string;
|
|
1434
|
+
part?: string;
|
|
1435
|
+
exportparts?: string;
|
|
1436
|
+
onCopy?: (event: ClipboardEvent) => void;
|
|
1437
|
+
onCopyCapture?: (event: ClipboardEvent) => void;
|
|
1438
|
+
onCut?: (event: ClipboardEvent) => void;
|
|
1439
|
+
onCutCapture?: (event: ClipboardEvent) => void;
|
|
1440
|
+
onPaste?: (event: ClipboardEvent) => void;
|
|
1441
|
+
onPasteCapture?: (event: ClipboardEvent) => void;
|
|
1442
|
+
onCompositionend?: (event: CompositionEvent) => void;
|
|
1443
|
+
onCompositionendCapture?: (event: CompositionEvent) => void;
|
|
1444
|
+
onCompositionstart?: (event: CompositionEvent) => void;
|
|
1445
|
+
onCompositionstartCapture?: (event: CompositionEvent) => void;
|
|
1446
|
+
onCompositionupdate?: (event: CompositionEvent) => void;
|
|
1447
|
+
onCompositionupdateCapture?: (event: CompositionEvent) => void;
|
|
1448
|
+
onFocus?: (event: FocusEvent) => void;
|
|
1449
|
+
onFocusCapture?: (event: FocusEvent) => void;
|
|
1450
|
+
onFocusin?: (event: FocusEvent) => void;
|
|
1451
|
+
onFocusinCapture?: (event: FocusEvent) => void;
|
|
1452
|
+
onFocusout?: (event: FocusEvent) => void;
|
|
1453
|
+
onFocusoutCapture?: (event: FocusEvent) => void;
|
|
1454
|
+
onBlur?: (event: FocusEvent) => void;
|
|
1455
|
+
onBlurCapture?: (event: FocusEvent) => void;
|
|
1456
|
+
onChange?: (event: Event) => void;
|
|
1457
|
+
onChangeCapture?: (event: Event) => void;
|
|
1458
|
+
onInput?: (event: InputEvent) => void;
|
|
1459
|
+
onInputCapture?: (event: InputEvent) => void;
|
|
1460
|
+
onReset?: (event: Event) => void;
|
|
1461
|
+
onResetCapture?: (event: Event) => void;
|
|
1462
|
+
onSubmit?: (event: Event) => void;
|
|
1463
|
+
onSubmitCapture?: (event: Event) => void;
|
|
1464
|
+
onInvalid?: (event: Event) => void;
|
|
1465
|
+
onInvalidCapture?: (event: Event) => void;
|
|
1466
|
+
onBeforeToggle?: (event: Event) => void;
|
|
1467
|
+
onBeforeToggleCapture?: (event: Event) => void;
|
|
1468
|
+
onToggle?: (event: Event) => void;
|
|
1469
|
+
onToggleCapture?: (event: Event) => void;
|
|
1470
|
+
onLoad?: (event: Event) => void;
|
|
1471
|
+
onLoadCapture?: (event: Event) => void;
|
|
1472
|
+
onError?: (event: Event) => void;
|
|
1473
|
+
onErrorCapture?: (event: Event) => void;
|
|
1474
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
1475
|
+
onKeyDownCapture?: (event: KeyboardEvent) => void;
|
|
1476
|
+
onKeyPress?: (event: KeyboardEvent) => void;
|
|
1477
|
+
onKeyPressCapture?: (event: KeyboardEvent) => void;
|
|
1478
|
+
onKeyUp?: (event: KeyboardEvent) => void;
|
|
1479
|
+
onKeyUpCapture?: (event: KeyboardEvent) => void;
|
|
1480
|
+
onAuxClick?: (event: MouseEvent) => void;
|
|
1481
|
+
onClick?: (event: MouseEvent) => void;
|
|
1482
|
+
onClickCapture?: (event: MouseEvent) => void;
|
|
1483
|
+
onContextMenu?: (event: MouseEvent) => void;
|
|
1484
|
+
onContextMenuCapture?: (event: MouseEvent) => void;
|
|
1485
|
+
onDblClick?: (event: MouseEvent) => void;
|
|
1486
|
+
onDblClickCapture?: (event: MouseEvent) => void;
|
|
1487
|
+
onDrag?: (event: DragEvent) => void;
|
|
1488
|
+
onDragCapture?: (event: DragEvent) => void;
|
|
1489
|
+
onDragEnd?: (event: DragEvent) => void;
|
|
1490
|
+
onDragEndCapture?: (event: DragEvent) => void;
|
|
1491
|
+
onDragEnter?: (event: DragEvent) => void;
|
|
1492
|
+
onDragEnterCapture?: (event: DragEvent) => void;
|
|
1493
|
+
onDragExit?: (event: DragEvent) => void;
|
|
1494
|
+
onDragExitCapture?: (event: DragEvent) => void;
|
|
1495
|
+
onDragLeave?: (event: DragEvent) => void;
|
|
1496
|
+
onDragLeaveCapture?: (event: DragEvent) => void;
|
|
1497
|
+
onDragOver?: (event: DragEvent) => void;
|
|
1498
|
+
onDragOverCapture?: (event: DragEvent) => void;
|
|
1499
|
+
onDragStart?: (event: DragEvent) => void;
|
|
1500
|
+
onDragStartCapture?: (event: DragEvent) => void;
|
|
1501
|
+
onDrop?: (event: DragEvent) => void;
|
|
1502
|
+
onDropCapture?: (event: DragEvent) => void;
|
|
1503
|
+
onMouseDown?: (event: MouseEvent) => void;
|
|
1504
|
+
onMouseDownCapture?: (event: MouseEvent) => void;
|
|
1505
|
+
onMouseEnter?: (event: MouseEvent) => void;
|
|
1506
|
+
onMouseLeave?: (event: MouseEvent) => void;
|
|
1507
|
+
onMouseMove?: (event: MouseEvent) => void;
|
|
1508
|
+
onMouseMoveCapture?: (event: MouseEvent) => void;
|
|
1509
|
+
onMouseOut?: (event: MouseEvent) => void;
|
|
1510
|
+
onMouseOutCapture?: (event: MouseEvent) => void;
|
|
1511
|
+
onMouseOver?: (event: MouseEvent) => void;
|
|
1512
|
+
onMouseOverCapture?: (event: MouseEvent) => void;
|
|
1513
|
+
onMouseUp?: (event: MouseEvent) => void;
|
|
1514
|
+
onMouseUpCapture?: (event: MouseEvent) => void;
|
|
1515
|
+
onTouchCancel?: (event: TouchEvent) => void;
|
|
1516
|
+
onTouchCancelCapture?: (event: TouchEvent) => void;
|
|
1517
|
+
onTouchEnd?: (event: TouchEvent) => void;
|
|
1518
|
+
onTouchEndCapture?: (event: TouchEvent) => void;
|
|
1519
|
+
onTouchMove?: (event: TouchEvent) => void;
|
|
1520
|
+
onTouchMoveCapture?: (event: TouchEvent) => void;
|
|
1521
|
+
onTouchStart?: (event: TouchEvent) => void;
|
|
1522
|
+
onTouchStartCapture?: (event: TouchEvent) => void;
|
|
1523
|
+
onPointerDown?: (event: PointerEvent) => void;
|
|
1524
|
+
onPointerDownCapture?: (event: PointerEvent) => void;
|
|
1525
|
+
onPointerMove?: (event: PointerEvent) => void;
|
|
1526
|
+
onPointerMoveCapture?: (event: PointerEvent) => void;
|
|
1527
|
+
onPointerUp?: (event: PointerEvent) => void;
|
|
1528
|
+
onPointerUpCapture?: (event: PointerEvent) => void;
|
|
1529
|
+
onPointerCancel?: (event: PointerEvent) => void;
|
|
1530
|
+
onPointerCancelCapture?: (event: PointerEvent) => void;
|
|
1531
|
+
onPointerEnter?: (event: PointerEvent) => void;
|
|
1532
|
+
onPointerEnterCapture?: (event: PointerEvent) => void;
|
|
1533
|
+
onPointerLeave?: (event: PointerEvent) => void;
|
|
1534
|
+
onPointerLeaveCapture?: (event: PointerEvent) => void;
|
|
1535
|
+
onPointerOver?: (event: PointerEvent) => void;
|
|
1536
|
+
onPointerOverCapture?: (event: PointerEvent) => void;
|
|
1537
|
+
onPointerOut?: (event: PointerEvent) => void;
|
|
1538
|
+
onPointerOutCapture?: (event: PointerEvent) => void;
|
|
1539
|
+
onGotPointerCapture?: (event: PointerEvent) => void;
|
|
1540
|
+
onGotPointerCaptureCapture?: (event: PointerEvent) => void;
|
|
1541
|
+
onLostPointerCapture?: (event: PointerEvent) => void;
|
|
1542
|
+
onLostPointerCaptureCapture?: (event: PointerEvent) => void;
|
|
1543
|
+
onScroll?: (event: UIEvent) => void;
|
|
1544
|
+
onScrollCapture?: (event: UIEvent) => void;
|
|
1545
|
+
onWheel?: (event: WheelEvent) => void;
|
|
1546
|
+
onWheelCapture?: (event: WheelEvent) => void;
|
|
1547
|
+
onAnimationStart?: (event: AnimationEvent) => void;
|
|
1548
|
+
onAnimationStartCapture?: (event: AnimationEvent) => void;
|
|
1549
|
+
onAnimationEnd?: (event: AnimationEvent) => void;
|
|
1550
|
+
onAnimationEndCapture?: (event: AnimationEvent) => void;
|
|
1551
|
+
onAnimationIteration?: (event: AnimationEvent) => void;
|
|
1552
|
+
onAnimationIterationCapture?: (event: AnimationEvent) => void;
|
|
1553
|
+
onTransitionCancel?: (event: TransitionEvent) => void;
|
|
1554
|
+
onTransitionCancelCapture?: (event: TransitionEvent) => void;
|
|
1555
|
+
onTransitionEnd?: (event: TransitionEvent) => void;
|
|
1556
|
+
onTransitionEndCapture?: (event: TransitionEvent) => void;
|
|
1557
|
+
onTransitionRun?: (event: TransitionEvent) => void;
|
|
1558
|
+
onTransitionRunCapture?: (event: TransitionEvent) => void;
|
|
1559
|
+
onTransitionStart?: (event: TransitionEvent) => void;
|
|
1560
|
+
onTransitionStartCapture?: (event: TransitionEvent) => void;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
export interface JSXAttributes<T = Element> {
|
|
1564
|
+
key?: string | number;
|
|
1565
|
+
ref?: (elm?: T) => void;
|
|
1566
|
+
}
|
|
1567
|
+
export type SearchcraftSelectOption = {
|
|
1568
|
+
label: string;
|
|
1569
|
+
value: string | number;
|
|
1570
|
+
selected?: boolean;
|
|
1571
|
+
};
|
|
1572
|
+
declare namespace Components {
|
|
1573
|
+
/**
|
|
1574
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
1575
|
+
*/
|
|
1576
|
+
interface SearchcraftAd {
|
|
1577
|
+
"adClientResponseItem"?: AdClientResponseItem;
|
|
1578
|
+
"adSource": SearchcraftAdSource;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* This web component is designed to display detailed information for a single search result.
|
|
1582
|
+
* Once a query is submitted, the component formats and presents the result.
|
|
1583
|
+
* It is consumed within the `searchcraft-base-search-results` component.
|
|
1584
|
+
*/
|
|
1585
|
+
interface SearchcraftBaseSearchResult {
|
|
1586
|
+
/**
|
|
1587
|
+
* The relationship between the current document and the link for the button rendered when containerHref is not present.
|
|
1588
|
+
*/
|
|
1589
|
+
"buttonRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
1590
|
+
/**
|
|
1591
|
+
* Where to open the link for the button rendered when containerHref is not present.
|
|
1592
|
+
*/
|
|
1593
|
+
"buttonTarget": "_blank" | "_self" | "_top" | "_parent";
|
|
1594
|
+
/**
|
|
1595
|
+
* The relationship between the current document and the link for the containing element.
|
|
1596
|
+
*/
|
|
1597
|
+
"containerRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
1598
|
+
/**
|
|
1599
|
+
* Where to open the link for the containing element.
|
|
1600
|
+
*/
|
|
1601
|
+
"containerTarget": "_blank" | "_self" | "_top" | "_parent";
|
|
1602
|
+
/**
|
|
1603
|
+
* A custom styles object.
|
|
1604
|
+
*/
|
|
1605
|
+
"customStyles"?: string;
|
|
1606
|
+
/**
|
|
1607
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
1608
|
+
*/
|
|
1609
|
+
"documentPosition": number;
|
|
1610
|
+
/**
|
|
1611
|
+
* The placement of the image.
|
|
1612
|
+
*/
|
|
1613
|
+
"imagePlacement": "left" | "right";
|
|
1614
|
+
"item"?: SearchClientResponseItem;
|
|
1615
|
+
"searchResultMappings"?: SearchResultMappings;
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* This web component is responsible for displaying the results of a search query.
|
|
1619
|
+
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
1620
|
+
* ## Usage
|
|
1621
|
+
* ```html
|
|
1622
|
+
* <!-- index.html -->
|
|
1623
|
+
* <searchcraft-base-search-results
|
|
1624
|
+
* ad-interval="4"
|
|
1625
|
+
* place-ad-at-start="false"
|
|
1626
|
+
* result-image-placement="right"
|
|
1627
|
+
* />
|
|
1628
|
+
* ```
|
|
1629
|
+
* ```js
|
|
1630
|
+
* // index.js
|
|
1631
|
+
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
1632
|
+
* baseSearchResults.searchResultMappings = containerHref: {
|
|
1633
|
+
* fieldNames: [
|
|
1634
|
+
* {
|
|
1635
|
+
* fieldName: 'canonical_link',
|
|
1636
|
+
* dataType: 'text',
|
|
1637
|
+
* },
|
|
1638
|
+
* ],
|
|
1639
|
+
* };
|
|
1640
|
+
* baseSearchResults.addEventListener('noResults', () => {
|
|
1641
|
+
* console.log('No search results found');
|
|
1642
|
+
* });
|
|
1643
|
+
* ```
|
|
1644
|
+
*/
|
|
1645
|
+
interface SearchcraftBaseSearchResults {
|
|
1646
|
+
/**
|
|
1647
|
+
* The label for the button rendered when containerHref is not present for each result.
|
|
1648
|
+
*/
|
|
1649
|
+
"buttonLabel"?: string;
|
|
1650
|
+
/**
|
|
1651
|
+
* The relationship between the current document and the link for the button rendered when containerHref is not present for each result.
|
|
1652
|
+
*/
|
|
1653
|
+
"buttonRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
1654
|
+
/**
|
|
1655
|
+
* Where to open the link for the button rendered when containerHref is not present for each result.
|
|
1656
|
+
*/
|
|
1657
|
+
"buttonTarget": "_blank" | "_self" | "_top" | "_parent";
|
|
1658
|
+
/**
|
|
1659
|
+
* The relationship between the current document and the link for the containing element for each result.
|
|
1660
|
+
*/
|
|
1661
|
+
"containerRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
1662
|
+
/**
|
|
1663
|
+
* Where to open the link for the containing element for each result.
|
|
1664
|
+
*/
|
|
1665
|
+
"containerTarget": "_blank" | "_self" | "_top" | "_parent";
|
|
1666
|
+
/**
|
|
1667
|
+
* A custom styles object.
|
|
1668
|
+
*/
|
|
1669
|
+
"customStylesForResults"?: string | Record<string, Record<string, string>>;
|
|
1670
|
+
/**
|
|
1671
|
+
* The placement of the image for each result.
|
|
1672
|
+
*/
|
|
1673
|
+
"resultImagePlacement": "left" | "right";
|
|
1674
|
+
/**
|
|
1675
|
+
* Formats the content rendered for each result.
|
|
1676
|
+
*/
|
|
1677
|
+
"searchResultMappings"?: SearchResultMappings;
|
|
1678
|
+
}
|
|
1679
|
+
/**
|
|
1680
|
+
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
1681
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
1682
|
+
* It is consumed within the `searchcraft-input-form` component.
|
|
1683
|
+
*/
|
|
1684
|
+
interface SearchcraftButton {
|
|
1685
|
+
/**
|
|
1686
|
+
* Whether the button is disabled.
|
|
1687
|
+
*/
|
|
1688
|
+
"disabled"?: boolean;
|
|
1689
|
+
/**
|
|
1690
|
+
* Controls the visual representation of the button.
|
|
1691
|
+
*/
|
|
1692
|
+
"hierarchy"?: "primary" | "tertiary";
|
|
1693
|
+
/**
|
|
1694
|
+
* The icon element.
|
|
1695
|
+
*/
|
|
1696
|
+
"icon"?: Element;
|
|
1697
|
+
/**
|
|
1698
|
+
* Should the button only display an icon.
|
|
1699
|
+
*/
|
|
1700
|
+
"iconOnly"?: boolean;
|
|
1701
|
+
/**
|
|
1702
|
+
* The position of the icon.
|
|
1703
|
+
*/
|
|
1704
|
+
"iconPosition"?: "left" | "right";
|
|
1705
|
+
/**
|
|
1706
|
+
* The label for the button.
|
|
1707
|
+
*/
|
|
1708
|
+
"label": string;
|
|
1709
|
+
/**
|
|
1710
|
+
* The type of the button.
|
|
1711
|
+
*/
|
|
1712
|
+
"type"?: "submit" | "reset" | "button";
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* 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.
|
|
1716
|
+
* ## Usage
|
|
1717
|
+
* ```html
|
|
1718
|
+
* <!-- index.html -->
|
|
1719
|
+
* <searchcraft-error-message error-message="No search results found for query" />
|
|
1720
|
+
* ```
|
|
1721
|
+
*/
|
|
1722
|
+
interface SearchcraftErrorMessage {
|
|
1723
|
+
/**
|
|
1724
|
+
* The error message.
|
|
1725
|
+
*/
|
|
1726
|
+
"errorMessage"?: string;
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* 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.
|
|
1730
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
1731
|
+
* ## Usage
|
|
1732
|
+
* ```html
|
|
1733
|
+
* <!-- index.html -->
|
|
1734
|
+
* <searchcraft-facet-list field-name="title" />
|
|
1735
|
+
* ```
|
|
1736
|
+
* ```js
|
|
1737
|
+
* // index.js
|
|
1738
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
1739
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
1740
|
+
* console.log('Facet selection updated');
|
|
1741
|
+
* });
|
|
1742
|
+
* ```
|
|
1743
|
+
*/
|
|
1744
|
+
interface SearchcraftFacetList {
|
|
1745
|
+
/**
|
|
1746
|
+
* The name of the field where facets are applied.
|
|
1747
|
+
*/
|
|
1748
|
+
"fieldName": string;
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
1752
|
+
* ## Usage
|
|
1753
|
+
* ```html
|
|
1754
|
+
* <!-- index.html -->
|
|
1755
|
+
* <searchcraft-filter-panel />
|
|
1756
|
+
* ```
|
|
1757
|
+
*/
|
|
1758
|
+
interface SearchcraftFilterPanel {
|
|
1759
|
+
/**
|
|
1760
|
+
* The items to filter.
|
|
1761
|
+
*/
|
|
1762
|
+
"items": FilterItem[];
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
1766
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
1767
|
+
* ## Usage
|
|
1768
|
+
* ```html
|
|
1769
|
+
* <!-- index.html -->
|
|
1770
|
+
* <searchcraft-input-form placeholder-value="Search here" />
|
|
1771
|
+
* ```
|
|
1772
|
+
* ```js
|
|
1773
|
+
* // index.js
|
|
1774
|
+
* const searchInputForm = document.querySelector('searchcraft-input-form');
|
|
1775
|
+
* ```
|
|
1776
|
+
*/
|
|
1777
|
+
interface SearchcraftInputForm {
|
|
1778
|
+
/**
|
|
1779
|
+
* Whether or not to automatically submit the search term when the input changes.
|
|
1780
|
+
*/
|
|
1781
|
+
"autoSearch": boolean;
|
|
1782
|
+
/**
|
|
1783
|
+
* The label for the submit button.
|
|
1784
|
+
*/
|
|
1785
|
+
"buttonLabel"?: string;
|
|
1786
|
+
/**
|
|
1787
|
+
* Where to place the search button.
|
|
1788
|
+
*/
|
|
1789
|
+
"buttonPlacement": "left" | "right" | "none";
|
|
1790
|
+
"core"?: SearchcraftCore;
|
|
1791
|
+
/**
|
|
1792
|
+
* A custom styles object to be applied to the input element.
|
|
1793
|
+
*/
|
|
1794
|
+
"customStyles": string | Record<string, string>;
|
|
1795
|
+
/**
|
|
1796
|
+
* The label rendered above the input.
|
|
1797
|
+
*/
|
|
1798
|
+
"inputLabel"?: string;
|
|
1799
|
+
/**
|
|
1800
|
+
* The input element's placeholder value.
|
|
1801
|
+
*/
|
|
1802
|
+
"placeholderValue": string;
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
1806
|
+
* ## Usage
|
|
1807
|
+
* ```html
|
|
1808
|
+
* <!-- index.html -->
|
|
1809
|
+
* <searchcraft-input-label label="Search" />
|
|
1810
|
+
* ```
|
|
1811
|
+
*/
|
|
1812
|
+
interface SearchcraftInputLabel {
|
|
1813
|
+
/**
|
|
1814
|
+
* The classname applied to the label element.
|
|
1815
|
+
*/
|
|
1816
|
+
"inputLabelClassName"?: string | undefined;
|
|
1817
|
+
"label": string;
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* This web component is designed to facilitate pagination of search results.
|
|
1821
|
+
* Once a query is submitted, calculates the number for pages.
|
|
1822
|
+
* ## Usage
|
|
1823
|
+
* ```html
|
|
1824
|
+
* <!-- index.html -->
|
|
1825
|
+
* <searchcraft-pagination />
|
|
1826
|
+
* ```
|
|
1827
|
+
*/
|
|
1828
|
+
interface SearchcraftPagination {
|
|
1829
|
+
/**
|
|
1830
|
+
* The custom styles object.
|
|
1831
|
+
*/
|
|
1832
|
+
"customStyles"?: string;
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
1836
|
+
*/
|
|
1837
|
+
interface SearchcraftPopoverButton {
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* 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.
|
|
1841
|
+
* ## Usage
|
|
1842
|
+
* ```html
|
|
1843
|
+
* <!-- index.html -->
|
|
1844
|
+
* <searchcraft-popover-form type="fullscreen" />
|
|
1845
|
+
* ```
|
|
1846
|
+
* ```js
|
|
1847
|
+
* // index.js
|
|
1848
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
1849
|
+
* popoverForm.popoverResultMappings = {
|
|
1850
|
+
* containerHref: {
|
|
1851
|
+
* fieldNames: [
|
|
1852
|
+
* {
|
|
1853
|
+
* fieldName: 'canonical_link',
|
|
1854
|
+
* dataType: 'text',
|
|
1855
|
+
* },
|
|
1856
|
+
* ],
|
|
1857
|
+
* };
|
|
1858
|
+
* ```
|
|
1859
|
+
*/
|
|
1860
|
+
interface SearchcraftPopoverForm {
|
|
1861
|
+
/**
|
|
1862
|
+
* The hotkey that activates the popover.
|
|
1863
|
+
*/
|
|
1864
|
+
"hotkey": string;
|
|
1865
|
+
/**
|
|
1866
|
+
* The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
|
|
1867
|
+
*/
|
|
1868
|
+
"hotkeyModifier": "ctrl" | "meta" | "alt" | "option";
|
|
1869
|
+
/**
|
|
1870
|
+
* Formats the content rendered for each result.
|
|
1871
|
+
*/
|
|
1872
|
+
"popoverResultMappings"?: PopoverResultMappings;
|
|
1873
|
+
/**
|
|
1874
|
+
* 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.
|
|
1875
|
+
*/
|
|
1876
|
+
"type": "inline" | "fullscreen" | "modal";
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
1880
|
+
*/
|
|
1881
|
+
interface SearchcraftPopoverListItem {
|
|
1882
|
+
/**
|
|
1883
|
+
* The document position relative to the search results (For Measure)
|
|
1884
|
+
*/
|
|
1885
|
+
"documentPosition": number;
|
|
1886
|
+
"item": SearchClientResponseItem | undefined;
|
|
1887
|
+
"popoverResultMappings": PopoverResultMappings | undefined;
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
1891
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
1892
|
+
* ## Usage
|
|
1893
|
+
* ```html
|
|
1894
|
+
* <!-- index.html -->
|
|
1895
|
+
* <searchcraft-popover-list-view />
|
|
1896
|
+
* ```
|
|
1897
|
+
*/
|
|
1898
|
+
interface SearchcraftPopoverListView {
|
|
1899
|
+
"adClientResponseItems": AdClientResponseItem[] | undefined;
|
|
1900
|
+
/**
|
|
1901
|
+
* The mappings that define how the data in the documents are mapped to the list-view-item elements.
|
|
1902
|
+
*/
|
|
1903
|
+
"popoverResultMappings": PopoverResultMappings | undefined;
|
|
1904
|
+
/**
|
|
1905
|
+
* The items to render in the list view.
|
|
1906
|
+
*/
|
|
1907
|
+
"searchClientResponseItems": SearchClientResponseItem[] | undefined;
|
|
1908
|
+
"searchResultsPage": number;
|
|
1909
|
+
"searchResultsPerPage": number;
|
|
1910
|
+
}
|
|
1911
|
+
/**
|
|
1912
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
1913
|
+
* ## Usage
|
|
1914
|
+
* ```html
|
|
1915
|
+
* <!-- index.html -->
|
|
1916
|
+
* <script>
|
|
1917
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
1918
|
+
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
1919
|
+
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
1920
|
+
* </script>
|
|
1921
|
+
* <searchcraft-results-info />
|
|
1922
|
+
* ```
|
|
1923
|
+
*/
|
|
1924
|
+
interface SearchcraftResultsInfo {
|
|
1925
|
+
/**
|
|
1926
|
+
* The custom formatter for the resulting string.
|
|
1927
|
+
* @example ```ts resultsInfo.customFormatter = (range, count, responseTime) => `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`; ```
|
|
1928
|
+
*/
|
|
1929
|
+
"customFormatter"?: (range: [
|
|
1930
|
+
string,
|
|
1931
|
+
string
|
|
1932
|
+
], count: string, responseTime: string) => void;
|
|
1933
|
+
/**
|
|
1934
|
+
* The custom styles object.
|
|
1935
|
+
*/
|
|
1936
|
+
"customStyles"?: string;
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* This web component is designed to choose the number of search results displayed.
|
|
1940
|
+
* ## Usage
|
|
1941
|
+
* ```html
|
|
1942
|
+
* <!-- index.html -->
|
|
1943
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
1944
|
+
* ```
|
|
1945
|
+
*/
|
|
1946
|
+
interface SearchcraftSearchResultsPerPage {
|
|
1947
|
+
/**
|
|
1948
|
+
* The custom styles object.
|
|
1949
|
+
*/
|
|
1950
|
+
"customStyles"?: string;
|
|
1951
|
+
/**
|
|
1952
|
+
* 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.
|
|
1953
|
+
*/
|
|
1954
|
+
"increment": string | number;
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* This web component is designed to allow users to select between a group of options.
|
|
1958
|
+
* ## Usage
|
|
1959
|
+
* ```html
|
|
1960
|
+
* <!-- index.html -->
|
|
1961
|
+
* <searchcraft-select
|
|
1962
|
+
* inputId="searchcraft-select"
|
|
1963
|
+
* name="searchcraft-select"
|
|
1964
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
1965
|
+
* />
|
|
1966
|
+
* ```
|
|
1967
|
+
*/
|
|
1968
|
+
interface SearchcraftSelect {
|
|
1969
|
+
/**
|
|
1970
|
+
* The caption displayed below the select input.
|
|
1971
|
+
*/
|
|
1972
|
+
"caption"?: string;
|
|
1973
|
+
/**
|
|
1974
|
+
* A custom styles object.
|
|
1975
|
+
*/
|
|
1976
|
+
"customStyles"?: string;
|
|
1977
|
+
/**
|
|
1978
|
+
* Whether the select input is disabled.
|
|
1979
|
+
*/
|
|
1980
|
+
"disabled"?: boolean;
|
|
1981
|
+
/**
|
|
1982
|
+
* The ID for the select input.
|
|
1983
|
+
*/
|
|
1984
|
+
"inputId": string;
|
|
1985
|
+
/**
|
|
1986
|
+
* The label of the select input.
|
|
1987
|
+
*/
|
|
1988
|
+
"label"?: string;
|
|
1989
|
+
/**
|
|
1990
|
+
* The ID for the label of the select input.
|
|
1991
|
+
*/
|
|
1992
|
+
"labelId"?: string;
|
|
1993
|
+
/**
|
|
1994
|
+
* The name of the select input.
|
|
1995
|
+
*/
|
|
1996
|
+
"name": string;
|
|
1997
|
+
/**
|
|
1998
|
+
* The options for the select input.
|
|
1999
|
+
*/
|
|
2000
|
+
"options": SearchcraftSelectOption[] | string;
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
2004
|
+
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
2005
|
+
* It is consumed by the `searchcraft-filter-panel` component.
|
|
2006
|
+
*/
|
|
2007
|
+
interface SearchcraftSlider {
|
|
2008
|
+
/**
|
|
2009
|
+
* The type of data allowed.
|
|
2010
|
+
*/
|
|
2011
|
+
"dataType": "number" | "date";
|
|
2012
|
+
/**
|
|
2013
|
+
* The granularity that the value must adhere to.
|
|
2014
|
+
*/
|
|
2015
|
+
"granularity": number;
|
|
2016
|
+
/**
|
|
2017
|
+
* The maximum value allowed.
|
|
2018
|
+
*/
|
|
2019
|
+
"max": number;
|
|
2020
|
+
/**
|
|
2021
|
+
* The minimum value allowed.
|
|
2022
|
+
*/
|
|
2023
|
+
"min": number;
|
|
2024
|
+
}
|
|
2025
|
+
/**
|
|
2026
|
+
* This web component adds Searchcraft's built-in css theme to your page's <head> tag.
|
|
2027
|
+
* It does not render anything visible, its only function is to manage the css styles on the page.
|
|
2028
|
+
* ## Usage
|
|
2029
|
+
* ```html
|
|
2030
|
+
* <!-- index.html -->
|
|
2031
|
+
* <searchcraft-theme theme="light" custom-theme="{}" />
|
|
2032
|
+
* ```
|
|
2033
|
+
*/
|
|
2034
|
+
interface SearchcraftTheme {
|
|
2035
|
+
/**
|
|
2036
|
+
* The custom theme configuration object.
|
|
2037
|
+
*/
|
|
2038
|
+
"customTheme"?: string;
|
|
2039
|
+
/**
|
|
2040
|
+
* The name of the theme.
|
|
2041
|
+
*/
|
|
2042
|
+
"theme"?: string;
|
|
2043
|
+
}
|
|
2044
|
+
/**
|
|
2045
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
2046
|
+
* It is consumed within the `searchcraft-filter-panel` component.
|
|
2047
|
+
*/
|
|
2048
|
+
interface SearchcraftToggleButton {
|
|
2049
|
+
/**
|
|
2050
|
+
* The label.
|
|
2051
|
+
*/
|
|
2052
|
+
"label": string;
|
|
2053
|
+
/**
|
|
2054
|
+
* The secondary label displayed below the main label.
|
|
2055
|
+
*/
|
|
2056
|
+
"subLabel": string | undefined;
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
export interface SearchcraftButtonCustomEvent<T> extends CustomEvent<T> {
|
|
2060
|
+
detail: T;
|
|
2061
|
+
target: HTMLSearchcraftButtonElement;
|
|
2062
|
+
}
|
|
2063
|
+
export interface SearchcraftFacetListCustomEvent<T> extends CustomEvent<T> {
|
|
2064
|
+
detail: T;
|
|
2065
|
+
target: HTMLSearchcraftFacetListElement;
|
|
2066
|
+
}
|
|
2067
|
+
export interface SearchcraftInputFormCustomEvent<T> extends CustomEvent<T> {
|
|
2068
|
+
detail: T;
|
|
2069
|
+
target: HTMLSearchcraftInputFormElement;
|
|
2070
|
+
}
|
|
2071
|
+
export interface SearchcraftSelectCustomEvent<T> extends CustomEvent<T> {
|
|
2072
|
+
detail: T;
|
|
2073
|
+
target: HTMLSearchcraftSelectElement;
|
|
2074
|
+
}
|
|
2075
|
+
export interface SearchcraftSliderCustomEvent<T> extends CustomEvent<T> {
|
|
2076
|
+
detail: T;
|
|
2077
|
+
target: HTMLSearchcraftSliderElement;
|
|
2078
|
+
}
|
|
2079
|
+
export interface SearchcraftToggleButtonCustomEvent<T> extends CustomEvent<T> {
|
|
2080
|
+
detail: T;
|
|
2081
|
+
target: HTMLSearchcraftToggleButtonElement;
|
|
2082
|
+
}
|
|
2083
|
+
declare global {
|
|
2084
|
+
/**
|
|
2085
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
2086
|
+
*/
|
|
2087
|
+
interface HTMLSearchcraftAdElement extends Components.SearchcraftAd, HTMLStencilElement {
|
|
2088
|
+
}
|
|
2089
|
+
var HTMLSearchcraftAdElement: {
|
|
2090
|
+
prototype: HTMLSearchcraftAdElement;
|
|
2091
|
+
new (): HTMLSearchcraftAdElement;
|
|
2092
|
+
};
|
|
2093
|
+
/**
|
|
2094
|
+
* This web component is designed to display detailed information for a single search result.
|
|
2095
|
+
* Once a query is submitted, the component formats and presents the result.
|
|
2096
|
+
* It is consumed within the `searchcraft-base-search-results` component.
|
|
2097
|
+
*/
|
|
2098
|
+
interface HTMLSearchcraftBaseSearchResultElement extends Components.SearchcraftBaseSearchResult, HTMLStencilElement {
|
|
2099
|
+
}
|
|
2100
|
+
var HTMLSearchcraftBaseSearchResultElement: {
|
|
2101
|
+
prototype: HTMLSearchcraftBaseSearchResultElement;
|
|
2102
|
+
new (): HTMLSearchcraftBaseSearchResultElement;
|
|
2103
|
+
};
|
|
2104
|
+
/**
|
|
2105
|
+
* This web component is responsible for displaying the results of a search query.
|
|
2106
|
+
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
2107
|
+
* ## Usage
|
|
2108
|
+
* ```html
|
|
2109
|
+
* <!-- index.html -->
|
|
2110
|
+
* <searchcraft-base-search-results
|
|
2111
|
+
* ad-interval="4"
|
|
2112
|
+
* place-ad-at-start="false"
|
|
2113
|
+
* result-image-placement="right"
|
|
2114
|
+
* />
|
|
2115
|
+
* ```
|
|
2116
|
+
* ```js
|
|
2117
|
+
* // index.js
|
|
2118
|
+
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
2119
|
+
* baseSearchResults.searchResultMappings = containerHref: {
|
|
2120
|
+
* fieldNames: [
|
|
2121
|
+
* {
|
|
2122
|
+
* fieldName: 'canonical_link',
|
|
2123
|
+
* dataType: 'text',
|
|
2124
|
+
* },
|
|
2125
|
+
* ],
|
|
2126
|
+
* };
|
|
2127
|
+
* baseSearchResults.addEventListener('noResults', () => {
|
|
2128
|
+
* console.log('No search results found');
|
|
2129
|
+
* });
|
|
2130
|
+
* ```
|
|
2131
|
+
*/
|
|
2132
|
+
interface HTMLSearchcraftBaseSearchResultsElement extends Components.SearchcraftBaseSearchResults, HTMLStencilElement {
|
|
2133
|
+
}
|
|
2134
|
+
var HTMLSearchcraftBaseSearchResultsElement: {
|
|
2135
|
+
prototype: HTMLSearchcraftBaseSearchResultsElement;
|
|
2136
|
+
new (): HTMLSearchcraftBaseSearchResultsElement;
|
|
2137
|
+
};
|
|
2138
|
+
interface HTMLSearchcraftButtonElementEventMap {
|
|
2139
|
+
"buttonClick": void;
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
2143
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
2144
|
+
* It is consumed within the `searchcraft-input-form` component.
|
|
2145
|
+
*/
|
|
2146
|
+
interface HTMLSearchcraftButtonElement extends Components.SearchcraftButton, HTMLStencilElement {
|
|
2147
|
+
addEventListener<K extends keyof HTMLSearchcraftButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftButtonElement, ev: SearchcraftButtonCustomEvent<HTMLSearchcraftButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2148
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2149
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2150
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2151
|
+
removeEventListener<K extends keyof HTMLSearchcraftButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftButtonElement, ev: SearchcraftButtonCustomEvent<HTMLSearchcraftButtonElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2152
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2153
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2154
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2155
|
+
}
|
|
2156
|
+
var HTMLSearchcraftButtonElement: {
|
|
2157
|
+
prototype: HTMLSearchcraftButtonElement;
|
|
2158
|
+
new (): HTMLSearchcraftButtonElement;
|
|
2159
|
+
};
|
|
2160
|
+
/**
|
|
2161
|
+
* 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.
|
|
2162
|
+
* ## Usage
|
|
2163
|
+
* ```html
|
|
2164
|
+
* <!-- index.html -->
|
|
2165
|
+
* <searchcraft-error-message error-message="No search results found for query" />
|
|
2166
|
+
* ```
|
|
2167
|
+
*/
|
|
2168
|
+
interface HTMLSearchcraftErrorMessageElement extends Components.SearchcraftErrorMessage, HTMLStencilElement {
|
|
2169
|
+
}
|
|
2170
|
+
var HTMLSearchcraftErrorMessageElement: {
|
|
2171
|
+
prototype: HTMLSearchcraftErrorMessageElement;
|
|
2172
|
+
new (): HTMLSearchcraftErrorMessageElement;
|
|
2173
|
+
};
|
|
2174
|
+
interface HTMLSearchcraftFacetListElementEventMap {
|
|
2175
|
+
"facetSelectionUpdated": {
|
|
2176
|
+
paths: string[];
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* 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.
|
|
2181
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
2182
|
+
* ## Usage
|
|
2183
|
+
* ```html
|
|
2184
|
+
* <!-- index.html -->
|
|
2185
|
+
* <searchcraft-facet-list field-name="title" />
|
|
2186
|
+
* ```
|
|
2187
|
+
* ```js
|
|
2188
|
+
* // index.js
|
|
2189
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
2190
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
2191
|
+
* console.log('Facet selection updated');
|
|
2192
|
+
* });
|
|
2193
|
+
* ```
|
|
2194
|
+
*/
|
|
2195
|
+
interface HTMLSearchcraftFacetListElement extends Components.SearchcraftFacetList, HTMLStencilElement {
|
|
2196
|
+
addEventListener<K extends keyof HTMLSearchcraftFacetListElementEventMap>(type: K, listener: (this: HTMLSearchcraftFacetListElement, ev: SearchcraftFacetListCustomEvent<HTMLSearchcraftFacetListElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2197
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2198
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2199
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2200
|
+
removeEventListener<K extends keyof HTMLSearchcraftFacetListElementEventMap>(type: K, listener: (this: HTMLSearchcraftFacetListElement, ev: SearchcraftFacetListCustomEvent<HTMLSearchcraftFacetListElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2201
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2202
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2203
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2204
|
+
}
|
|
2205
|
+
var HTMLSearchcraftFacetListElement: {
|
|
2206
|
+
prototype: HTMLSearchcraftFacetListElement;
|
|
2207
|
+
new (): HTMLSearchcraftFacetListElement;
|
|
2208
|
+
};
|
|
2209
|
+
/**
|
|
2210
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
2211
|
+
* ## Usage
|
|
2212
|
+
* ```html
|
|
2213
|
+
* <!-- index.html -->
|
|
2214
|
+
* <searchcraft-filter-panel />
|
|
2215
|
+
* ```
|
|
2216
|
+
*/
|
|
2217
|
+
interface HTMLSearchcraftFilterPanelElement extends Components.SearchcraftFilterPanel, HTMLStencilElement {
|
|
2218
|
+
}
|
|
2219
|
+
var HTMLSearchcraftFilterPanelElement: {
|
|
2220
|
+
prototype: HTMLSearchcraftFilterPanelElement;
|
|
2221
|
+
new (): HTMLSearchcraftFilterPanelElement;
|
|
2222
|
+
};
|
|
2223
|
+
interface HTMLSearchcraftInputFormElementEventMap {
|
|
2224
|
+
"inputFocus": void;
|
|
2225
|
+
"inputBlur": void;
|
|
2226
|
+
"inputInit": void;
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
2230
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
2231
|
+
* ## Usage
|
|
2232
|
+
* ```html
|
|
2233
|
+
* <!-- index.html -->
|
|
2234
|
+
* <searchcraft-input-form placeholder-value="Search here" />
|
|
2235
|
+
* ```
|
|
2236
|
+
* ```js
|
|
2237
|
+
* // index.js
|
|
2238
|
+
* const searchInputForm = document.querySelector('searchcraft-input-form');
|
|
2239
|
+
* ```
|
|
2240
|
+
*/
|
|
2241
|
+
interface HTMLSearchcraftInputFormElement extends Components.SearchcraftInputForm, HTMLStencilElement {
|
|
2242
|
+
addEventListener<K extends keyof HTMLSearchcraftInputFormElementEventMap>(type: K, listener: (this: HTMLSearchcraftInputFormElement, ev: SearchcraftInputFormCustomEvent<HTMLSearchcraftInputFormElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2243
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2244
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2245
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2246
|
+
removeEventListener<K extends keyof HTMLSearchcraftInputFormElementEventMap>(type: K, listener: (this: HTMLSearchcraftInputFormElement, ev: SearchcraftInputFormCustomEvent<HTMLSearchcraftInputFormElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2247
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2248
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2249
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2250
|
+
}
|
|
2251
|
+
var HTMLSearchcraftInputFormElement: {
|
|
2252
|
+
prototype: HTMLSearchcraftInputFormElement;
|
|
2253
|
+
new (): HTMLSearchcraftInputFormElement;
|
|
2254
|
+
};
|
|
2255
|
+
/**
|
|
2256
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
2257
|
+
* ## Usage
|
|
2258
|
+
* ```html
|
|
2259
|
+
* <!-- index.html -->
|
|
2260
|
+
* <searchcraft-input-label label="Search" />
|
|
2261
|
+
* ```
|
|
2262
|
+
*/
|
|
2263
|
+
interface HTMLSearchcraftInputLabelElement extends Components.SearchcraftInputLabel, HTMLStencilElement {
|
|
2264
|
+
}
|
|
2265
|
+
var HTMLSearchcraftInputLabelElement: {
|
|
2266
|
+
prototype: HTMLSearchcraftInputLabelElement;
|
|
2267
|
+
new (): HTMLSearchcraftInputLabelElement;
|
|
2268
|
+
};
|
|
2269
|
+
/**
|
|
2270
|
+
* This web component is designed to facilitate pagination of search results.
|
|
2271
|
+
* Once a query is submitted, calculates the number for pages.
|
|
2272
|
+
* ## Usage
|
|
2273
|
+
* ```html
|
|
2274
|
+
* <!-- index.html -->
|
|
2275
|
+
* <searchcraft-pagination />
|
|
2276
|
+
* ```
|
|
2277
|
+
*/
|
|
2278
|
+
interface HTMLSearchcraftPaginationElement extends Components.SearchcraftPagination, HTMLStencilElement {
|
|
2279
|
+
}
|
|
2280
|
+
var HTMLSearchcraftPaginationElement: {
|
|
2281
|
+
prototype: HTMLSearchcraftPaginationElement;
|
|
2282
|
+
new (): HTMLSearchcraftPaginationElement;
|
|
2283
|
+
};
|
|
2284
|
+
/**
|
|
2285
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
2286
|
+
*/
|
|
2287
|
+
interface HTMLSearchcraftPopoverButtonElement extends Components.SearchcraftPopoverButton, HTMLStencilElement {
|
|
2288
|
+
}
|
|
2289
|
+
var HTMLSearchcraftPopoverButtonElement: {
|
|
2290
|
+
prototype: HTMLSearchcraftPopoverButtonElement;
|
|
2291
|
+
new (): HTMLSearchcraftPopoverButtonElement;
|
|
2292
|
+
};
|
|
2293
|
+
/**
|
|
2294
|
+
* 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.
|
|
2295
|
+
* ## Usage
|
|
2296
|
+
* ```html
|
|
2297
|
+
* <!-- index.html -->
|
|
2298
|
+
* <searchcraft-popover-form type="fullscreen" />
|
|
2299
|
+
* ```
|
|
2300
|
+
* ```js
|
|
2301
|
+
* // index.js
|
|
2302
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
2303
|
+
* popoverForm.popoverResultMappings = {
|
|
2304
|
+
* containerHref: {
|
|
2305
|
+
* fieldNames: [
|
|
2306
|
+
* {
|
|
2307
|
+
* fieldName: 'canonical_link',
|
|
2308
|
+
* dataType: 'text',
|
|
2309
|
+
* },
|
|
2310
|
+
* ],
|
|
2311
|
+
* };
|
|
2312
|
+
* ```
|
|
2313
|
+
*/
|
|
2314
|
+
interface HTMLSearchcraftPopoverFormElement extends Components.SearchcraftPopoverForm, HTMLStencilElement {
|
|
2315
|
+
}
|
|
2316
|
+
var HTMLSearchcraftPopoverFormElement: {
|
|
2317
|
+
prototype: HTMLSearchcraftPopoverFormElement;
|
|
2318
|
+
new (): HTMLSearchcraftPopoverFormElement;
|
|
2319
|
+
};
|
|
2320
|
+
/**
|
|
2321
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
2322
|
+
*/
|
|
2323
|
+
interface HTMLSearchcraftPopoverListItemElement extends Components.SearchcraftPopoverListItem, HTMLStencilElement {
|
|
2324
|
+
}
|
|
2325
|
+
var HTMLSearchcraftPopoverListItemElement: {
|
|
2326
|
+
prototype: HTMLSearchcraftPopoverListItemElement;
|
|
2327
|
+
new (): HTMLSearchcraftPopoverListItemElement;
|
|
2328
|
+
};
|
|
2329
|
+
/**
|
|
2330
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
2331
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
2332
|
+
* ## Usage
|
|
2333
|
+
* ```html
|
|
2334
|
+
* <!-- index.html -->
|
|
2335
|
+
* <searchcraft-popover-list-view />
|
|
2336
|
+
* ```
|
|
2337
|
+
*/
|
|
2338
|
+
interface HTMLSearchcraftPopoverListViewElement extends Components.SearchcraftPopoverListView, HTMLStencilElement {
|
|
2339
|
+
}
|
|
2340
|
+
var HTMLSearchcraftPopoverListViewElement: {
|
|
2341
|
+
prototype: HTMLSearchcraftPopoverListViewElement;
|
|
2342
|
+
new (): HTMLSearchcraftPopoverListViewElement;
|
|
2343
|
+
};
|
|
2344
|
+
/**
|
|
2345
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
2346
|
+
* ## Usage
|
|
2347
|
+
* ```html
|
|
2348
|
+
* <!-- index.html -->
|
|
2349
|
+
* <script>
|
|
2350
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
2351
|
+
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
2352
|
+
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
2353
|
+
* </script>
|
|
2354
|
+
* <searchcraft-results-info />
|
|
2355
|
+
* ```
|
|
2356
|
+
*/
|
|
2357
|
+
interface HTMLSearchcraftResultsInfoElement extends Components.SearchcraftResultsInfo, HTMLStencilElement {
|
|
2358
|
+
}
|
|
2359
|
+
var HTMLSearchcraftResultsInfoElement: {
|
|
2360
|
+
prototype: HTMLSearchcraftResultsInfoElement;
|
|
2361
|
+
new (): HTMLSearchcraftResultsInfoElement;
|
|
2362
|
+
};
|
|
2363
|
+
/**
|
|
2364
|
+
* This web component is designed to choose the number of search results displayed.
|
|
2365
|
+
* ## Usage
|
|
2366
|
+
* ```html
|
|
2367
|
+
* <!-- index.html -->
|
|
2368
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
2369
|
+
* ```
|
|
2370
|
+
*/
|
|
2371
|
+
interface HTMLSearchcraftSearchResultsPerPageElement extends Components.SearchcraftSearchResultsPerPage, HTMLStencilElement {
|
|
2372
|
+
}
|
|
2373
|
+
var HTMLSearchcraftSearchResultsPerPageElement: {
|
|
2374
|
+
prototype: HTMLSearchcraftSearchResultsPerPageElement;
|
|
2375
|
+
new (): HTMLSearchcraftSearchResultsPerPageElement;
|
|
2376
|
+
};
|
|
2377
|
+
interface HTMLSearchcraftSelectElementEventMap {
|
|
2378
|
+
"selectChange": string;
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* This web component is designed to allow users to select between a group of options.
|
|
2382
|
+
* ## Usage
|
|
2383
|
+
* ```html
|
|
2384
|
+
* <!-- index.html -->
|
|
2385
|
+
* <searchcraft-select
|
|
2386
|
+
* inputId="searchcraft-select"
|
|
2387
|
+
* name="searchcraft-select"
|
|
2388
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
2389
|
+
* />
|
|
2390
|
+
* ```
|
|
2391
|
+
*/
|
|
2392
|
+
interface HTMLSearchcraftSelectElement extends Components.SearchcraftSelect, HTMLStencilElement {
|
|
2393
|
+
addEventListener<K extends keyof HTMLSearchcraftSelectElementEventMap>(type: K, listener: (this: HTMLSearchcraftSelectElement, ev: SearchcraftSelectCustomEvent<HTMLSearchcraftSelectElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2394
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2395
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2396
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2397
|
+
removeEventListener<K extends keyof HTMLSearchcraftSelectElementEventMap>(type: K, listener: (this: HTMLSearchcraftSelectElement, ev: SearchcraftSelectCustomEvent<HTMLSearchcraftSelectElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2398
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2399
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2400
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2401
|
+
}
|
|
2402
|
+
var HTMLSearchcraftSelectElement: {
|
|
2403
|
+
prototype: HTMLSearchcraftSelectElement;
|
|
2404
|
+
new (): HTMLSearchcraftSelectElement;
|
|
2405
|
+
};
|
|
2406
|
+
interface HTMLSearchcraftSliderElementEventMap {
|
|
2407
|
+
"rangeChanged": any;
|
|
2408
|
+
}
|
|
2409
|
+
/**
|
|
2410
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
2411
|
+
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
2412
|
+
* It is consumed by the `searchcraft-filter-panel` component.
|
|
2413
|
+
*/
|
|
2414
|
+
interface HTMLSearchcraftSliderElement extends Components.SearchcraftSlider, HTMLStencilElement {
|
|
2415
|
+
addEventListener<K extends keyof HTMLSearchcraftSliderElementEventMap>(type: K, listener: (this: HTMLSearchcraftSliderElement, ev: SearchcraftSliderCustomEvent<HTMLSearchcraftSliderElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2416
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2417
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2418
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2419
|
+
removeEventListener<K extends keyof HTMLSearchcraftSliderElementEventMap>(type: K, listener: (this: HTMLSearchcraftSliderElement, ev: SearchcraftSliderCustomEvent<HTMLSearchcraftSliderElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2420
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2421
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2422
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2423
|
+
}
|
|
2424
|
+
var HTMLSearchcraftSliderElement: {
|
|
2425
|
+
prototype: HTMLSearchcraftSliderElement;
|
|
2426
|
+
new (): HTMLSearchcraftSliderElement;
|
|
2427
|
+
};
|
|
2428
|
+
/**
|
|
2429
|
+
* This web component adds Searchcraft's built-in css theme to your page's <head> tag.
|
|
2430
|
+
* It does not render anything visible, its only function is to manage the css styles on the page.
|
|
2431
|
+
* ## Usage
|
|
2432
|
+
* ```html
|
|
2433
|
+
* <!-- index.html -->
|
|
2434
|
+
* <searchcraft-theme theme="light" custom-theme="{}" />
|
|
2435
|
+
* ```
|
|
2436
|
+
*/
|
|
2437
|
+
interface HTMLSearchcraftThemeElement extends Components.SearchcraftTheme, HTMLStencilElement {
|
|
2438
|
+
}
|
|
2439
|
+
var HTMLSearchcraftThemeElement: {
|
|
2440
|
+
prototype: HTMLSearchcraftThemeElement;
|
|
2441
|
+
new (): HTMLSearchcraftThemeElement;
|
|
2442
|
+
};
|
|
2443
|
+
interface HTMLSearchcraftToggleButtonElementEventMap {
|
|
2444
|
+
"toggleUpdated": boolean;
|
|
2445
|
+
}
|
|
2446
|
+
/**
|
|
2447
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
2448
|
+
* It is consumed within the `searchcraft-filter-panel` component.
|
|
2449
|
+
*/
|
|
2450
|
+
interface HTMLSearchcraftToggleButtonElement extends Components.SearchcraftToggleButton, HTMLStencilElement {
|
|
2451
|
+
addEventListener<K extends keyof HTMLSearchcraftToggleButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftToggleButtonElement, ev: SearchcraftToggleButtonCustomEvent<HTMLSearchcraftToggleButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2452
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2453
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2454
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2455
|
+
removeEventListener<K extends keyof HTMLSearchcraftToggleButtonElementEventMap>(type: K, listener: (this: HTMLSearchcraftToggleButtonElement, ev: SearchcraftToggleButtonCustomEvent<HTMLSearchcraftToggleButtonElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2456
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2457
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2458
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2459
|
+
}
|
|
2460
|
+
var HTMLSearchcraftToggleButtonElement: {
|
|
2461
|
+
prototype: HTMLSearchcraftToggleButtonElement;
|
|
2462
|
+
new (): HTMLSearchcraftToggleButtonElement;
|
|
2463
|
+
};
|
|
2464
|
+
interface HTMLElementTagNameMap {
|
|
2465
|
+
"searchcraft-ad": HTMLSearchcraftAdElement;
|
|
2466
|
+
"searchcraft-base-search-result": HTMLSearchcraftBaseSearchResultElement;
|
|
2467
|
+
"searchcraft-base-search-results": HTMLSearchcraftBaseSearchResultsElement;
|
|
2468
|
+
"searchcraft-button": HTMLSearchcraftButtonElement;
|
|
2469
|
+
"searchcraft-error-message": HTMLSearchcraftErrorMessageElement;
|
|
2470
|
+
"searchcraft-facet-list": HTMLSearchcraftFacetListElement;
|
|
2471
|
+
"searchcraft-filter-panel": HTMLSearchcraftFilterPanelElement;
|
|
2472
|
+
"searchcraft-input-form": HTMLSearchcraftInputFormElement;
|
|
2473
|
+
"searchcraft-input-label": HTMLSearchcraftInputLabelElement;
|
|
2474
|
+
"searchcraft-pagination": HTMLSearchcraftPaginationElement;
|
|
2475
|
+
"searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
|
|
2476
|
+
"searchcraft-popover-form": HTMLSearchcraftPopoverFormElement;
|
|
2477
|
+
"searchcraft-popover-list-item": HTMLSearchcraftPopoverListItemElement;
|
|
2478
|
+
"searchcraft-popover-list-view": HTMLSearchcraftPopoverListViewElement;
|
|
2479
|
+
"searchcraft-results-info": HTMLSearchcraftResultsInfoElement;
|
|
2480
|
+
"searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
|
|
2481
|
+
"searchcraft-select": HTMLSearchcraftSelectElement;
|
|
2482
|
+
"searchcraft-slider": HTMLSearchcraftSliderElement;
|
|
2483
|
+
"searchcraft-theme": HTMLSearchcraftThemeElement;
|
|
2484
|
+
"searchcraft-toggle-button": HTMLSearchcraftToggleButtonElement;
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
declare namespace LocalJSX {
|
|
2488
|
+
/**
|
|
2489
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
2490
|
+
*/
|
|
2491
|
+
interface SearchcraftAd {
|
|
2492
|
+
"adClientResponseItem"?: AdClientResponseItem;
|
|
2493
|
+
"adSource"?: SearchcraftAdSource;
|
|
2494
|
+
}
|
|
2495
|
+
/**
|
|
2496
|
+
* This web component is designed to display detailed information for a single search result.
|
|
2497
|
+
* Once a query is submitted, the component formats and presents the result.
|
|
2498
|
+
* It is consumed within the `searchcraft-base-search-results` component.
|
|
2499
|
+
*/
|
|
2500
|
+
interface SearchcraftBaseSearchResult {
|
|
2501
|
+
/**
|
|
2502
|
+
* The relationship between the current document and the link for the button rendered when containerHref is not present.
|
|
2503
|
+
*/
|
|
2504
|
+
"buttonRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
2505
|
+
/**
|
|
2506
|
+
* Where to open the link for the button rendered when containerHref is not present.
|
|
2507
|
+
*/
|
|
2508
|
+
"buttonTarget"?: "_blank" | "_self" | "_top" | "_parent";
|
|
2509
|
+
/**
|
|
2510
|
+
* The relationship between the current document and the link for the containing element.
|
|
2511
|
+
*/
|
|
2512
|
+
"containerRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
2513
|
+
/**
|
|
2514
|
+
* Where to open the link for the containing element.
|
|
2515
|
+
*/
|
|
2516
|
+
"containerTarget"?: "_blank" | "_self" | "_top" | "_parent";
|
|
2517
|
+
/**
|
|
2518
|
+
* A custom styles object.
|
|
2519
|
+
*/
|
|
2520
|
+
"customStyles"?: string;
|
|
2521
|
+
/**
|
|
2522
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
2523
|
+
*/
|
|
2524
|
+
"documentPosition"?: number;
|
|
2525
|
+
/**
|
|
2526
|
+
* The placement of the image.
|
|
2527
|
+
*/
|
|
2528
|
+
"imagePlacement"?: "left" | "right";
|
|
2529
|
+
"item"?: SearchClientResponseItem;
|
|
2530
|
+
"searchResultMappings"?: SearchResultMappings;
|
|
2531
|
+
}
|
|
2532
|
+
/**
|
|
2533
|
+
* This web component is responsible for displaying the results of a search query.
|
|
2534
|
+
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
2535
|
+
* ## Usage
|
|
2536
|
+
* ```html
|
|
2537
|
+
* <!-- index.html -->
|
|
2538
|
+
* <searchcraft-base-search-results
|
|
2539
|
+
* ad-interval="4"
|
|
2540
|
+
* place-ad-at-start="false"
|
|
2541
|
+
* result-image-placement="right"
|
|
2542
|
+
* />
|
|
2543
|
+
* ```
|
|
2544
|
+
* ```js
|
|
2545
|
+
* // index.js
|
|
2546
|
+
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
2547
|
+
* baseSearchResults.searchResultMappings = containerHref: {
|
|
2548
|
+
* fieldNames: [
|
|
2549
|
+
* {
|
|
2550
|
+
* fieldName: 'canonical_link',
|
|
2551
|
+
* dataType: 'text',
|
|
2552
|
+
* },
|
|
2553
|
+
* ],
|
|
2554
|
+
* };
|
|
2555
|
+
* baseSearchResults.addEventListener('noResults', () => {
|
|
2556
|
+
* console.log('No search results found');
|
|
2557
|
+
* });
|
|
2558
|
+
* ```
|
|
2559
|
+
*/
|
|
2560
|
+
interface SearchcraftBaseSearchResults {
|
|
2561
|
+
/**
|
|
2562
|
+
* The label for the button rendered when containerHref is not present for each result.
|
|
2563
|
+
*/
|
|
2564
|
+
"buttonLabel"?: string;
|
|
2565
|
+
/**
|
|
2566
|
+
* The relationship between the current document and the link for the button rendered when containerHref is not present for each result.
|
|
2567
|
+
*/
|
|
2568
|
+
"buttonRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
2569
|
+
/**
|
|
2570
|
+
* Where to open the link for the button rendered when containerHref is not present for each result.
|
|
2571
|
+
*/
|
|
2572
|
+
"buttonTarget"?: "_blank" | "_self" | "_top" | "_parent";
|
|
2573
|
+
/**
|
|
2574
|
+
* The relationship between the current document and the link for the containing element for each result.
|
|
2575
|
+
*/
|
|
2576
|
+
"containerRel"?: "noreferrer" | "noopener" | "nofollow";
|
|
2577
|
+
/**
|
|
2578
|
+
* Where to open the link for the containing element for each result.
|
|
2579
|
+
*/
|
|
2580
|
+
"containerTarget"?: "_blank" | "_self" | "_top" | "_parent";
|
|
2581
|
+
/**
|
|
2582
|
+
* A custom styles object.
|
|
2583
|
+
*/
|
|
2584
|
+
"customStylesForResults"?: string | Record<string, Record<string, string>>;
|
|
2585
|
+
/**
|
|
2586
|
+
* The placement of the image for each result.
|
|
2587
|
+
*/
|
|
2588
|
+
"resultImagePlacement"?: "left" | "right";
|
|
2589
|
+
/**
|
|
2590
|
+
* Formats the content rendered for each result.
|
|
2591
|
+
*/
|
|
2592
|
+
"searchResultMappings"?: SearchResultMappings;
|
|
2593
|
+
}
|
|
2594
|
+
/**
|
|
2595
|
+
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
2596
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
2597
|
+
* It is consumed within the `searchcraft-input-form` component.
|
|
2598
|
+
*/
|
|
2599
|
+
interface SearchcraftButton {
|
|
2600
|
+
/**
|
|
2601
|
+
* Whether the button is disabled.
|
|
2602
|
+
*/
|
|
2603
|
+
"disabled"?: boolean;
|
|
2604
|
+
/**
|
|
2605
|
+
* Controls the visual representation of the button.
|
|
2606
|
+
*/
|
|
2607
|
+
"hierarchy"?: "primary" | "tertiary";
|
|
2608
|
+
/**
|
|
2609
|
+
* The icon element.
|
|
2610
|
+
*/
|
|
2611
|
+
"icon"?: Element;
|
|
2612
|
+
/**
|
|
2613
|
+
* Should the button only display an icon.
|
|
2614
|
+
*/
|
|
2615
|
+
"iconOnly"?: boolean;
|
|
2616
|
+
/**
|
|
2617
|
+
* The position of the icon.
|
|
2618
|
+
*/
|
|
2619
|
+
"iconPosition"?: "left" | "right";
|
|
2620
|
+
/**
|
|
2621
|
+
* The label for the button.
|
|
2622
|
+
*/
|
|
2623
|
+
"label"?: string;
|
|
2624
|
+
/**
|
|
2625
|
+
* The event fired when the button is clicked.
|
|
2626
|
+
*/
|
|
2627
|
+
"onButtonClick"?: (event: SearchcraftButtonCustomEvent<void>) => void;
|
|
2628
|
+
/**
|
|
2629
|
+
* The type of the button.
|
|
2630
|
+
*/
|
|
2631
|
+
"type"?: "submit" | "reset" | "button";
|
|
2632
|
+
}
|
|
2633
|
+
/**
|
|
2634
|
+
* 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.
|
|
2635
|
+
* ## Usage
|
|
2636
|
+
* ```html
|
|
2637
|
+
* <!-- index.html -->
|
|
2638
|
+
* <searchcraft-error-message error-message="No search results found for query" />
|
|
2639
|
+
* ```
|
|
2640
|
+
*/
|
|
2641
|
+
interface SearchcraftErrorMessage {
|
|
2642
|
+
/**
|
|
2643
|
+
* The error message.
|
|
2644
|
+
*/
|
|
2645
|
+
"errorMessage"?: string;
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* 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.
|
|
2649
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
2650
|
+
* ## Usage
|
|
2651
|
+
* ```html
|
|
2652
|
+
* <!-- index.html -->
|
|
2653
|
+
* <searchcraft-facet-list field-name="title" />
|
|
2654
|
+
* ```
|
|
2655
|
+
* ```js
|
|
2656
|
+
* // index.js
|
|
2657
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
2658
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
2659
|
+
* console.log('Facet selection updated');
|
|
2660
|
+
* });
|
|
2661
|
+
* ```
|
|
2662
|
+
*/
|
|
2663
|
+
interface SearchcraftFacetList {
|
|
2664
|
+
/**
|
|
2665
|
+
* The name of the field where facets are applied.
|
|
2666
|
+
*/
|
|
2667
|
+
"fieldName"?: string;
|
|
2668
|
+
/**
|
|
2669
|
+
* When the facets are updated.
|
|
2670
|
+
*/
|
|
2671
|
+
"onFacetSelectionUpdated"?: (event: SearchcraftFacetListCustomEvent<{
|
|
2672
|
+
paths: string[];
|
|
2673
|
+
}>) => void;
|
|
2674
|
+
}
|
|
2675
|
+
/**
|
|
2676
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
2677
|
+
* ## Usage
|
|
2678
|
+
* ```html
|
|
2679
|
+
* <!-- index.html -->
|
|
2680
|
+
* <searchcraft-filter-panel />
|
|
2681
|
+
* ```
|
|
2682
|
+
*/
|
|
2683
|
+
interface SearchcraftFilterPanel {
|
|
2684
|
+
/**
|
|
2685
|
+
* The items to filter.
|
|
2686
|
+
*/
|
|
2687
|
+
"items"?: FilterItem[];
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
2691
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
2692
|
+
* ## Usage
|
|
2693
|
+
* ```html
|
|
2694
|
+
* <!-- index.html -->
|
|
2695
|
+
* <searchcraft-input-form placeholder-value="Search here" />
|
|
2696
|
+
* ```
|
|
2697
|
+
* ```js
|
|
2698
|
+
* // index.js
|
|
2699
|
+
* const searchInputForm = document.querySelector('searchcraft-input-form');
|
|
2700
|
+
* ```
|
|
2701
|
+
*/
|
|
2702
|
+
interface SearchcraftInputForm {
|
|
2703
|
+
/**
|
|
2704
|
+
* Whether or not to automatically submit the search term when the input changes.
|
|
2705
|
+
*/
|
|
2706
|
+
"autoSearch"?: boolean;
|
|
2707
|
+
/**
|
|
2708
|
+
* The label for the submit button.
|
|
2709
|
+
*/
|
|
2710
|
+
"buttonLabel"?: string;
|
|
2711
|
+
/**
|
|
2712
|
+
* Where to place the search button.
|
|
2713
|
+
*/
|
|
2714
|
+
"buttonPlacement"?: "left" | "right" | "none";
|
|
2715
|
+
"core"?: SearchcraftCore;
|
|
2716
|
+
/**
|
|
2717
|
+
* A custom styles object to be applied to the input element.
|
|
2718
|
+
*/
|
|
2719
|
+
"customStyles"?: string | Record<string, string>;
|
|
2720
|
+
/**
|
|
2721
|
+
* The label rendered above the input.
|
|
2722
|
+
*/
|
|
2723
|
+
"inputLabel"?: string;
|
|
2724
|
+
/**
|
|
2725
|
+
* When the input becomes unfocused.
|
|
2726
|
+
*/
|
|
2727
|
+
"onInputBlur"?: (event: SearchcraftInputFormCustomEvent<void>) => void;
|
|
2728
|
+
/**
|
|
2729
|
+
* When the input becomes focused.
|
|
2730
|
+
*/
|
|
2731
|
+
"onInputFocus"?: (event: SearchcraftInputFormCustomEvent<void>) => void;
|
|
2732
|
+
/**
|
|
2733
|
+
* Event emitted when input initializes.
|
|
2734
|
+
*/
|
|
2735
|
+
"onInputInit"?: (event: SearchcraftInputFormCustomEvent<void>) => void;
|
|
2736
|
+
/**
|
|
2737
|
+
* The input element's placeholder value.
|
|
2738
|
+
*/
|
|
2739
|
+
"placeholderValue"?: string;
|
|
2740
|
+
}
|
|
2741
|
+
/**
|
|
2742
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
2743
|
+
* ## Usage
|
|
2744
|
+
* ```html
|
|
2745
|
+
* <!-- index.html -->
|
|
2746
|
+
* <searchcraft-input-label label="Search" />
|
|
2747
|
+
* ```
|
|
2748
|
+
*/
|
|
2749
|
+
interface SearchcraftInputLabel {
|
|
2750
|
+
/**
|
|
2751
|
+
* The classname applied to the label element.
|
|
2752
|
+
*/
|
|
2753
|
+
"inputLabelClassName"?: string | undefined;
|
|
2754
|
+
"label"?: string;
|
|
2755
|
+
}
|
|
2756
|
+
/**
|
|
2757
|
+
* This web component is designed to facilitate pagination of search results.
|
|
2758
|
+
* Once a query is submitted, calculates the number for pages.
|
|
2759
|
+
* ## Usage
|
|
2760
|
+
* ```html
|
|
2761
|
+
* <!-- index.html -->
|
|
2762
|
+
* <searchcraft-pagination />
|
|
2763
|
+
* ```
|
|
2764
|
+
*/
|
|
2765
|
+
interface SearchcraftPagination {
|
|
2766
|
+
/**
|
|
2767
|
+
* The custom styles object.
|
|
2768
|
+
*/
|
|
2769
|
+
"customStyles"?: string;
|
|
2770
|
+
}
|
|
2771
|
+
/**
|
|
2772
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
2773
|
+
*/
|
|
2774
|
+
interface SearchcraftPopoverButton {
|
|
2775
|
+
}
|
|
2776
|
+
/**
|
|
2777
|
+
* 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.
|
|
2778
|
+
* ## Usage
|
|
2779
|
+
* ```html
|
|
2780
|
+
* <!-- index.html -->
|
|
2781
|
+
* <searchcraft-popover-form type="fullscreen" />
|
|
2782
|
+
* ```
|
|
2783
|
+
* ```js
|
|
2784
|
+
* // index.js
|
|
2785
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
2786
|
+
* popoverForm.popoverResultMappings = {
|
|
2787
|
+
* containerHref: {
|
|
2788
|
+
* fieldNames: [
|
|
2789
|
+
* {
|
|
2790
|
+
* fieldName: 'canonical_link',
|
|
2791
|
+
* dataType: 'text',
|
|
2792
|
+
* },
|
|
2793
|
+
* ],
|
|
2794
|
+
* };
|
|
2795
|
+
* ```
|
|
2796
|
+
*/
|
|
2797
|
+
interface SearchcraftPopoverForm {
|
|
2798
|
+
/**
|
|
2799
|
+
* The hotkey that activates the popover.
|
|
2800
|
+
*/
|
|
2801
|
+
"hotkey"?: string;
|
|
2802
|
+
/**
|
|
2803
|
+
* The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
|
|
2804
|
+
*/
|
|
2805
|
+
"hotkeyModifier"?: "ctrl" | "meta" | "alt" | "option";
|
|
2806
|
+
/**
|
|
2807
|
+
* Formats the content rendered for each result.
|
|
2808
|
+
*/
|
|
2809
|
+
"popoverResultMappings"?: PopoverResultMappings;
|
|
2810
|
+
/**
|
|
2811
|
+
* 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.
|
|
2812
|
+
*/
|
|
2813
|
+
"type"?: "inline" | "fullscreen" | "modal";
|
|
2814
|
+
}
|
|
2815
|
+
/**
|
|
2816
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
2817
|
+
*/
|
|
2818
|
+
interface SearchcraftPopoverListItem {
|
|
2819
|
+
/**
|
|
2820
|
+
* The document position relative to the search results (For Measure)
|
|
2821
|
+
*/
|
|
2822
|
+
"documentPosition"?: number;
|
|
2823
|
+
"item"?: SearchClientResponseItem | undefined;
|
|
2824
|
+
"popoverResultMappings"?: PopoverResultMappings | undefined;
|
|
2825
|
+
}
|
|
2826
|
+
/**
|
|
2827
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
2828
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
2829
|
+
* ## Usage
|
|
2830
|
+
* ```html
|
|
2831
|
+
* <!-- index.html -->
|
|
2832
|
+
* <searchcraft-popover-list-view />
|
|
2833
|
+
* ```
|
|
2834
|
+
*/
|
|
2835
|
+
interface SearchcraftPopoverListView {
|
|
2836
|
+
"adClientResponseItems"?: AdClientResponseItem[] | undefined;
|
|
2837
|
+
/**
|
|
2838
|
+
* The mappings that define how the data in the documents are mapped to the list-view-item elements.
|
|
2839
|
+
*/
|
|
2840
|
+
"popoverResultMappings"?: PopoverResultMappings | undefined;
|
|
2841
|
+
/**
|
|
2842
|
+
* The items to render in the list view.
|
|
2843
|
+
*/
|
|
2844
|
+
"searchClientResponseItems"?: SearchClientResponseItem[] | undefined;
|
|
2845
|
+
"searchResultsPage": number;
|
|
2846
|
+
"searchResultsPerPage": number;
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
2850
|
+
* ## Usage
|
|
2851
|
+
* ```html
|
|
2852
|
+
* <!-- index.html -->
|
|
2853
|
+
* <script>
|
|
2854
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
2855
|
+
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
2856
|
+
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
2857
|
+
* </script>
|
|
2858
|
+
* <searchcraft-results-info />
|
|
2859
|
+
* ```
|
|
2860
|
+
*/
|
|
2861
|
+
interface SearchcraftResultsInfo {
|
|
2862
|
+
/**
|
|
2863
|
+
* The custom formatter for the resulting string.
|
|
2864
|
+
* @example ```ts resultsInfo.customFormatter = (range, count, responseTime) => `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`; ```
|
|
2865
|
+
*/
|
|
2866
|
+
"customFormatter"?: (range: [
|
|
2867
|
+
string,
|
|
2868
|
+
string
|
|
2869
|
+
], count: string, responseTime: string) => void;
|
|
2870
|
+
/**
|
|
2871
|
+
* The custom styles object.
|
|
2872
|
+
*/
|
|
2873
|
+
"customStyles"?: string;
|
|
2874
|
+
}
|
|
2875
|
+
/**
|
|
2876
|
+
* This web component is designed to choose the number of search results displayed.
|
|
2877
|
+
* ## Usage
|
|
2878
|
+
* ```html
|
|
2879
|
+
* <!-- index.html -->
|
|
2880
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
2881
|
+
* ```
|
|
2882
|
+
*/
|
|
2883
|
+
interface SearchcraftSearchResultsPerPage {
|
|
2884
|
+
/**
|
|
2885
|
+
* The custom styles object.
|
|
2886
|
+
*/
|
|
2887
|
+
"customStyles"?: string;
|
|
2888
|
+
/**
|
|
2889
|
+
* 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.
|
|
2890
|
+
*/
|
|
2891
|
+
"increment"?: string | number;
|
|
2892
|
+
}
|
|
2893
|
+
/**
|
|
2894
|
+
* This web component is designed to allow users to select between a group of options.
|
|
2895
|
+
* ## Usage
|
|
2896
|
+
* ```html
|
|
2897
|
+
* <!-- index.html -->
|
|
2898
|
+
* <searchcraft-select
|
|
2899
|
+
* inputId="searchcraft-select"
|
|
2900
|
+
* name="searchcraft-select"
|
|
2901
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
2902
|
+
* />
|
|
2903
|
+
* ```
|
|
2904
|
+
*/
|
|
2905
|
+
interface SearchcraftSelect {
|
|
2906
|
+
/**
|
|
2907
|
+
* The caption displayed below the select input.
|
|
2908
|
+
*/
|
|
2909
|
+
"caption"?: string;
|
|
2910
|
+
/**
|
|
2911
|
+
* A custom styles object.
|
|
2912
|
+
*/
|
|
2913
|
+
"customStyles"?: string;
|
|
2914
|
+
/**
|
|
2915
|
+
* Whether the select input is disabled.
|
|
2916
|
+
*/
|
|
2917
|
+
"disabled"?: boolean;
|
|
2918
|
+
/**
|
|
2919
|
+
* The ID for the select input.
|
|
2920
|
+
*/
|
|
2921
|
+
"inputId": string;
|
|
2922
|
+
/**
|
|
2923
|
+
* The label of the select input.
|
|
2924
|
+
*/
|
|
2925
|
+
"label"?: string;
|
|
2926
|
+
/**
|
|
2927
|
+
* The ID for the label of the select input.
|
|
2928
|
+
*/
|
|
2929
|
+
"labelId"?: string;
|
|
2930
|
+
/**
|
|
2931
|
+
* The name of the select input.
|
|
2932
|
+
*/
|
|
2933
|
+
"name": string;
|
|
2934
|
+
/**
|
|
2935
|
+
* The event fired when the select is changed.
|
|
2936
|
+
*/
|
|
2937
|
+
"onSelectChange"?: (event: SearchcraftSelectCustomEvent<string>) => void;
|
|
2938
|
+
/**
|
|
2939
|
+
* The options for the select input.
|
|
2940
|
+
*/
|
|
2941
|
+
"options"?: SearchcraftSelectOption[] | string;
|
|
2942
|
+
}
|
|
2943
|
+
/**
|
|
2944
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
2945
|
+
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
2946
|
+
* It is consumed by the `searchcraft-filter-panel` component.
|
|
2947
|
+
*/
|
|
2948
|
+
interface SearchcraftSlider {
|
|
2949
|
+
/**
|
|
2950
|
+
* The type of data allowed.
|
|
2951
|
+
*/
|
|
2952
|
+
"dataType"?: "number" | "date";
|
|
2953
|
+
/**
|
|
2954
|
+
* The granularity that the value must adhere to.
|
|
2955
|
+
*/
|
|
2956
|
+
"granularity"?: number;
|
|
2957
|
+
/**
|
|
2958
|
+
* The maximum value allowed.
|
|
2959
|
+
*/
|
|
2960
|
+
"max"?: number;
|
|
2961
|
+
/**
|
|
2962
|
+
* The minimum value allowed.
|
|
2963
|
+
*/
|
|
2964
|
+
"min"?: number;
|
|
2965
|
+
/**
|
|
2966
|
+
* When the range has changed.
|
|
2967
|
+
*/
|
|
2968
|
+
"onRangeChanged"?: (event: SearchcraftSliderCustomEvent<any>) => void;
|
|
2969
|
+
}
|
|
2970
|
+
/**
|
|
2971
|
+
* This web component adds Searchcraft's built-in css theme to your page's <head> tag.
|
|
2972
|
+
* It does not render anything visible, its only function is to manage the css styles on the page.
|
|
2973
|
+
* ## Usage
|
|
2974
|
+
* ```html
|
|
2975
|
+
* <!-- index.html -->
|
|
2976
|
+
* <searchcraft-theme theme="light" custom-theme="{}" />
|
|
2977
|
+
* ```
|
|
2978
|
+
*/
|
|
2979
|
+
interface SearchcraftTheme {
|
|
2980
|
+
/**
|
|
2981
|
+
* The custom theme configuration object.
|
|
2982
|
+
*/
|
|
2983
|
+
"customTheme"?: string;
|
|
2984
|
+
/**
|
|
2985
|
+
* The name of the theme.
|
|
2986
|
+
*/
|
|
2987
|
+
"theme"?: string;
|
|
2988
|
+
}
|
|
2989
|
+
/**
|
|
2990
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
2991
|
+
* It is consumed within the `searchcraft-filter-panel` component.
|
|
2992
|
+
*/
|
|
2993
|
+
interface SearchcraftToggleButton {
|
|
2994
|
+
/**
|
|
2995
|
+
* The label.
|
|
2996
|
+
*/
|
|
2997
|
+
"label"?: string;
|
|
2998
|
+
/**
|
|
2999
|
+
* When the toggle element is changed.
|
|
3000
|
+
*/
|
|
3001
|
+
"onToggleUpdated"?: (event: SearchcraftToggleButtonCustomEvent<boolean>) => void;
|
|
3002
|
+
/**
|
|
3003
|
+
* The secondary label displayed below the main label.
|
|
3004
|
+
*/
|
|
3005
|
+
"subLabel"?: string | undefined;
|
|
3006
|
+
}
|
|
3007
|
+
interface IntrinsicElements {
|
|
3008
|
+
"searchcraft-ad": SearchcraftAd;
|
|
3009
|
+
"searchcraft-base-search-result": SearchcraftBaseSearchResult;
|
|
3010
|
+
"searchcraft-base-search-results": SearchcraftBaseSearchResults;
|
|
3011
|
+
"searchcraft-button": SearchcraftButton;
|
|
3012
|
+
"searchcraft-error-message": SearchcraftErrorMessage;
|
|
3013
|
+
"searchcraft-facet-list": SearchcraftFacetList;
|
|
3014
|
+
"searchcraft-filter-panel": SearchcraftFilterPanel;
|
|
3015
|
+
"searchcraft-input-form": SearchcraftInputForm;
|
|
3016
|
+
"searchcraft-input-label": SearchcraftInputLabel;
|
|
3017
|
+
"searchcraft-pagination": SearchcraftPagination;
|
|
3018
|
+
"searchcraft-popover-button": SearchcraftPopoverButton;
|
|
3019
|
+
"searchcraft-popover-form": SearchcraftPopoverForm;
|
|
3020
|
+
"searchcraft-popover-list-item": SearchcraftPopoverListItem;
|
|
3021
|
+
"searchcraft-popover-list-view": SearchcraftPopoverListView;
|
|
3022
|
+
"searchcraft-results-info": SearchcraftResultsInfo;
|
|
3023
|
+
"searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
|
|
3024
|
+
"searchcraft-select": SearchcraftSelect;
|
|
3025
|
+
"searchcraft-slider": SearchcraftSlider;
|
|
3026
|
+
"searchcraft-theme": SearchcraftTheme;
|
|
3027
|
+
"searchcraft-toggle-button": SearchcraftToggleButton;
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
declare module "@stencil/core" {
|
|
3031
|
+
export namespace JSX {
|
|
3032
|
+
interface IntrinsicElements {
|
|
3033
|
+
/**
|
|
3034
|
+
* An inline ad meant to be rendered in a list of search results.
|
|
3035
|
+
*/
|
|
3036
|
+
"searchcraft-ad": LocalJSX.SearchcraftAd & JSXBase.HTMLAttributes<HTMLSearchcraftAdElement>;
|
|
3037
|
+
/**
|
|
3038
|
+
* This web component is designed to display detailed information for a single search result.
|
|
3039
|
+
* Once a query is submitted, the component formats and presents the result.
|
|
3040
|
+
* It is consumed within the `searchcraft-base-search-results` component.
|
|
3041
|
+
*/
|
|
3042
|
+
"searchcraft-base-search-result": LocalJSX.SearchcraftBaseSearchResult & JSXBase.HTMLAttributes<HTMLSearchcraftBaseSearchResultElement>;
|
|
3043
|
+
/**
|
|
3044
|
+
* This web component is responsible for displaying the results of a search query.
|
|
3045
|
+
* Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
3046
|
+
* ## Usage
|
|
3047
|
+
* ```html
|
|
3048
|
+
* <!-- index.html -->
|
|
3049
|
+
* <searchcraft-base-search-results
|
|
3050
|
+
* ad-interval="4"
|
|
3051
|
+
* place-ad-at-start="false"
|
|
3052
|
+
* result-image-placement="right"
|
|
3053
|
+
* />
|
|
3054
|
+
* ```
|
|
3055
|
+
* ```js
|
|
3056
|
+
* // index.js
|
|
3057
|
+
* const baseSearchResults = document.querySelector('searchcraft-base-search-results');
|
|
3058
|
+
* baseSearchResults.searchResultMappings = containerHref: {
|
|
3059
|
+
* fieldNames: [
|
|
3060
|
+
* {
|
|
3061
|
+
* fieldName: 'canonical_link',
|
|
3062
|
+
* dataType: 'text',
|
|
3063
|
+
* },
|
|
3064
|
+
* ],
|
|
3065
|
+
* };
|
|
3066
|
+
* baseSearchResults.addEventListener('noResults', () => {
|
|
3067
|
+
* console.log('No search results found');
|
|
3068
|
+
* });
|
|
3069
|
+
* ```
|
|
3070
|
+
*/
|
|
3071
|
+
"searchcraft-base-search-results": LocalJSX.SearchcraftBaseSearchResults & JSXBase.HTMLAttributes<HTMLSearchcraftBaseSearchResultsElement>;
|
|
3072
|
+
/**
|
|
3073
|
+
* This web component represents a button to be consumed within the `search-input-form` component.
|
|
3074
|
+
* It provides a clear, interactive way for users to submit search queries or trigger actions in a search interface.
|
|
3075
|
+
* It is consumed within the `searchcraft-input-form` component.
|
|
3076
|
+
*/
|
|
3077
|
+
"searchcraft-button": LocalJSX.SearchcraftButton & JSXBase.HTMLAttributes<HTMLSearchcraftButtonElement>;
|
|
3078
|
+
/**
|
|
3079
|
+
* 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.
|
|
3080
|
+
* ## Usage
|
|
3081
|
+
* ```html
|
|
3082
|
+
* <!-- index.html -->
|
|
3083
|
+
* <searchcraft-error-message error-message="No search results found for query" />
|
|
3084
|
+
* ```
|
|
3085
|
+
*/
|
|
3086
|
+
"searchcraft-error-message": LocalJSX.SearchcraftErrorMessage & JSXBase.HTMLAttributes<HTMLSearchcraftErrorMessageElement>;
|
|
3087
|
+
/**
|
|
3088
|
+
* 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.
|
|
3089
|
+
* It is consumed within the `searchcraft-filter-panel`.
|
|
3090
|
+
* ## Usage
|
|
3091
|
+
* ```html
|
|
3092
|
+
* <!-- index.html -->
|
|
3093
|
+
* <searchcraft-facet-list field-name="title" />
|
|
3094
|
+
* ```
|
|
3095
|
+
* ```js
|
|
3096
|
+
* // index.js
|
|
3097
|
+
* const facetList = document.querySelector('searchcraft-facet-list');
|
|
3098
|
+
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
3099
|
+
* console.log('Facet selection updated');
|
|
3100
|
+
* });
|
|
3101
|
+
* ```
|
|
3102
|
+
*/
|
|
3103
|
+
"searchcraft-facet-list": LocalJSX.SearchcraftFacetList & JSXBase.HTMLAttributes<HTMLSearchcraftFacetListElement>;
|
|
3104
|
+
/**
|
|
3105
|
+
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
3106
|
+
* ## Usage
|
|
3107
|
+
* ```html
|
|
3108
|
+
* <!-- index.html -->
|
|
3109
|
+
* <searchcraft-filter-panel />
|
|
3110
|
+
* ```
|
|
3111
|
+
*/
|
|
3112
|
+
"searchcraft-filter-panel": LocalJSX.SearchcraftFilterPanel & JSXBase.HTMLAttributes<HTMLSearchcraftFilterPanelElement>;
|
|
3113
|
+
/**
|
|
3114
|
+
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
3115
|
+
* It abstracts the complexities of index-based searching, making it accessible to users of all technical levels.
|
|
3116
|
+
* ## Usage
|
|
3117
|
+
* ```html
|
|
3118
|
+
* <!-- index.html -->
|
|
3119
|
+
* <searchcraft-input-form placeholder-value="Search here" />
|
|
3120
|
+
* ```
|
|
3121
|
+
* ```js
|
|
3122
|
+
* // index.js
|
|
3123
|
+
* const searchInputForm = document.querySelector('searchcraft-input-form');
|
|
3124
|
+
* ```
|
|
3125
|
+
*/
|
|
3126
|
+
"searchcraft-input-form": LocalJSX.SearchcraftInputForm & JSXBase.HTMLAttributes<HTMLSearchcraftInputFormElement>;
|
|
3127
|
+
/**
|
|
3128
|
+
* This web component serves as the input label for the searchcraft-input-form component.
|
|
3129
|
+
* ## Usage
|
|
3130
|
+
* ```html
|
|
3131
|
+
* <!-- index.html -->
|
|
3132
|
+
* <searchcraft-input-label label="Search" />
|
|
3133
|
+
* ```
|
|
3134
|
+
*/
|
|
3135
|
+
"searchcraft-input-label": LocalJSX.SearchcraftInputLabel & JSXBase.HTMLAttributes<HTMLSearchcraftInputLabelElement>;
|
|
3136
|
+
/**
|
|
3137
|
+
* This web component is designed to facilitate pagination of search results.
|
|
3138
|
+
* Once a query is submitted, calculates the number for pages.
|
|
3139
|
+
* ## Usage
|
|
3140
|
+
* ```html
|
|
3141
|
+
* <!-- index.html -->
|
|
3142
|
+
* <searchcraft-pagination />
|
|
3143
|
+
* ```
|
|
3144
|
+
*/
|
|
3145
|
+
"searchcraft-pagination": LocalJSX.SearchcraftPagination & JSXBase.HTMLAttributes<HTMLSearchcraftPaginationElement>;
|
|
3146
|
+
/**
|
|
3147
|
+
* Renders a button which, when clicked, turns on popover visibility.
|
|
3148
|
+
*/
|
|
3149
|
+
"searchcraft-popover-button": LocalJSX.SearchcraftPopoverButton & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverButtonElement>;
|
|
3150
|
+
/**
|
|
3151
|
+
* 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.
|
|
3152
|
+
* ## Usage
|
|
3153
|
+
* ```html
|
|
3154
|
+
* <!-- index.html -->
|
|
3155
|
+
* <searchcraft-popover-form type="fullscreen" />
|
|
3156
|
+
* ```
|
|
3157
|
+
* ```js
|
|
3158
|
+
* // index.js
|
|
3159
|
+
* const popoverForm = document.querySelector('searchcraft-popover-form');
|
|
3160
|
+
* popoverForm.popoverResultMappings = {
|
|
3161
|
+
* containerHref: {
|
|
3162
|
+
* fieldNames: [
|
|
3163
|
+
* {
|
|
3164
|
+
* fieldName: 'canonical_link',
|
|
3165
|
+
* dataType: 'text',
|
|
3166
|
+
* },
|
|
3167
|
+
* ],
|
|
3168
|
+
* };
|
|
3169
|
+
* ```
|
|
3170
|
+
*/
|
|
3171
|
+
"searchcraft-popover-form": LocalJSX.SearchcraftPopoverForm & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverFormElement>;
|
|
3172
|
+
/**
|
|
3173
|
+
* A single list item rendered in a searchcraft-popover-list-view.
|
|
3174
|
+
*/
|
|
3175
|
+
"searchcraft-popover-list-item": LocalJSX.SearchcraftPopoverListItem & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverListItemElement>;
|
|
3176
|
+
/**
|
|
3177
|
+
* This web component is designed to display a list of results within a popover interface.
|
|
3178
|
+
* It is consumed within the `searchcraft-popover-form` component.
|
|
3179
|
+
* ## Usage
|
|
3180
|
+
* ```html
|
|
3181
|
+
* <!-- index.html -->
|
|
3182
|
+
* <searchcraft-popover-list-view />
|
|
3183
|
+
* ```
|
|
3184
|
+
*/
|
|
3185
|
+
"searchcraft-popover-list-view": LocalJSX.SearchcraftPopoverListView & JSXBase.HTMLAttributes<HTMLSearchcraftPopoverListViewElement>;
|
|
3186
|
+
/**
|
|
3187
|
+
* This web component is designed to display the number of results returned from a search query.
|
|
3188
|
+
* ## Usage
|
|
3189
|
+
* ```html
|
|
3190
|
+
* <!-- index.html -->
|
|
3191
|
+
* <script>
|
|
3192
|
+
* const resultsInfo = document.querySelector('searchcraft-results-info');
|
|
3193
|
+
* resultsInfo.customFormatter = (range, count, responseTime) =>
|
|
3194
|
+
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
3195
|
+
* </script>
|
|
3196
|
+
* <searchcraft-results-info />
|
|
3197
|
+
* ```
|
|
3198
|
+
*/
|
|
3199
|
+
"searchcraft-results-info": LocalJSX.SearchcraftResultsInfo & JSXBase.HTMLAttributes<HTMLSearchcraftResultsInfoElement>;
|
|
3200
|
+
/**
|
|
3201
|
+
* This web component is designed to choose the number of search results displayed.
|
|
3202
|
+
* ## Usage
|
|
3203
|
+
* ```html
|
|
3204
|
+
* <!-- index.html -->
|
|
3205
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
3206
|
+
* ```
|
|
3207
|
+
*/
|
|
3208
|
+
"searchcraft-search-results-per-page": LocalJSX.SearchcraftSearchResultsPerPage & JSXBase.HTMLAttributes<HTMLSearchcraftSearchResultsPerPageElement>;
|
|
3209
|
+
/**
|
|
3210
|
+
* This web component is designed to allow users to select between a group of options.
|
|
3211
|
+
* ## Usage
|
|
3212
|
+
* ```html
|
|
3213
|
+
* <!-- index.html -->
|
|
3214
|
+
* <searchcraft-select
|
|
3215
|
+
* inputId="searchcraft-select"
|
|
3216
|
+
* name="searchcraft-select"
|
|
3217
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
3218
|
+
* />
|
|
3219
|
+
* ```
|
|
3220
|
+
*/
|
|
3221
|
+
"searchcraft-select": LocalJSX.SearchcraftSelect & JSXBase.HTMLAttributes<HTMLSearchcraftSelectElement>;
|
|
3222
|
+
/**
|
|
3223
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.
|
|
3224
|
+
* The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
3225
|
+
* It is consumed by the `searchcraft-filter-panel` component.
|
|
3226
|
+
*/
|
|
3227
|
+
"searchcraft-slider": LocalJSX.SearchcraftSlider & JSXBase.HTMLAttributes<HTMLSearchcraftSliderElement>;
|
|
3228
|
+
/**
|
|
3229
|
+
* This web component adds Searchcraft's built-in css theme to your page's <head> tag.
|
|
3230
|
+
* It does not render anything visible, its only function is to manage the css styles on the page.
|
|
3231
|
+
* ## Usage
|
|
3232
|
+
* ```html
|
|
3233
|
+
* <!-- index.html -->
|
|
3234
|
+
* <searchcraft-theme theme="light" custom-theme="{}" />
|
|
3235
|
+
* ```
|
|
3236
|
+
*/
|
|
3237
|
+
"searchcraft-theme": LocalJSX.SearchcraftTheme & JSXBase.HTMLAttributes<HTMLSearchcraftThemeElement>;
|
|
3238
|
+
/**
|
|
3239
|
+
* This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.
|
|
3240
|
+
* It is consumed within the `searchcraft-filter-panel` component.
|
|
3241
|
+
*/
|
|
3242
|
+
"searchcraft-toggle-button": LocalJSX.SearchcraftToggleButton & JSXBase.HTMLAttributes<HTMLSearchcraftToggleButtonElement>;
|
|
3243
|
+
}
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
/**
|
|
3247
|
+
* The props for the SearchcraftBaseSearchResults component.
|
|
3248
|
+
*/
|
|
3249
|
+
export interface SearchcraftBaseSearchResultsProps extends Components.SearchcraftBaseSearchResults {
|
|
3250
|
+
}
|
|
3251
|
+
/**
|
|
3252
|
+
* A component that renders a list of search results with customizable styles, layout, and link behavior.
|
|
3253
|
+
*
|
|
3254
|
+
* @example
|
|
3255
|
+
* ```tsx
|
|
3256
|
+
* import React from 'react';
|
|
3257
|
+
* import { SearchcraftBaseSearchResults } from '@searchcraft/react-sdk';
|
|
3258
|
+
* import searchResultMappings from './searchResultMappings';
|
|
3259
|
+
*
|
|
3260
|
+
* const MySearchComponent = () => {
|
|
3261
|
+
* return (
|
|
3262
|
+
* <SearchcraftBaseSearchResults
|
|
3263
|
+
* searchResultMappings={searchResultMappings}
|
|
3264
|
+
* resultImagePlacement="left"
|
|
3265
|
+
* buttonLabel="View More"
|
|
3266
|
+
* buttonTarget="_blank"
|
|
3267
|
+
* buttonRel="noopener"
|
|
3268
|
+
* containerTarget="_self"
|
|
3269
|
+
* containerRel="nofollow"
|
|
3270
|
+
* onNoResults={() => console.log("No search results found")}
|
|
3271
|
+
* />
|
|
3272
|
+
* );
|
|
3273
|
+
* };
|
|
3274
|
+
*
|
|
3275
|
+
* export default MySearchComponent;
|
|
3276
|
+
* ```
|
|
3277
|
+
*/
|
|
3278
|
+
export declare const SearchcraftBaseSearchResults: FC<SearchcraftBaseSearchResultsProps>;
|
|
3279
|
+
/**
|
|
3280
|
+
* The props for the SearchcraftFilterPanel.
|
|
3281
|
+
*/
|
|
3282
|
+
export interface SearchcraftFilterPanelProps extends Components.SearchcraftFilterPanel {
|
|
3283
|
+
}
|
|
3284
|
+
/**
|
|
3285
|
+
* A component that represents a filter panel UI view, allowing users to refine and control their search queries by applying various filter criteria.
|
|
3286
|
+
*
|
|
3287
|
+
* @example
|
|
3288
|
+
* ```tsx
|
|
3289
|
+
* import React from 'react';
|
|
3290
|
+
* import { SearchcraftFilterPanel } from '@searchcraft/react-sdk';
|
|
3291
|
+
* import filterItems from './filterItems';
|
|
3292
|
+
*
|
|
3293
|
+
* const MyFilterComponent = () => {
|
|
3294
|
+
* return (
|
|
3295
|
+
* <SearchcraftFilterPanel items={filterItems} />
|
|
3296
|
+
* );
|
|
3297
|
+
* };
|
|
3298
|
+
*
|
|
3299
|
+
* export default MyFilterComponent;
|
|
3300
|
+
* ```
|
|
3301
|
+
*/
|
|
3302
|
+
export declare const SearchcraftFilterPanel: FC<SearchcraftFilterPanelProps>;
|
|
3303
|
+
/**
|
|
3304
|
+
* The props for the SearchcraftInputForm.
|
|
3305
|
+
*/
|
|
3306
|
+
export interface SearchcraftInputFormProps extends Components.SearchcraftInputForm {
|
|
3307
|
+
}
|
|
3308
|
+
/**
|
|
3309
|
+
* A component that provides a user-friendly interface for querying an indexed dataset,
|
|
3310
|
+
* enabling users to easily search large collections of data. It abstracts the complexities
|
|
3311
|
+
* of index-based searching, making it accessible to users of all technical levels.
|
|
3312
|
+
*
|
|
3313
|
+
* @example
|
|
3314
|
+
* ```tsx
|
|
3315
|
+
* import React from 'react';
|
|
3316
|
+
* import { SearchcraftInputForm } from '@searchcraft/react-sdk';
|
|
3317
|
+
* import searchcraftConfig from './searchcraftConfig';
|
|
3318
|
+
*
|
|
3319
|
+
* const MySearchComponent = () => {
|
|
3320
|
+
* const handleQuerySubmit = (event: CustomEvent<string>) => {
|
|
3321
|
+
* console.log("Query submitted", event.detail);
|
|
3322
|
+
* };
|
|
3323
|
+
*
|
|
3324
|
+
* return (
|
|
3325
|
+
* <SearchcraftInputForm
|
|
3326
|
+
* config={searchcraftConfig}
|
|
3327
|
+
* autoSearch={true}
|
|
3328
|
+
* buttonPlacement="right"
|
|
3329
|
+
* buttonLabel="Search"
|
|
3330
|
+
* inputLabel="Search Database"
|
|
3331
|
+
* customStyles={{ border: "1px solid gray", padding: "5px" }}
|
|
3332
|
+
* placeholderValue="Search here..."
|
|
3333
|
+
* searchTerm=""
|
|
3334
|
+
* onQuerySubmit={handleQuerySubmit}
|
|
3335
|
+
* onInputCleared={() => console.log("Input cleared")}
|
|
3336
|
+
* onNoResultsReceived={() => console.log("No results found")}
|
|
3337
|
+
* onInputFocus={() => console.log("Input focused")}
|
|
3338
|
+
* onInputBlur={() => console.log("Input blurred")}
|
|
3339
|
+
* onInputInit={() => console.log("Input initialized")}
|
|
3340
|
+
* />
|
|
3341
|
+
* );
|
|
3342
|
+
* };
|
|
3343
|
+
*
|
|
3344
|
+
* export default MySearchComponent;
|
|
3345
|
+
* ```
|
|
3346
|
+
*/
|
|
3347
|
+
export declare const SearchcraftInputForm: FC<SearchcraftInputFormProps>;
|
|
3348
|
+
/**
|
|
3349
|
+
* The props for the SearchcraftPopoverButton.
|
|
3350
|
+
*/
|
|
3351
|
+
export interface SearchcraftPopoverButtonProps extends Components.SearchcraftPopoverButton {
|
|
3352
|
+
}
|
|
3353
|
+
/**
|
|
3354
|
+
* A button component that, when clicked, toggles the visibility of a popover.
|
|
3355
|
+
*
|
|
3356
|
+
* @example
|
|
3357
|
+
* ```tsx
|
|
3358
|
+
* import React from 'react';
|
|
3359
|
+
* import { SearchcraftPopoverButton } from '@searchcraft/react-sdk';
|
|
3360
|
+
*
|
|
3361
|
+
* const MyPopoverTrigger = () => {
|
|
3362
|
+
* return (
|
|
3363
|
+
* <SearchcraftPopoverButton>
|
|
3364
|
+
* Open Popover
|
|
3365
|
+
* </SearchcraftPopoverButton>
|
|
3366
|
+
* );
|
|
3367
|
+
* };
|
|
3368
|
+
*
|
|
3369
|
+
* export default MyPopoverTrigger;
|
|
3370
|
+
* ```
|
|
3371
|
+
*/
|
|
3372
|
+
export declare const SearchcraftPopoverButton: FC<SearchcraftPopoverButtonProps>;
|
|
3373
|
+
/**
|
|
3374
|
+
* The props for the SearchcraftPopoverForm component.
|
|
3375
|
+
*/
|
|
3376
|
+
export interface SearchcraftPopoverFormProps extends Components.SearchcraftPopoverForm {
|
|
3377
|
+
}
|
|
3378
|
+
/**
|
|
3379
|
+
* A component that displays search results in a popover container that dynamically appears
|
|
3380
|
+
* when the user interacts with a search input field, or when a popover button is clicked.
|
|
3381
|
+
*
|
|
3382
|
+
* @example
|
|
3383
|
+
* ```tsx
|
|
3384
|
+
* import React from 'react';
|
|
3385
|
+
* import { SearchcraftPopoverForm } from '@searchcraft/react-sdk';
|
|
3386
|
+
* import searchcraftConfig from './searchcraftConfig';
|
|
3387
|
+
* import popoverResultMappings from './popoverResultMappings';
|
|
3388
|
+
*
|
|
3389
|
+
* const MyPopoverSearch = () => {
|
|
3390
|
+
* return (
|
|
3391
|
+
* <SearchcraftPopoverForm
|
|
3392
|
+
* config={searchcraftConfig}
|
|
3393
|
+
* type="fullscreen"
|
|
3394
|
+
* popoverResultMappings={popoverResultMappings}
|
|
3395
|
+
* hotkey="k"
|
|
3396
|
+
* hotkeyModifier="meta"
|
|
3397
|
+
* />
|
|
3398
|
+
* );
|
|
3399
|
+
* };
|
|
3400
|
+
*
|
|
3401
|
+
* export default MyPopoverSearch;
|
|
3402
|
+
* ```
|
|
3403
|
+
*/
|
|
3404
|
+
export declare const SearchcraftPopoverForm: FC<SearchcraftPopoverFormProps>;
|
|
3405
|
+
/**
|
|
3406
|
+
* The Props for the SearchcraftResultsInfo component.
|
|
3407
|
+
*/
|
|
3408
|
+
export interface SearchcraftResultsInfoProps extends Components.SearchcraftResultsInfo {
|
|
3409
|
+
}
|
|
3410
|
+
/**
|
|
3411
|
+
* This React component is designed to display the number of results returned from a search query.
|
|
3412
|
+
*
|
|
3413
|
+
* @example
|
|
3414
|
+
* ```tsx
|
|
3415
|
+
* import React, { useEffect, useRef } from 'react';
|
|
3416
|
+
* import { SearchcraftResultsInfo } from '@searchcraft/react-sdk';
|
|
3417
|
+
*
|
|
3418
|
+
* const MyResultsInfo = () => {
|
|
3419
|
+
* const ref = useRef();
|
|
3420
|
+
*
|
|
3421
|
+
* useEffect(() => {
|
|
3422
|
+
* ref.current.customFormatter = (range, count, responseTime) =>
|
|
3423
|
+
* `${range[0]}-${range[1]} of ${count} results in ${responseTime}ms`;
|
|
3424
|
+
* });
|
|
3425
|
+
*
|
|
3426
|
+
* return <SearchcraftResultsInfo ref={ref} />;
|
|
3427
|
+
* };
|
|
3428
|
+
*
|
|
3429
|
+
* export default MyResultsInfo;
|
|
3430
|
+
* ```
|
|
3431
|
+
*/
|
|
3432
|
+
export declare const SearchcraftResultsInfo: FC<SearchcraftResultsInfoProps>;
|
|
3433
|
+
/**
|
|
3434
|
+
* The Props for the SearchcraftTheme component.
|
|
3435
|
+
*/
|
|
3436
|
+
export interface SearchcraftThemeProps extends Components.SearchcraftTheme {
|
|
3437
|
+
}
|
|
3438
|
+
/**
|
|
3439
|
+
* A component that applies Searchcraft's built-in CSS theme to your page.
|
|
3440
|
+
* It does not render anything visible—its only function is to manage the CSS styles on the page.
|
|
3441
|
+
*
|
|
3442
|
+
* @example
|
|
3443
|
+
* ```tsx
|
|
3444
|
+
* import React from 'react';
|
|
3445
|
+
* import { SearchcraftTheme } from '@searchcraft/react-sdk';
|
|
3446
|
+
*
|
|
3447
|
+
* const MyThemeProvider = () => {
|
|
3448
|
+
* return <SearchcraftTheme theme="light" customTheme={'[]'} />;
|
|
3449
|
+
* };
|
|
3450
|
+
*
|
|
3451
|
+
* export default MyThemeProvider;
|
|
3452
|
+
* ```
|
|
3453
|
+
*/
|
|
3454
|
+
export declare const SearchcraftTheme: FC<SearchcraftThemeProps>;
|
|
3455
|
+
/**
|
|
3456
|
+
* The props for the SearchcraftPagination component.
|
|
3457
|
+
*/
|
|
3458
|
+
export interface SearchcraftPaginationProps extends Components.SearchcraftPagination {
|
|
3459
|
+
}
|
|
3460
|
+
/**
|
|
3461
|
+
* This React component is designed to facilitate pagination of search results.
|
|
3462
|
+
* Once a query is submitted, calculates the number for pages.
|
|
3463
|
+
*
|
|
3464
|
+
* @example
|
|
3465
|
+
* ```tsx
|
|
3466
|
+
* import React from 'react';
|
|
3467
|
+
* import { SearchcraftPagination } from '@searchcraft/react-sdk';
|
|
3468
|
+
*
|
|
3469
|
+
* const MyPaginationComponent = () => {
|
|
3470
|
+
* return (
|
|
3471
|
+
* // other searchcraft components
|
|
3472
|
+
* <SearchcraftPagination />
|
|
3473
|
+
* );
|
|
3474
|
+
* };
|
|
3475
|
+
*
|
|
3476
|
+
* export default MyPaginationComponent;
|
|
3477
|
+
* ```
|
|
3478
|
+
*/
|
|
3479
|
+
export declare const SearchcraftPagination: FC<SearchcraftPaginationProps>;
|
|
3480
|
+
/**
|
|
3481
|
+
* The Props for the SearchcraftSearchResultsPerPage component.
|
|
3482
|
+
*/
|
|
3483
|
+
export interface SearchcraftSearchResultsPerPageProps extends Components.SearchcraftSearchResultsPerPage {
|
|
3484
|
+
}
|
|
3485
|
+
/**
|
|
3486
|
+
* This React component is designed to choose the number of search results displayed.
|
|
3487
|
+
*
|
|
3488
|
+
* @example
|
|
3489
|
+
* ```tsx
|
|
3490
|
+
* import React from 'react';
|
|
3491
|
+
* import { SearchcraftSearchResultsPerPage } from '@searchcraft/react-sdk';
|
|
3492
|
+
*
|
|
3493
|
+
* const MyResultsPerPage = () => {
|
|
3494
|
+
* return <SearchcraftSearchResultsPerPage increment={20} />;
|
|
3495
|
+
* };
|
|
3496
|
+
*
|
|
3497
|
+
* export default MyResultsPerPage;
|
|
3498
|
+
* ```
|
|
3499
|
+
*/
|
|
3500
|
+
export declare const SearchcraftSearchResultsPerPage: FC<SearchcraftSearchResultsPerPageProps>;
|
|
3501
|
+
/**
|
|
3502
|
+
* The consumer-facing Searchcraft class.
|
|
3503
|
+
*/
|
|
3504
|
+
export declare class Searchcraft extends SearchcraftCore {
|
|
3505
|
+
constructor(config: SearchcraftConfig);
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
export {};
|