@wix/headless-stores 0.0.36 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/cjs/dist/react/Category.d.ts +65 -59
  2. package/cjs/dist/react/Category.js +50 -83
  3. package/cjs/dist/react/CategoryList.d.ts +184 -0
  4. package/cjs/dist/react/CategoryList.js +174 -0
  5. package/cjs/dist/react/Product.d.ts +3 -3
  6. package/cjs/dist/react/Product.js +6 -6
  7. package/cjs/dist/react/ProductActions.d.ts +1 -1
  8. package/cjs/dist/react/ProductActions.js +2 -2
  9. package/{dist/react/ProductsList.d.ts → cjs/dist/react/ProductList.d.ts} +71 -38
  10. package/cjs/dist/react/{ProductsList.js → ProductList.js} +30 -26
  11. package/cjs/dist/react/ProductListFilters.d.ts +244 -0
  12. package/cjs/dist/react/ProductListFilters.js +216 -0
  13. package/cjs/dist/react/ProductListPagination.d.ts +246 -0
  14. package/cjs/dist/react/ProductListPagination.js +207 -0
  15. package/cjs/dist/react/ProductListSort.d.ts +87 -0
  16. package/cjs/dist/react/ProductListSort.js +85 -0
  17. package/cjs/dist/react/ProductModifiers.d.ts +5 -5
  18. package/cjs/dist/react/ProductModifiers.js +10 -10
  19. package/cjs/dist/react/ProductVariantSelector.d.ts +5 -5
  20. package/cjs/dist/react/ProductVariantSelector.js +13 -10
  21. package/cjs/dist/react/SelectedVariant.d.ts +3 -3
  22. package/cjs/dist/react/SelectedVariant.js +6 -6
  23. package/cjs/dist/react/index.d.ts +7 -9
  24. package/cjs/dist/react/index.js +7 -9
  25. package/cjs/dist/services/buy-now-service.d.ts +208 -0
  26. package/cjs/dist/services/buy-now-service.js +132 -1
  27. package/cjs/dist/services/categories-list-service.d.ts +163 -0
  28. package/cjs/dist/services/categories-list-service.js +148 -0
  29. package/cjs/dist/services/category-service.d.ts +115 -70
  30. package/cjs/dist/services/category-service.js +101 -110
  31. package/cjs/dist/services/index.d.ts +6 -7
  32. package/cjs/dist/services/index.js +5 -16
  33. package/cjs/dist/services/pay-now-service.d.ts +146 -0
  34. package/cjs/dist/services/pay-now-service.js +112 -1
  35. package/cjs/dist/services/product-service.d.ts +71 -0
  36. package/cjs/dist/services/product-service.js +47 -0
  37. package/cjs/dist/services/products-list-filters-service.d.ts +292 -0
  38. package/cjs/dist/services/products-list-filters-service.js +446 -0
  39. package/cjs/dist/services/products-list-pagination-service.d.ts +186 -0
  40. package/cjs/dist/services/products-list-pagination-service.js +179 -0
  41. package/cjs/dist/services/products-list-service.d.ts +138 -52
  42. package/cjs/dist/services/products-list-service.js +98 -51
  43. package/cjs/dist/services/products-list-sort-service.d.ts +117 -0
  44. package/cjs/dist/services/products-list-sort-service.js +144 -0
  45. package/cjs/dist/utils/url-params.d.ts +68 -0
  46. package/cjs/dist/utils/url-params.js +72 -4
  47. package/dist/react/Category.d.ts +65 -59
  48. package/dist/react/Category.js +50 -83
  49. package/dist/react/CategoryList.d.ts +184 -0
  50. package/dist/react/CategoryList.js +174 -0
  51. package/dist/react/Product.d.ts +3 -3
  52. package/dist/react/Product.js +6 -6
  53. package/dist/react/ProductActions.d.ts +1 -1
  54. package/dist/react/ProductActions.js +2 -2
  55. package/{cjs/dist/react/ProductsList.d.ts → dist/react/ProductList.d.ts} +71 -38
  56. package/dist/react/{ProductsList.js → ProductList.js} +30 -26
  57. package/dist/react/ProductListFilters.d.ts +244 -0
  58. package/dist/react/ProductListFilters.js +216 -0
  59. package/dist/react/ProductListPagination.d.ts +246 -0
  60. package/dist/react/ProductListPagination.js +207 -0
  61. package/dist/react/ProductListSort.d.ts +87 -0
  62. package/dist/react/ProductListSort.js +85 -0
  63. package/dist/react/ProductModifiers.d.ts +5 -5
  64. package/dist/react/ProductModifiers.js +10 -10
  65. package/dist/react/ProductVariantSelector.d.ts +5 -5
  66. package/dist/react/ProductVariantSelector.js +13 -10
  67. package/dist/react/SelectedVariant.d.ts +3 -3
  68. package/dist/react/SelectedVariant.js +6 -6
  69. package/dist/react/index.d.ts +7 -9
  70. package/dist/react/index.js +7 -9
  71. package/dist/services/buy-now-service.d.ts +208 -0
  72. package/dist/services/buy-now-service.js +132 -1
  73. package/dist/services/categories-list-service.d.ts +163 -0
  74. package/dist/services/categories-list-service.js +148 -0
  75. package/dist/services/category-service.d.ts +115 -70
  76. package/dist/services/category-service.js +101 -110
  77. package/dist/services/index.d.ts +6 -7
  78. package/dist/services/index.js +5 -16
  79. package/dist/services/pay-now-service.d.ts +146 -0
  80. package/dist/services/pay-now-service.js +112 -1
  81. package/dist/services/product-service.d.ts +71 -0
  82. package/dist/services/product-service.js +47 -0
  83. package/dist/services/products-list-filters-service.d.ts +292 -0
  84. package/dist/services/products-list-filters-service.js +446 -0
  85. package/dist/services/products-list-pagination-service.d.ts +186 -0
  86. package/dist/services/products-list-pagination-service.js +179 -0
  87. package/dist/services/products-list-service.d.ts +138 -52
  88. package/dist/services/products-list-service.js +98 -51
  89. package/dist/services/products-list-sort-service.d.ts +117 -0
  90. package/dist/services/products-list-sort-service.js +144 -0
  91. package/dist/utils/url-params.d.ts +68 -0
  92. package/dist/utils/url-params.js +72 -4
  93. package/package.json +3 -3
  94. package/cjs/dist/react/Collection.d.ts +0 -294
  95. package/cjs/dist/react/Collection.js +0 -345
  96. package/cjs/dist/react/FilteredCollection.d.ts +0 -299
  97. package/cjs/dist/react/FilteredCollection.js +0 -352
  98. package/cjs/dist/react/RelatedProducts.d.ts +0 -169
  99. package/cjs/dist/react/RelatedProducts.js +0 -180
  100. package/cjs/dist/react/Sort.d.ts +0 -37
  101. package/cjs/dist/react/Sort.js +0 -36
  102. package/cjs/dist/services/catalog-service.d.ts +0 -36
  103. package/cjs/dist/services/catalog-service.js +0 -193
  104. package/cjs/dist/services/collection-service.d.ts +0 -124
  105. package/cjs/dist/services/collection-service.js +0 -628
  106. package/cjs/dist/services/filter-service.d.ts +0 -35
  107. package/cjs/dist/services/filter-service.js +0 -119
  108. package/cjs/dist/services/related-products-service.d.ts +0 -100
  109. package/cjs/dist/services/related-products-service.js +0 -127
  110. package/cjs/dist/services/sort-service.d.ts +0 -20
  111. package/cjs/dist/services/sort-service.js +0 -27
  112. package/dist/react/Collection.d.ts +0 -294
  113. package/dist/react/Collection.js +0 -345
  114. package/dist/react/FilteredCollection.d.ts +0 -299
  115. package/dist/react/FilteredCollection.js +0 -352
  116. package/dist/react/RelatedProducts.d.ts +0 -169
  117. package/dist/react/RelatedProducts.js +0 -180
  118. package/dist/react/Sort.d.ts +0 -37
  119. package/dist/react/Sort.js +0 -36
  120. package/dist/services/catalog-service.d.ts +0 -36
  121. package/dist/services/catalog-service.js +0 -193
  122. package/dist/services/collection-service.d.ts +0 -124
  123. package/dist/services/collection-service.js +0 -628
  124. package/dist/services/filter-service.d.ts +0 -35
  125. package/dist/services/filter-service.js +0 -119
  126. package/dist/services/related-products-service.d.ts +0 -100
  127. package/dist/services/related-products-service.js +0 -127
  128. package/dist/services/sort-service.d.ts +0 -20
  129. package/dist/services/sort-service.js +0 -27
