@atomic-solutions/woocommerce-react 0.4.1 → 0.6.0
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/hooks/index.cjs +162 -63
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +162 -65
- package/dist/hooks/index.js.map +1 -1
- package/dist/{index-DdY_1X-C.d.cts → index-DEvJWFSF.d.cts} +96 -34
- package/dist/{index-unbfwba0.d.ts → index-Dmlapl9c.d.ts} +96 -34
- package/dist/index.cjs +167 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -19
- package/dist/index.d.ts +4 -19
- package/dist/index.js +165 -65
- package/dist/index.js.map +1 -1
- package/dist/provider/index.d.cts +2 -2
- package/dist/provider/index.d.ts +2 -2
- package/dist/{types-_8YqnkO-.d.cts → types-Dnq60zh-.d.cts} +3 -0
- package/dist/{types-_8YqnkO-.d.ts → types-Dnq60zh-.d.ts} +3 -0
- package/package.json +5 -5
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
+
import * as _atomic_solutions_woocommerce_api_client from '@atomic-solutions/woocommerce-api-client';
|
|
3
4
|
import { WooCommerceClient, ProductCategory, ProductParams, PaginatedResponse, Product, Cart, Checkout, GetOrderInput, StoreApiOrder, ProductImage, CartItemImage, CartItem } from '@atomic-solutions/woocommerce-api-client';
|
|
4
|
-
import { Q as QueryKeys, k as StoreContextValue, l as StoreFeatures, S as StoreLocale, n as StoreTheme } from './types-
|
|
5
|
+
import { Q as QueryKeys, k as StoreContextValue, l as StoreFeatures, S as StoreLocale, n as StoreTheme } from './types-Dnq60zh-.cjs';
|
|
5
6
|
|
|
6
7
|
type QueryOptions<TData, TError = Error> = Omit<UseQueryOptions<TData, TError>, 'queryKey' | 'queryFn'>;
|
|
7
8
|
type MutationOptions<TData, TError = Error, TVariables = unknown> = Omit<UseMutationOptions<TData, TError, TVariables>, 'mutationFn'>;
|
|
@@ -15,9 +16,9 @@ type ProductCategoryTreeNode = ProductCategory & {
|
|
|
15
16
|
};
|
|
16
17
|
declare const useProducts: (params?: ProductParams, options?: QueryOptions<PaginatedResponse<Product>>) => _tanstack_react_query.UseQueryResult<PaginatedResponse<{
|
|
17
18
|
add_to_cart: {
|
|
18
|
-
text: string;
|
|
19
19
|
minimum: number;
|
|
20
20
|
maximum: number;
|
|
21
|
+
text: string;
|
|
21
22
|
multiple_of: number;
|
|
22
23
|
description: string;
|
|
23
24
|
url: string;
|
|
@@ -101,9 +102,9 @@ declare const useProducts: (params?: ProductParams, options?: QueryOptions<Pagin
|
|
|
101
102
|
declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQueryOptions<PaginatedResponse<Product>>) => {
|
|
102
103
|
data: {
|
|
103
104
|
add_to_cart: {
|
|
104
|
-
text: string;
|
|
105
105
|
minimum: number;
|
|
106
106
|
maximum: number;
|
|
107
|
+
text: string;
|
|
107
108
|
multiple_of: number;
|
|
108
109
|
description: string;
|
|
109
110
|
url: string;
|
|
@@ -195,9 +196,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
195
196
|
status: "error";
|
|
196
197
|
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
197
198
|
add_to_cart: {
|
|
198
|
-
text: string;
|
|
199
199
|
minimum: number;
|
|
200
200
|
maximum: number;
|
|
201
|
+
text: string;
|
|
201
202
|
multiple_of: number;
|
|
202
203
|
description: string;
|
|
203
204
|
url: string;
|
|
@@ -280,9 +281,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
280
281
|
}>, unknown>, Error>>;
|
|
281
282
|
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
282
283
|
add_to_cart: {
|
|
283
|
-
text: string;
|
|
284
284
|
minimum: number;
|
|
285
285
|
maximum: number;
|
|
286
|
+
text: string;
|
|
286
287
|
multiple_of: number;
|
|
287
288
|
description: string;
|
|
288
289
|
url: string;
|
|
@@ -384,9 +385,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
384
385
|
isEnabled: boolean;
|
|
385
386
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
386
387
|
add_to_cart: {
|
|
387
|
-
text: string;
|
|
388
388
|
minimum: number;
|
|
389
389
|
maximum: number;
|
|
390
|
+
text: string;
|
|
390
391
|
multiple_of: number;
|
|
391
392
|
description: string;
|
|
392
393
|
url: string;
|
|
@@ -470,9 +471,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
470
471
|
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
471
472
|
promise: Promise<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
472
473
|
add_to_cart: {
|
|
473
|
-
text: string;
|
|
474
474
|
minimum: number;
|
|
475
475
|
maximum: number;
|
|
476
|
+
text: string;
|
|
476
477
|
multiple_of: number;
|
|
477
478
|
description: string;
|
|
478
479
|
url: string;
|
|
@@ -556,9 +557,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
556
557
|
} | {
|
|
557
558
|
data: {
|
|
558
559
|
add_to_cart: {
|
|
559
|
-
text: string;
|
|
560
560
|
minimum: number;
|
|
561
561
|
maximum: number;
|
|
562
|
+
text: string;
|
|
562
563
|
multiple_of: number;
|
|
563
564
|
description: string;
|
|
564
565
|
url: string;
|
|
@@ -652,9 +653,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
652
653
|
status: "success";
|
|
653
654
|
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
654
655
|
add_to_cart: {
|
|
655
|
-
text: string;
|
|
656
656
|
minimum: number;
|
|
657
657
|
maximum: number;
|
|
658
|
+
text: string;
|
|
658
659
|
multiple_of: number;
|
|
659
660
|
description: string;
|
|
660
661
|
url: string;
|
|
@@ -737,9 +738,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
737
738
|
}>, unknown>, Error>>;
|
|
738
739
|
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
739
740
|
add_to_cart: {
|
|
740
|
-
text: string;
|
|
741
741
|
minimum: number;
|
|
742
742
|
maximum: number;
|
|
743
|
+
text: string;
|
|
743
744
|
multiple_of: number;
|
|
744
745
|
description: string;
|
|
745
746
|
url: string;
|
|
@@ -839,9 +840,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
839
840
|
isEnabled: boolean;
|
|
840
841
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
841
842
|
add_to_cart: {
|
|
842
|
-
text: string;
|
|
843
843
|
minimum: number;
|
|
844
844
|
maximum: number;
|
|
845
|
+
text: string;
|
|
845
846
|
multiple_of: number;
|
|
846
847
|
description: string;
|
|
847
848
|
url: string;
|
|
@@ -925,9 +926,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
925
926
|
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
926
927
|
promise: Promise<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
927
928
|
add_to_cart: {
|
|
928
|
-
text: string;
|
|
929
929
|
minimum: number;
|
|
930
930
|
maximum: number;
|
|
931
|
+
text: string;
|
|
931
932
|
multiple_of: number;
|
|
932
933
|
description: string;
|
|
933
934
|
url: string;
|
|
@@ -1011,9 +1012,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1011
1012
|
} | {
|
|
1012
1013
|
data: {
|
|
1013
1014
|
add_to_cart: {
|
|
1014
|
-
text: string;
|
|
1015
1015
|
minimum: number;
|
|
1016
1016
|
maximum: number;
|
|
1017
|
+
text: string;
|
|
1017
1018
|
multiple_of: number;
|
|
1018
1019
|
description: string;
|
|
1019
1020
|
url: string;
|
|
@@ -1107,9 +1108,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1107
1108
|
status: "error";
|
|
1108
1109
|
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1109
1110
|
add_to_cart: {
|
|
1110
|
-
text: string;
|
|
1111
1111
|
minimum: number;
|
|
1112
1112
|
maximum: number;
|
|
1113
|
+
text: string;
|
|
1113
1114
|
multiple_of: number;
|
|
1114
1115
|
description: string;
|
|
1115
1116
|
url: string;
|
|
@@ -1192,9 +1193,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1192
1193
|
}>, unknown>, Error>>;
|
|
1193
1194
|
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1194
1195
|
add_to_cart: {
|
|
1195
|
-
text: string;
|
|
1196
1196
|
minimum: number;
|
|
1197
1197
|
maximum: number;
|
|
1198
|
+
text: string;
|
|
1198
1199
|
multiple_of: number;
|
|
1199
1200
|
description: string;
|
|
1200
1201
|
url: string;
|
|
@@ -1294,9 +1295,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1294
1295
|
isEnabled: boolean;
|
|
1295
1296
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1296
1297
|
add_to_cart: {
|
|
1297
|
-
text: string;
|
|
1298
1298
|
minimum: number;
|
|
1299
1299
|
maximum: number;
|
|
1300
|
+
text: string;
|
|
1300
1301
|
multiple_of: number;
|
|
1301
1302
|
description: string;
|
|
1302
1303
|
url: string;
|
|
@@ -1380,9 +1381,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1380
1381
|
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1381
1382
|
promise: Promise<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1382
1383
|
add_to_cart: {
|
|
1383
|
-
text: string;
|
|
1384
1384
|
minimum: number;
|
|
1385
1385
|
maximum: number;
|
|
1386
|
+
text: string;
|
|
1386
1387
|
multiple_of: number;
|
|
1387
1388
|
description: string;
|
|
1388
1389
|
url: string;
|
|
@@ -1466,9 +1467,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1466
1467
|
} | {
|
|
1467
1468
|
data: {
|
|
1468
1469
|
add_to_cart: {
|
|
1469
|
-
text: string;
|
|
1470
1470
|
minimum: number;
|
|
1471
1471
|
maximum: number;
|
|
1472
|
+
text: string;
|
|
1472
1473
|
multiple_of: number;
|
|
1473
1474
|
description: string;
|
|
1474
1475
|
url: string;
|
|
@@ -1562,9 +1563,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1562
1563
|
status: "pending";
|
|
1563
1564
|
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1564
1565
|
add_to_cart: {
|
|
1565
|
-
text: string;
|
|
1566
1566
|
minimum: number;
|
|
1567
1567
|
maximum: number;
|
|
1568
|
+
text: string;
|
|
1568
1569
|
multiple_of: number;
|
|
1569
1570
|
description: string;
|
|
1570
1571
|
url: string;
|
|
@@ -1647,9 +1648,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1647
1648
|
}>, unknown>, Error>>;
|
|
1648
1649
|
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1649
1650
|
add_to_cart: {
|
|
1650
|
-
text: string;
|
|
1651
1651
|
minimum: number;
|
|
1652
1652
|
maximum: number;
|
|
1653
|
+
text: string;
|
|
1653
1654
|
multiple_of: number;
|
|
1654
1655
|
description: string;
|
|
1655
1656
|
url: string;
|
|
@@ -1749,9 +1750,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1749
1750
|
isEnabled: boolean;
|
|
1750
1751
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1751
1752
|
add_to_cart: {
|
|
1752
|
-
text: string;
|
|
1753
1753
|
minimum: number;
|
|
1754
1754
|
maximum: number;
|
|
1755
|
+
text: string;
|
|
1755
1756
|
multiple_of: number;
|
|
1756
1757
|
description: string;
|
|
1757
1758
|
url: string;
|
|
@@ -1835,9 +1836,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1835
1836
|
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1836
1837
|
promise: Promise<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
1837
1838
|
add_to_cart: {
|
|
1838
|
-
text: string;
|
|
1839
1839
|
minimum: number;
|
|
1840
1840
|
maximum: number;
|
|
1841
|
+
text: string;
|
|
1841
1842
|
multiple_of: number;
|
|
1842
1843
|
description: string;
|
|
1843
1844
|
url: string;
|
|
@@ -1921,9 +1922,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
1921
1922
|
} | {
|
|
1922
1923
|
data: {
|
|
1923
1924
|
add_to_cart: {
|
|
1924
|
-
text: string;
|
|
1925
1925
|
minimum: number;
|
|
1926
1926
|
maximum: number;
|
|
1927
|
+
text: string;
|
|
1927
1928
|
multiple_of: number;
|
|
1928
1929
|
description: string;
|
|
1929
1930
|
url: string;
|
|
@@ -2016,9 +2017,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2016
2017
|
status: "pending";
|
|
2017
2018
|
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2018
2019
|
add_to_cart: {
|
|
2019
|
-
text: string;
|
|
2020
2020
|
minimum: number;
|
|
2021
2021
|
maximum: number;
|
|
2022
|
+
text: string;
|
|
2022
2023
|
multiple_of: number;
|
|
2023
2024
|
description: string;
|
|
2024
2025
|
url: string;
|
|
@@ -2101,9 +2102,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2101
2102
|
}>, unknown>, Error>>;
|
|
2102
2103
|
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2103
2104
|
add_to_cart: {
|
|
2104
|
-
text: string;
|
|
2105
2105
|
minimum: number;
|
|
2106
2106
|
maximum: number;
|
|
2107
|
+
text: string;
|
|
2107
2108
|
multiple_of: number;
|
|
2108
2109
|
description: string;
|
|
2109
2110
|
url: string;
|
|
@@ -2204,9 +2205,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2204
2205
|
isEnabled: boolean;
|
|
2205
2206
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2206
2207
|
add_to_cart: {
|
|
2207
|
-
text: string;
|
|
2208
2208
|
minimum: number;
|
|
2209
2209
|
maximum: number;
|
|
2210
|
+
text: string;
|
|
2210
2211
|
multiple_of: number;
|
|
2211
2212
|
description: string;
|
|
2212
2213
|
url: string;
|
|
@@ -2290,9 +2291,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2290
2291
|
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
2291
2292
|
promise: Promise<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2292
2293
|
add_to_cart: {
|
|
2293
|
-
text: string;
|
|
2294
2294
|
minimum: number;
|
|
2295
2295
|
maximum: number;
|
|
2296
|
+
text: string;
|
|
2296
2297
|
multiple_of: number;
|
|
2297
2298
|
description: string;
|
|
2298
2299
|
url: string;
|
|
@@ -2376,9 +2377,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2376
2377
|
} | {
|
|
2377
2378
|
data: {
|
|
2378
2379
|
add_to_cart: {
|
|
2379
|
-
text: string;
|
|
2380
2380
|
minimum: number;
|
|
2381
2381
|
maximum: number;
|
|
2382
|
+
text: string;
|
|
2382
2383
|
multiple_of: number;
|
|
2383
2384
|
description: string;
|
|
2384
2385
|
url: string;
|
|
@@ -2472,9 +2473,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2472
2473
|
status: "success";
|
|
2473
2474
|
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2474
2475
|
add_to_cart: {
|
|
2475
|
-
text: string;
|
|
2476
2476
|
minimum: number;
|
|
2477
2477
|
maximum: number;
|
|
2478
|
+
text: string;
|
|
2478
2479
|
multiple_of: number;
|
|
2479
2480
|
description: string;
|
|
2480
2481
|
url: string;
|
|
@@ -2557,9 +2558,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2557
2558
|
}>, unknown>, Error>>;
|
|
2558
2559
|
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2559
2560
|
add_to_cart: {
|
|
2560
|
-
text: string;
|
|
2561
2561
|
minimum: number;
|
|
2562
2562
|
maximum: number;
|
|
2563
|
+
text: string;
|
|
2563
2564
|
multiple_of: number;
|
|
2564
2565
|
description: string;
|
|
2565
2566
|
url: string;
|
|
@@ -2659,9 +2660,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2659
2660
|
isEnabled: boolean;
|
|
2660
2661
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2661
2662
|
add_to_cart: {
|
|
2662
|
-
text: string;
|
|
2663
2663
|
minimum: number;
|
|
2664
2664
|
maximum: number;
|
|
2665
|
+
text: string;
|
|
2665
2666
|
multiple_of: number;
|
|
2666
2667
|
description: string;
|
|
2667
2668
|
url: string;
|
|
@@ -2745,9 +2746,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2745
2746
|
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
2746
2747
|
promise: Promise<_tanstack_react_query.InfiniteData<PaginatedResponse<{
|
|
2747
2748
|
add_to_cart: {
|
|
2748
|
-
text: string;
|
|
2749
2749
|
minimum: number;
|
|
2750
2750
|
maximum: number;
|
|
2751
|
+
text: string;
|
|
2751
2752
|
multiple_of: number;
|
|
2752
2753
|
description: string;
|
|
2753
2754
|
url: string;
|
|
@@ -2831,9 +2832,9 @@ declare const useInfiniteProducts: (params?: ProductParams, options?: InfiniteQu
|
|
|
2831
2832
|
};
|
|
2832
2833
|
declare const useProduct: (id: number, options?: QueryOptions<Product>) => _tanstack_react_query.UseQueryResult<{
|
|
2833
2834
|
add_to_cart: {
|
|
2834
|
-
text: string;
|
|
2835
2835
|
minimum: number;
|
|
2836
2836
|
maximum: number;
|
|
2837
|
+
text: string;
|
|
2837
2838
|
multiple_of: number;
|
|
2838
2839
|
description: string;
|
|
2839
2840
|
url: string;
|
|
@@ -7125,6 +7126,16 @@ declare const useAddToCart: () => _tanstack_react_query.UseMutationResult<{
|
|
|
7125
7126
|
attribute: string;
|
|
7126
7127
|
}[] | undefined;
|
|
7127
7128
|
}, unknown>;
|
|
7129
|
+
declare const useAddManyToCart: () => _tanstack_react_query.UseMutationResult<_atomic_solutions_woocommerce_api_client.AddItemsResult, Error, {
|
|
7130
|
+
items: {
|
|
7131
|
+
id: number;
|
|
7132
|
+
quantity: number;
|
|
7133
|
+
variation?: {
|
|
7134
|
+
value: string;
|
|
7135
|
+
attribute: string;
|
|
7136
|
+
}[] | undefined;
|
|
7137
|
+
}[];
|
|
7138
|
+
}, unknown>;
|
|
7128
7139
|
declare const useUpdateCartItem: () => _tanstack_react_query.UseMutationResult<{
|
|
7129
7140
|
totals: {
|
|
7130
7141
|
currency_code: string;
|
|
@@ -8722,6 +8733,57 @@ interface UseCartViewReturn {
|
|
|
8722
8733
|
}
|
|
8723
8734
|
declare function useCartView(options?: UseCartViewOptions): UseCartViewReturn;
|
|
8724
8735
|
|
|
8736
|
+
type StockStatus = 'instock' | 'outofstock' | 'onbackorder';
|
|
8737
|
+
interface StockDisplayConfig {
|
|
8738
|
+
inStockText?: string;
|
|
8739
|
+
outOfStockText?: string;
|
|
8740
|
+
backorderText?: string;
|
|
8741
|
+
showQuantity?: boolean;
|
|
8742
|
+
lowStockThreshold?: number;
|
|
8743
|
+
lowStockText?: string;
|
|
8744
|
+
}
|
|
8745
|
+
declare function getStockStatusText(status: StockStatus, quantity?: number | null, config?: StockDisplayConfig): string;
|
|
8746
|
+
declare function isPurchasable(status: StockStatus, quantity?: number | null, manageStock?: boolean): boolean;
|
|
8747
|
+
type UnavailableReason = 'out_of_stock' | 'not_purchasable';
|
|
8748
|
+
declare function unavailableReason(product: Product): UnavailableReason | undefined;
|
|
8749
|
+
declare function canAddToCart(product: Product): boolean;
|
|
8750
|
+
declare function getStockSeverity(status: StockStatus, quantity?: number | null, lowStockThreshold?: number): 'success' | 'warning' | 'error' | 'info';
|
|
8751
|
+
declare function isLowStock(status: StockStatus, quantity?: number | null, threshold?: number): boolean;
|
|
8752
|
+
declare function getMaxAddToCartQuantity(status: StockStatus, stockQuantity?: number | null, cartQuantity?: number, maxPurchaseQuantity?: number | null): number;
|
|
8753
|
+
|
|
8754
|
+
interface ReorderInputItem {
|
|
8755
|
+
productId: number;
|
|
8756
|
+
quantity: number;
|
|
8757
|
+
}
|
|
8758
|
+
type ReorderUnavailableReason = UnavailableReason | 'missing';
|
|
8759
|
+
interface ReorderItemView {
|
|
8760
|
+
productId: number;
|
|
8761
|
+
name: string;
|
|
8762
|
+
imageUrl?: string;
|
|
8763
|
+
requestedQuantity: number;
|
|
8764
|
+
minQuantity: number;
|
|
8765
|
+
maxQuantity: number;
|
|
8766
|
+
unitPrice: string;
|
|
8767
|
+
lineTotal: string;
|
|
8768
|
+
reason?: ReorderUnavailableReason;
|
|
8769
|
+
raw?: Product;
|
|
8770
|
+
}
|
|
8771
|
+
interface UseReorderViewOptions {
|
|
8772
|
+
localeTag?: string;
|
|
8773
|
+
imageSize?: ImageSize;
|
|
8774
|
+
fallbackImageUrl?: string;
|
|
8775
|
+
}
|
|
8776
|
+
interface UseReorderViewReturn {
|
|
8777
|
+
addable: ReorderItemView[];
|
|
8778
|
+
inCart: ReorderItemView[];
|
|
8779
|
+
unavailable: ReorderItemView[];
|
|
8780
|
+
availableCount: number;
|
|
8781
|
+
totalCount: number;
|
|
8782
|
+
isLoading: boolean;
|
|
8783
|
+
error: Error | null;
|
|
8784
|
+
}
|
|
8785
|
+
declare function useReorderView(items: ReorderInputItem[], options?: UseReorderViewOptions): UseReorderViewReturn;
|
|
8786
|
+
|
|
8725
8787
|
declare function getOrderStatusLabel(status: string): string;
|
|
8726
8788
|
interface ProcessedOrderLineItem {
|
|
8727
8789
|
id: number;
|
|
@@ -8753,4 +8815,4 @@ interface UseOrderViewReturn {
|
|
|
8753
8815
|
}
|
|
8754
8816
|
declare function useOrderView(input: GetOrderInput, options?: UseOrderViewOptions): UseOrderViewReturn;
|
|
8755
8817
|
|
|
8756
|
-
export {
|
|
8818
|
+
export { useOrderView as $, type AppliedCoupon as A, getImageUrlOrPlaceholder as B, type CartTotals as C, getMaxAddToCartQuantity as D, getOrderStatusLabel as E, getPrimaryImage as F, getSizedImageUrl as G, getStockSeverity as H, type ImageSize as I, getStockStatusText as J, isLowStock as K, isPurchasable as L, preloadImage as M, preloadImages as N, unavailableReason as O, PLACEHOLDER_IMAGE_URL as P, useAddManyToCart as Q, type ReorderInputItem as R, type ShippingRate as S, useAddToCart as T, type UnavailableReason as U, useApplyCoupon as V, useCart as W, useCartView as X, useCheckout as Y, useInfiniteProducts as Z, useOrder as _, type PaymentMethod as a, useProcessCheckout as a0, useProduct as a1, useProductCategories as a2, useProductCategoryTree as a3, useProductView as a4, useProducts as a5, useProductsFeed as a6, useRemoveCoupon as a7, useRemoveFromCart as a8, useReorderView as a9, useSelectShippingRate as aa, useStore as ab, useStoreFeatures as ac, useStoreLocale as ad, useStoreTheme as ae, useUpdateCartItem as af, useUpdateCustomer as ag, useWooCommerceClient as ah, useWooCommerceQueryKeys as ai, type InfiniteQueryOptions as aj, type MutationOptions as ak, type QueryOptions as al, type ProcessedCartItem as b, type ProcessedCategory as c, type ProcessedOrderDetails as d, type ProcessedOrderLineItem as e, type ProcessedProduct as f, type ProcessedProductDetails as g, type ProductCartState as h, type ProductCategoryTreeNode as i, type ReorderItemView as j, type ReorderUnavailableReason as k, type StockDisplayConfig as l, type StockStatus as m, type UseCartViewOptions as n, type UseCartViewReturn as o, type UseOrderViewOptions as p, type UseOrderViewReturn as q, type UseProductViewOptions as r, type UseProductViewReturn as s, type UseProductsFeedOptions as t, type UseProductsFeedReturn as u, type UseReorderViewOptions as v, type UseReorderViewReturn as w, canAddToCart as x, getAllImageUrls as y, getImageUrl as z };
|