-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvtex.search.d.ts
170 lines (168 loc) · 5.44 KB
/
vtex.search.d.ts
1
2
3
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
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
import { Block } from '.'
declare global {
namespace JSX {
interface IntrinsicElements {
/**
* Provides customized autocomplete features in the search bar component, such as top searches, search history, product suggestions, or term suggestions.
* You can read more about the Intelligent [Search autocomplete](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4gXFsEWjF7QF7UtI2GAvhL) feature in the VTEX Help Center.
*
* @see {@link https://developers.vtex.com/docs/apps/vtex.search}
*/
'autocomplete-result-list': Block<{
$type: 'v2'
/**
* Maximum number of items in the top searches list.
*
* @default 10
*/
maxTopSearches?: number
/**
* Maximum number of items in the search history list.
*
* @default 5
*/
maxHistory?: number
/**
* Maximum number of items in the suggested products list.
*
* @default 3
*/
maxSuggetedProducts?: number
/**
* Maximum number of items in the suggested terms list.
*
* @default 3
*/
maxSuggestedTerms?: number
/**
* Autocomplete list width (percentage).
* This value must be between `0` and `100`.
*
* @default undefined
*/
autocompleteWidth?: number
/**
* Determines the layout the suggested products list will have when rendered.
* Possible values are `HORIZONTAL` and `VERTICAL`.
*
* @default undefined
*/
productLayout?: 'HORIZONTAL' | 'VERTICAL'
/**
* Determines whether all component titles will be hidden when rendered (`true`) or not (`false`).
*
* @default false
*/
hideTitles?: boolean
/**
* Determines whether autocomplete should hide unavailable items (`true`) or not (`false`).
*
* @default false
*/
hideUnavailableItems?: boolean
/**
* Determines whether the search history list should be prioritized over the other lists (`true`) or not (`false`).
*
* @default false
*/
historyFirst?: boolean
/**
* Determines the maximum number of recommended products per breakpoints.
* Possible values are `md`, `lg`, or `xlg`.
*
* @default undefined
*/
customBreakpoints?: {
/**
* Defines the maximum number of recommended products for the `md` breakpoint.
*
* @default undefined
*/
md: Breakpoint
/**
* Defines the maximum number of recommended products for the `lg` breakpoint.
*
* @default undefined
*/
lg: Breakpoint
/**
* Defines the maximum number of recommended products for the `xlg` breakpoint.
*
* @default undefined
*/
xlg: Breakpoint
}
/**
* If you want faster searches and are not so concern about having the most up-to-date prices and promotions, use `"skip"`.
*
* @default "default"
*/
simulationBehavior?: 'skip' | 'default'
/**
* By default, the mobile autocomplete uses the `CustomListItem` component to render the suggested products using a horizontal layout.
* But sending a `product-summary` block here will render your customized Product Summary component.
* Read our documentation to learn [how to build a horizontal Product Summary](https://developers.vtex.com/docs/guides/vtex-io-documentation-building-a-horizontal-product-summary) component.
*
* @default undefined
*/
HorizontalProductSummary?: string
}>
/**
* Renders a customized banner based on the search query.
*
* @see {@link https://developers.vtex.com/docs/apps/vtex.search}
*/
'search-banner': Block<{
/**
* Area where the banner will be displayed in the store.
* This needs to match the predefined area value in the banner configuration.
*
* @default undefined
*/
area?: string
/**
* Defines the horizontal alignment of the banner.
* Possible values are `left`, `center`, or `right`.
*
* @default "center"
*/
horizontalAlignment?: 'left' | 'center' | 'right'
}>
/**
* Helps users with possible misspelling corrections for the current search query.
*
* @see {@link https://developers.vtex.com/docs/apps/vtex.search/didyoumean}
*/
'did-you-mean': Block
/**
* Renders a list of similar search terms for the current search query.
*
* @see {@link https://developers.vtex.com/docs/apps/vtex.search/suggestions}
*/
'search-suggestions': Block<{
/**
* Defines a custom page to the link of a suggestion.
* Example: `store.search.custom`.
* Defaults to `store.search`.
*
* @default "store.search"
*/
customPage?: string
}>
}
}
}
type Breakpoint = {
/**
* Breakpoint minimum width.
*
* @default undefined
*/
width?: number
/**
* Maximum number of suggested products.
*
* @default undefined
*/
maxSuggestedProducts?: number
}