@@ -1,29 +1,100 @@
1
1
  import { type Signal } from "@wix/services-definitions/core-services/signals";
2
2
  import * as productsV3 from "@wix/auto_sdk_stores_products-v-3";
3
+ /**
4
+ * API interface for the Product service, providing reactive product data management.
5
+ * This service handles loading and managing a single product's data, loading state, and errors.
6
+ *
7
+ * @interface ProductServiceAPI
8
+ */
3
9
  export interface ProductServiceAPI {
10
+ /** Reactive signal containing the current product data */
4
11
  product: Signal<productsV3.V3Product>;
12
+ /** Reactive signal indicating if a product is currently being loaded */
5
13
  isLoading: Signal<boolean>;
14
+ /** Reactive signal containing any error message, or null if no error */
6
15
  error: Signal<string | null>;
16
+ /** Function to load a product by its slug */
7
17
  loadProduct: (slug: string) => Promise<void>;
8
18
  }
19
+ /**
20
+ * Service definition for the Product service.
21
+ * This defines the contract that the ProductService must implement.
22
+ *
23
+ * @constant
24
+ */
9
25
  export declare const ProductServiceDefinition: string & {
10
26
  __api: ProductServiceAPI;
11
27
  __config: {};
12
28
  isServiceDefinition?: boolean;
13
29
  } & ProductServiceAPI;
30
+ /**
31
+ * Configuration interface required to initialize the ProductService.
32
+ * Contains the initial product data that will be loaded into the service.
33
+ *
34
+ * @interface ProductServiceConfig
35
+ */
14
36
  export interface ProductServiceConfig {
37
+ /** The initial product data to configure the service with */
15
38
  product: productsV3.V3Product;
16
39
  }
40
+ /**
41
+ * Implementation of the Product service that manages reactive product data.
42
+ * This service provides signals for product data, loading state, and error handling,
43
+ * along with methods to dynamically load products.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * import { ProductService, ProductServiceDefinition } from '@wix/stores/services';
48
+ * import { useService } from '@wix/services-manager-react';
49
+ *
50
+ * function ProductComponent({ productConfig }) {
51
+ * return (
52
+ * <ServiceProvider services={createServicesMap([
53
+ * [ProductServiceDefinition, ProductService.withConfig(productConfig)]
54
+ * ])}>
55
+ * <ProductDisplay />
56
+ * </ServiceProvider>
57
+ * );
58
+ * }
59
+ *
60
+ * function ProductDisplay() {
61
+ * const productService = useService(ProductServiceDefinition);
62
+ * const product = productService.product.get();
63
+ * const isLoading = productService.isLoading.get();
64
+ * const error = productService.error.get();
65
+ *
66
+ * if (isLoading) return <div>Loading...</div>;
67
+ * if (error) return <div>Error: {error}</div>;
68
+ *
69
+ * return <h1>{product.name}</h1>;
70
+ * }
71
+ * ```
72
+ */
17
73
  export declare const ProductService: import("@wix/services-definitions").ServiceFactory<string & {
18
74
  __api: ProductServiceAPI;
19
75
  __config: {};
20
76
  isServiceDefinition?: boolean;
21
77
  } & ProductServiceAPI, ProductServiceConfig>;
78
+ /**
79
+ * Success result interface for product service configuration loading.
80
+ * Returned when a product is successfully found and loaded.
81
+ *
82
+ * @interface SuccessProductServiceConfigResult
83
+ */
22
84
  export interface SuccessProductServiceConfigResult {
85
+ /** Type "success" means that the product was found and the config is valid */
23
86
  type: "success";
87
+ /** The product config containing the loaded product data */
24
88
  config: ProductServiceConfig;
25
89
  }
90
+ /**
91
+ * Not found result interface for product service configuration loading.
92
+ * Returned when a product with the given slug cannot be found.
93
+ *
94
+ * @interface NotFoundProductServiceConfigResult
95
+ */
26
96
  export interface NotFoundProductServiceConfigResult {
97
+ /** Type "notFound" means that the product was not found */
27
98
  type: "notFound";
28
99
  }
29
100
  /**
@@ -1,7 +1,46 @@
1
1
  import { defineService, implementService } from "@wix/services-definitions";
2
2
  import { SignalsServiceDefinition, } from "@wix/services-definitions/core-services/signals";
3
3
  import * as productsV3 from "@wix/auto_sdk_stores_products-v-3";
4
+ /**
5
+ * Service definition for the Product service.
6
+ * This defines the contract that the ProductService must implement.
7
+ *
8
+ * @constant
9
+ */
4
10
  export const ProductServiceDefinition = defineService("product");
11
+ /**
12
+ * Implementation of the Product service that manages reactive product data.
13
+ * This service provides signals for product data, loading state, and error handling,
14
+ * along with methods to dynamically load products.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import { ProductService, ProductServiceDefinition } from '@wix/stores/services';
19
+ * import { useService } from '@wix/services-manager-react';
20
+ *
21
+ * function ProductComponent({ productConfig }) {
22
+ * return (
23
+ * <ServiceProvider services={createServicesMap([
24
+ * [ProductServiceDefinition, ProductService.withConfig(productConfig)]
25
+ * ])}>
26
+ * <ProductDisplay />
27
+ * </ServiceProvider>
28
+ * );
29
+ * }
30
+ *
31
+ * function ProductDisplay() {
32
+ * const productService = useService(ProductServiceDefinition);
33
+ * const product = productService.product.get();
34
+ * const isLoading = productService.isLoading.get();
35
+ * const error = productService.error.get();
36
+ *
37
+ * if (isLoading) return <div>Loading...</div>;
38
+ * if (error) return <div>Error: {error}</div>;
39
+ *
40
+ * return <h1>{product.name}</h1>;
41
+ * }
42
+ * ```
43
+ */
5
44
  export const ProductService = implementService.withConfig()(ProductServiceDefinition, ({ getService, config }) => {
6
45
  const signalsService = getService(SignalsServiceDefinition);
7
46
  const product = signalsService.signal(config.product);
@@ -26,6 +65,14 @@ export const ProductService = implementService.withConfig()(ProductServiceDefini
26
65
  loadProduct,
27
66
  };
28
67
  });
68
+ /**
69
+ * Internal helper function to load a product by its slug from the Wix Products API.
70
+ * Fetches comprehensive product data including description, categories, media, etc.
71
+ *
72
+ * @private
73
+ * @param {string} slug - The product slug to load
74
+ * @returns {Promise} Product response from the API
75
+ */
29
76
  const loadProductBySlug = async (slug) => {
30
77
  const productResponse = await productsV3.getProductBySlug(slug, {
31
78
  fields: [
@@ -0,0 +1,292 @@
1
+ import { type Signal } from "@wix/services-definitions/core-services/signals";
2
+ import { customizationsV3 } from "@wix/stores";
3
+ /**
4
+ * Interface representing a product option (like Size, Color, etc.).
5
+ * Contains the option metadata and available choices.
6
+ *
7
+ * @interface ProductOption
8
+ */
9
+ export interface ProductOption {
10
+ /** Unique identifier for the product option */
11
+ id: string;
12
+ /** Display name of the option (e.g., "Size", "Color") */
13
+ name: string;
14
+ /** Array of available choices for this option */
15
+ choices: ProductChoice[];
16
+ /** Optional render type for UI display purposes */
17
+ optionRenderType?: string;
18
+ }
19
+ /**
20
+ * Interface representing a choice within a product option.
21
+ * For example, "Red" would be a choice within a "Color" option.
22
+ *
23
+ * @interface ProductChoice
24
+ */
25
+ export interface ProductChoice {
26
+ /** Unique identifier for the choice */
27
+ id: string;
28
+ /** Display name of the choice (e.g., "Red", "Large") */
29
+ name: string;
30
+ /** Optional color code for color-based choices */
31
+ colorCode?: string;
32
+ }
33
+ /**
34
+ * Enumeration of inventory status types available for filtering.
35
+ * Maps to the Wix Stores API inventory availability statuses.
36
+ *
37
+ * @enum {string}
38
+ */
39
+ export declare enum InventoryStatusType {
40
+ /** Product is in stock and available for purchase */
41
+ IN_STOCK = "IN_STOCK",
42
+ /** Product is out of stock */
43
+ OUT_OF_STOCK = "OUT_OF_STOCK",
44
+ /** Product is partially out of stock (some variants available) */
45
+ PARTIALLY_OUT_OF_STOCK = "PARTIALLY_OUT_OF_STOCK"
46
+ }
47
+ /**
48
+ * Configuration interface for the Products List Filters service.
49
+ * Contains customizations data used to build filter options.
50
+ *
51
+ * @interface ProductsListFiltersServiceConfig
52
+ */
53
+ export type ProductsListFiltersServiceConfig = {
54
+ /** Array of product customizations for building filter options */
55
+ customizations: customizationsV3.Customization[];
56
+ };
57
+ /**
58
+ * Loads products list filters service configuration from the Wix Stores API for SSR initialization.
59
+ * This function fetches customization data that will be used to build product filter options.
60
+ *
61
+ * @returns {Promise<ProductsListFiltersServiceConfig>} Promise that resolves to the filters configuration
62
+ *
63
+ * @example
64
+ * ```astro
65
+ * ---
66
+ * // Astro page example - pages/products.astro
67
+ * import { loadProductsListFiltersServiceConfig } from '@wix/stores/services';
68
+ * import { ProductsListFilters } from '@wix/stores/components';
69
+ *
70
+ * // Load filters configuration during SSR
71
+ * const filtersConfig = await loadProductsListFiltersServiceConfig();
72
+ * ---
73
+ *
74
+ * <ProductsListFilters.Root filtersConfig={filtersConfig}>
75
+ * <ProductsListFilters.MinPrice>
76
+ * {({ minPrice, setMinPrice }) => (
77
+ * <input
78
+ * type="number"
79
+ * value={minPrice}
80
+ * onChange={(e) => setMinPrice(parseFloat(e.target.value))}
81
+ * placeholder="Min Price"
82
+ * />
83
+ * )}
84
+ * </ProductsListFilters.MinPrice>
85
+ * </ProductsListFilters.Root>
86
+ * ```
87
+ *
88
+ * @example
89
+ * ```tsx
90
+ * // Next.js page example
91
+ * import { GetServerSideProps } from 'next';
92
+ * import { loadProductsListFiltersServiceConfig } from '@wix/stores/services';
93
+ *
94
+ * export const getServerSideProps: GetServerSideProps = async () => {
95
+ * const filtersConfig = await loadProductsListFiltersServiceConfig();
96
+ *
97
+ * return {
98
+ * props: {
99
+ * filtersConfig,
100
+ * },
101
+ * };
102
+ * };
103
+ * ```
104
+ */
105
+ export declare function loadProductsListFiltersServiceConfig(): Promise<ProductsListFiltersServiceConfig>;
106
+ /**
107
+ * Service definition for the Products List Filters service.
108
+ * This defines the reactive API contract for managing product list filtering capabilities
109
+ * including price, inventory status, and product option filters.
110
+ *
111
+ * @constant
112
+ */
113
+ export declare const ProductsListFiltersServiceDefinition: string & {
114
+ __api: {
115
+ /** Reactive signal containing the minimum price filter value */
116
+ minPrice: Signal<number>;
117
+ /** Reactive signal containing the maximum price filter value */
118
+ maxPrice: Signal<number>;
119
+ /** Reactive signal containing available inventory status options */
120
+ availableInventoryStatuses: Signal<InventoryStatusType[]>;
121
+ /** Reactive signal containing selected inventory status filters */
122
+ selectedInventoryStatuses: Signal<InventoryStatusType[]>;
123
+ /** Reactive signal containing available product options for filtering */
124
+ availableProductOptions: Signal<ProductOption[]>;
125
+ /** Reactive signal containing selected product option filters */
126
+ selectedProductOptions: Signal<Record<string, string[]>>;
127
+ /** Function to set the minimum price filter */
128
+ setMinPrice: (minPrice: number) => void;
129
+ /** Function to set the maximum price filter */
130
+ setMaxPrice: (maxPrice: number) => void;
131
+ /** Function to toggle an inventory status filter */
132
+ toggleInventoryStatus: (status: InventoryStatusType) => void;
133
+ /** Function to toggle a product option choice filter */
134
+ toggleProductOption: (optionId: string, choiceId: string) => void;
135
+ /** Reactive signal indicating if any filters are currently applied */
136
+ isFiltered: Signal<boolean>;
137
+ /** Function to reset all filters to their default state */
138
+ reset: () => void;
139
+ };
140
+ __config: {};
141
+ isServiceDefinition?: boolean;
142
+ } & {
143
+ /** Reactive signal containing the minimum price filter value */
144
+ minPrice: Signal<number>;
145
+ /** Reactive signal containing the maximum price filter value */
146
+ maxPrice: Signal<number>;
147
+ /** Reactive signal containing available inventory status options */
148
+ availableInventoryStatuses: Signal<InventoryStatusType[]>;
149
+ /** Reactive signal containing selected inventory status filters */
150
+ selectedInventoryStatuses: Signal<InventoryStatusType[]>;
151
+ /** Reactive signal containing available product options for filtering */
152
+ availableProductOptions: Signal<ProductOption[]>;
153
+ /** Reactive signal containing selected product option filters */
154
+ selectedProductOptions: Signal<Record<string, string[]>>;
155
+ /** Function to set the minimum price filter */
156
+ setMinPrice: (minPrice: number) => void;
157
+ /** Function to set the maximum price filter */
158
+ setMaxPrice: (maxPrice: number) => void;
159
+ /** Function to toggle an inventory status filter */
160
+ toggleInventoryStatus: (status: InventoryStatusType) => void;
161
+ /** Function to toggle a product option choice filter */
162
+ toggleProductOption: (optionId: string, choiceId: string) => void;
163
+ /** Reactive signal indicating if any filters are currently applied */
164
+ isFiltered: Signal<boolean>;
165
+ /** Function to reset all filters to their default state */
166
+ reset: () => void;
167
+ };
168
+ /**
169
+ * Implementation of the Products List Filters service that manages reactive filtering state.
170
+ * This service provides signals for all filter types (price, inventory, product options) and
171
+ * automatically updates the products list search options when filters change.
172
+ *
173
+ * @example
174
+ * ```tsx
175
+ * import { ProductsListFiltersService, ProductsListFiltersServiceDefinition } from '@wix/stores/services';
176
+ * import { useService } from '@wix/services-manager-react';
177
+ *
178
+ * function FiltersComponent({ filtersConfig }) {
179
+ * return (
180
+ * <ServiceProvider services={createServicesMap([
181
+ * [ProductsListFiltersServiceDefinition, ProductsListFiltersService.withConfig(filtersConfig)]
182
+ * ])}>
183
+ * <FilterControls />
184
+ * </ServiceProvider>
185
+ * );
186
+ * }
187
+ *
188
+ * function FilterControls() {
189
+ * const filtersService = useService(ProductsListFiltersServiceDefinition);
190
+ * const minPrice = filtersService.minPrice.get();
191
+ * const maxPrice = filtersService.maxPrice.get();
192
+ * const selectedInventoryStatuses = filtersService.selectedInventoryStatuses.get();
193
+ * const availableProductOptions = filtersService.availableProductOptions.get();
194
+ * const isFiltered = filtersService.isFiltered.get();
195
+ *
196
+ * return (
197
+ * <div>
198
+ * <div>
199
+ * <input
200
+ * type="number"
201
+ * value={minPrice}
202
+ * onChange={(e) => filtersService.setMinPrice(parseFloat(e.target.value))}
203
+ * placeholder="Min Price"
204
+ * />
205
+ * <input
206
+ * type="number"
207
+ * value={maxPrice}
208
+ * onChange={(e) => filtersService.setMaxPrice(parseFloat(e.target.value))}
209
+ * placeholder="Max Price"
210
+ * />
211
+ * </div>
212
+ *
213
+ * {availableProductOptions.map(option => (
214
+ * <div key={option.id}>
215
+ * <h4>{option.name}</h4>
216
+ * {option.choices.map(choice => (
217
+ * <label key={choice.id}>
218
+ * <input
219
+ * type="checkbox"
220
+ * onChange={() => filtersService.toggleProductOption(option.id, choice.id)}
221
+ * />
222
+ * {choice.name}
223
+ * </label>
224
+ * ))}
225
+ * </div>
226
+ * ))}
227
+ *
228
+ * {isFiltered && (
229
+ * <button onClick={() => filtersService.reset()}>
230
+ * Clear All Filters
231
+ * </button>
232
+ * )}
233
+ * </div>
234
+ * );
235
+ * }
236
+ * ```
237
+ */
238
+ export declare const ProductsListFiltersService: import("@wix/services-definitions").ServiceFactory<string & {
239
+ __api: {
240
+ /** Reactive signal containing the minimum price filter value */
241
+ minPrice: Signal<number>;
242
+ /** Reactive signal containing the maximum price filter value */
243
+ maxPrice: Signal<number>;
244
+ /** Reactive signal containing available inventory status options */
245
+ availableInventoryStatuses: Signal<InventoryStatusType[]>;
246
+ /** Reactive signal containing selected inventory status filters */
247
+ selectedInventoryStatuses: Signal<InventoryStatusType[]>;
248
+ /** Reactive signal containing available product options for filtering */
249
+ availableProductOptions: Signal<ProductOption[]>;
250
+ /** Reactive signal containing selected product option filters */
251
+ selectedProductOptions: Signal<Record<string, string[]>>;
252
+ /** Function to set the minimum price filter */
253
+ setMinPrice: (minPrice: number) => void;
254
+ /** Function to set the maximum price filter */
255
+ setMaxPrice: (maxPrice: number) => void;
256
+ /** Function to toggle an inventory status filter */
257
+ toggleInventoryStatus: (status: InventoryStatusType) => void;
258
+ /** Function to toggle a product option choice filter */
259
+ toggleProductOption: (optionId: string, choiceId: string) => void;
260
+ /** Reactive signal indicating if any filters are currently applied */
261
+ isFiltered: Signal<boolean>;
262
+ /** Function to reset all filters to their default state */
263
+ reset: () => void;
264
+ };
265
+ __config: {};
266
+ isServiceDefinition?: boolean;
267
+ } & {
268
+ /** Reactive signal containing the minimum price filter value */
269
+ minPrice: Signal<number>;
270
+ /** Reactive signal containing the maximum price filter value */
271
+ maxPrice: Signal<number>;
272
+ /** Reactive signal containing available inventory status options */
273
+ availableInventoryStatuses: Signal<InventoryStatusType[]>;
274
+ /** Reactive signal containing selected inventory status filters */
275
+ selectedInventoryStatuses: Signal<InventoryStatusType[]>;
276
+ /** Reactive signal containing available product options for filtering */
277
+ availableProductOptions: Signal<ProductOption[]>;
278
+ /** Reactive signal containing selected product option filters */
279
+ selectedProductOptions: Signal<Record<string, string[]>>;
280
+ /** Function to set the minimum price filter */
281
+ setMinPrice: (minPrice: number) => void;
282
+ /** Function to set the maximum price filter */
283
+ setMaxPrice: (maxPrice: number) => void;
284
+ /** Function to toggle an inventory status filter */
285
+ toggleInventoryStatus: (status: InventoryStatusType) => void;
286
+ /** Function to toggle a product option choice filter */
287
+ toggleProductOption: (optionId: string, choiceId: string) => void;
288
+ /** Reactive signal indicating if any filters are currently applied */
289
+ isFiltered: Signal<boolean>;
290
+ /** Function to reset all filters to their default state */
291
+ reset: () => void;
292
+ }, ProductsListFiltersServiceConfig>;