@kasuvia/sdk 0.0.2 → 0.0.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/hooks/index.d.mts +430 -0
- package/dist/hooks/index.d.ts +430 -0
- package/dist/hooks/index.js +3073 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +2962 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index-CxNLI4nw.d.ts +786 -0
- package/dist/index-CzVMyUs4.d.mts +492 -0
- package/dist/index-CzVMyUs4.d.ts +492 -0
- package/dist/index-Dowl5224.d.mts +786 -0
- package/dist/index.d.mts +48 -1739
- package/dist/index.d.ts +48 -1739
- package/dist/index.js +1544 -2359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1527 -2258
- package/dist/index.mjs.map +1 -1
- package/dist/sdk-context-BuarJbeb.d.ts +75 -0
- package/dist/sdk-context-Db8kf1Tv.d.mts +75 -0
- package/dist/services/index.d.mts +2 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +2369 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/index.mjs +2252 -0
- package/dist/services/index.mjs.map +1 -0
- package/package.json +11 -2
- package/src/config/index.ts +10 -91
- package/src/constants.ts +13 -0
- package/src/context/sdk-context.tsx +70 -0
- package/src/graphql/collections.graphql.ts +2 -10
- package/src/graphql/products.graphql.ts +215 -65
- package/src/graphql/wishlist.graphql.ts +7 -6
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-auth.ts +82 -158
- package/src/hooks/use-bespoke-availability.ts +25 -8
- package/src/hooks/use-cart.ts +222 -119
- package/src/hooks/use-cms.ts +179 -86
- package/src/hooks/use-collections.ts +52 -15
- package/src/hooks/use-consultation-stream.ts +4 -3
- package/src/hooks/use-consultations.ts +120 -51
- package/src/hooks/use-countries.ts +35 -13
- package/src/hooks/use-currencies.ts +26 -13
- package/src/hooks/use-google-translate.ts +22 -8
- package/src/hooks/use-languages.ts +40 -20
- package/src/hooks/use-mobile.ts +23 -0
- package/src/hooks/use-order-stream.ts +9 -5
- package/src/hooks/use-orders.ts +99 -44
- package/src/hooks/use-payment.ts +108 -40
- package/src/hooks/use-products.ts +251 -53
- package/src/hooks/use-service-booking.ts +152 -90
- package/src/hooks/use-states.ts +35 -15
- package/src/hooks/use-wishlist.ts +92 -91
- package/src/index.ts +26 -30
- package/src/services/auth.service.ts +209 -167
- package/src/services/bespoke.service.ts +12 -4
- package/src/services/cart.service.ts +172 -70
- package/src/services/cms.service.ts +70 -35
- package/src/services/collection.service.ts +22 -5
- package/src/services/config.service.ts +34 -14
- package/src/services/consultation.service.ts +72 -18
- package/src/services/logistics.service.ts +35 -11
- package/src/services/notifications.service.ts +27 -12
- package/src/services/order.service.ts +74 -15
- package/src/services/payment.service.ts +86 -31
- package/src/services/product.service.ts +279 -39
- package/src/services/service-booking.service.ts +98 -26
- package/src/services/wishlist.service.ts +69 -25
- package/src/types/auth/index.ts +6 -4
- package/src/types/business/index.ts +7 -2
- package/src/types/payments/index.ts +3 -3
- package/src/types/services/index.ts +2 -5
- package/src/types/store/index.ts +38 -3
- package/src/utils/error-handler.ts +10 -5
- package/src/utils/storage.ts +48 -26
- package/src/utils/validators.ts +85 -0
- package/src/client/authClient.ts +0 -135
- package/src/client/graphqlClient.ts +0 -53
- package/src/client/httpClient.ts +0 -298
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { d as CartResponse, c as CartItem, z as Product, S as SdkConfig, F as FindOrderParams, V as SupportedLang, q as Currency, u as ListParams, e as CmsEntry, o as CreateCmsEntryParams, Y as UpdateCmsEntryParams, L as ListCmsEntriesParams } from '../index-CzVMyUs4.js';
|
|
3
|
+
import { C as Country, d as State } from '../sdk-context-BuarJbeb.js';
|
|
4
|
+
export { S as SdkContextValue, b as SdkProvider, c as SdkProviderProps, r as resolveHookArgs, u as useSdkContext } from '../sdk-context-BuarJbeb.js';
|
|
5
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Cart Hook & Context Provider
|
|
9
|
+
*
|
|
10
|
+
* React Query hooks for cart operations with unified drawer state sharing.
|
|
11
|
+
* config and accessToken are optional — if omitted, they are read from SdkContext.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
interface UseCartReturn {
|
|
15
|
+
cart: CartResponse | undefined;
|
|
16
|
+
items: CartItem[];
|
|
17
|
+
count: number;
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
setOpen: (open: boolean) => void;
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
error: Error | null;
|
|
22
|
+
addToCart: (item: {
|
|
23
|
+
product_id: string;
|
|
24
|
+
product_slug: string;
|
|
25
|
+
product_name: string;
|
|
26
|
+
image?: string;
|
|
27
|
+
variant_id?: string;
|
|
28
|
+
variant_attributes?: string;
|
|
29
|
+
unit_price: number;
|
|
30
|
+
quantity: number;
|
|
31
|
+
custom_measurements?: string;
|
|
32
|
+
is_bespoke: boolean;
|
|
33
|
+
}) => void;
|
|
34
|
+
updateCartItem: (variables: {
|
|
35
|
+
itemId: string;
|
|
36
|
+
quantity: number;
|
|
37
|
+
}) => void;
|
|
38
|
+
removeFromCart: (itemId: string) => void;
|
|
39
|
+
clearCart: () => void;
|
|
40
|
+
clear: () => void;
|
|
41
|
+
mergeGuestCart: (guestSessionId: string) => void;
|
|
42
|
+
addItem: (product: Product, variantId?: string, quantity?: number, customMeasurements?: Record<string, string>) => void;
|
|
43
|
+
updateQty: (itemId: string, quantity: number) => void;
|
|
44
|
+
removeItem: (itemId: string) => void;
|
|
45
|
+
subtotal: number;
|
|
46
|
+
productTypeMismatch: {
|
|
47
|
+
message: string;
|
|
48
|
+
existing_type: string;
|
|
49
|
+
new_type: string;
|
|
50
|
+
} | null;
|
|
51
|
+
handleClearCartAndAdd: () => void;
|
|
52
|
+
handleKeepCurrentCart: () => void;
|
|
53
|
+
}
|
|
54
|
+
interface CartContextValue {
|
|
55
|
+
isOpen: boolean;
|
|
56
|
+
setOpen: (open: boolean) => void;
|
|
57
|
+
}
|
|
58
|
+
declare const CartCtx: React.Context<CartContextValue | null> | null;
|
|
59
|
+
declare function CartProvider({ children }: {
|
|
60
|
+
children: ReactNode;
|
|
61
|
+
}): string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.FunctionComponentElement<React.ProviderProps<CartContextValue | null>> | null | undefined;
|
|
62
|
+
declare function useCart(config?: SdkConfig, accessToken?: string | null): UseCartReturn;
|
|
63
|
+
|
|
64
|
+
declare function useOrders(arg1?: SdkConfig | {
|
|
65
|
+
page?: number;
|
|
66
|
+
pageSize?: number;
|
|
67
|
+
}, arg2?: string | null, arg3?: {
|
|
68
|
+
page?: number;
|
|
69
|
+
pageSize?: number;
|
|
70
|
+
}): any;
|
|
71
|
+
declare function useOrdersList(arg1?: any, arg2?: any, arg3?: any): any;
|
|
72
|
+
declare function useFindOrder(arg1?: SdkConfig | string | FindOrderParams, arg2?: FindOrderParams): any;
|
|
73
|
+
declare function useOrder(arg1?: SdkConfig | string | FindOrderParams, arg2?: FindOrderParams): any;
|
|
74
|
+
declare function useOrderTracking(arg1?: SdkConfig | string, arg2?: string, arg3?: string): any;
|
|
75
|
+
declare function useCreateOrder(config?: SdkConfig, accessToken?: string | null): any;
|
|
76
|
+
declare function useCancelOrder(config?: SdkConfig, accessToken?: string | null): any;
|
|
77
|
+
|
|
78
|
+
declare function useAuthUser(config?: SdkConfig, accessToken?: string): any;
|
|
79
|
+
declare function useLogin(config?: SdkConfig): any;
|
|
80
|
+
declare function useRegister(config?: SdkConfig): any;
|
|
81
|
+
declare function useUpdateProfile(config?: SdkConfig, accessToken?: string | null): any;
|
|
82
|
+
declare function useLogout(config?: SdkConfig, refreshToken?: string): any;
|
|
83
|
+
|
|
84
|
+
declare function getCountries(config: SdkConfig): Promise<Country[]>;
|
|
85
|
+
declare function useCountries(config?: SdkConfig): any;
|
|
86
|
+
|
|
87
|
+
declare function getStates(config: SdkConfig, countryIso: string): Promise<State[]>;
|
|
88
|
+
declare function useStates(countryIso: string, config?: SdkConfig): any;
|
|
89
|
+
|
|
90
|
+
declare function getSupportedLanguagesList(config: SdkConfig): Promise<SupportedLang[]>;
|
|
91
|
+
declare function useSupportedLanguages(config?: SdkConfig): UseQueryResult<SupportedLang[], Error>;
|
|
92
|
+
|
|
93
|
+
declare function getSupportedCurrenciesList(config: SdkConfig): Promise<Currency[]>;
|
|
94
|
+
declare function useCurrencies(config?: SdkConfig): any;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get bespoke availability for a product
|
|
98
|
+
*/
|
|
99
|
+
declare function useBespokeAvailability(product_id: string, config?: SdkConfig): any;
|
|
100
|
+
|
|
101
|
+
declare const collectionKeys: {
|
|
102
|
+
all: readonly ["core", "collections"];
|
|
103
|
+
list: (params?: ListParams) => readonly ["core", "collections", "list", ListParams];
|
|
104
|
+
slug: (slug: string) => readonly ["core", "collections", "slug", string];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Hook to fetch paginated collections for the storefront.
|
|
108
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
109
|
+
*/
|
|
110
|
+
declare function useStorefrontCollections(params?: ListParams): any;
|
|
111
|
+
/**
|
|
112
|
+
* Hook to fetch a single collection by slug for the storefront.
|
|
113
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
114
|
+
*/
|
|
115
|
+
declare function useStorefrontCollection(slug: string): any;
|
|
116
|
+
|
|
117
|
+
declare const productKeys: {
|
|
118
|
+
all: readonly ["products"];
|
|
119
|
+
list: (params?: ListParams) => readonly ["products", "list", ListParams | undefined];
|
|
120
|
+
detail: (slug: string) => readonly ["products", "detail", string];
|
|
121
|
+
recommended: (params?: ListParams) => readonly ["products", "recommended", ListParams | undefined];
|
|
122
|
+
latest: (params?: ListParams) => readonly ["products", "latest", ListParams | undefined];
|
|
123
|
+
popular: (params?: ListParams) => readonly ["products", "popular", ListParams | undefined];
|
|
124
|
+
featured: (params?: ListParams) => readonly ["products", "featured", ListParams | undefined];
|
|
125
|
+
new: (params?: ListParams) => readonly ["products", "new", ListParams | undefined];
|
|
126
|
+
onSale: (params?: ListParams) => readonly ["products", "onSale", ListParams | undefined];
|
|
127
|
+
lowStock: (params?: ListParams) => readonly ["products", "lowStock", ListParams | undefined];
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Hook for fetching latest products.
|
|
131
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
132
|
+
*/
|
|
133
|
+
declare function useLatestProducts(params?: ListParams): any;
|
|
134
|
+
/**
|
|
135
|
+
* Hook for fetching popular products.
|
|
136
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
137
|
+
*/
|
|
138
|
+
declare function usePopularProducts(params?: ListParams): any;
|
|
139
|
+
/**
|
|
140
|
+
* Hook for fetching featured products.
|
|
141
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
142
|
+
*/
|
|
143
|
+
declare function useFeaturedProducts(params?: ListParams): any;
|
|
144
|
+
/**
|
|
145
|
+
* Hook for fetching new products.
|
|
146
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
147
|
+
*/
|
|
148
|
+
declare function useNewProducts(params?: ListParams): any;
|
|
149
|
+
/**
|
|
150
|
+
* Hook for fetching products currently on sale.
|
|
151
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
152
|
+
*/
|
|
153
|
+
declare function useOnSaleProducts(params?: ListParams): any;
|
|
154
|
+
/**
|
|
155
|
+
* Hook for fetching products with low stock.
|
|
156
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
157
|
+
*/
|
|
158
|
+
declare function useLowStockProducts(params?: ListParams): any;
|
|
159
|
+
/**
|
|
160
|
+
* Hook for fetching all active storefront products.
|
|
161
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
162
|
+
*/
|
|
163
|
+
declare function useStorefrontProducts(params?: ListParams): any;
|
|
164
|
+
/**
|
|
165
|
+
* Hook for fetching a single product by slug.
|
|
166
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
167
|
+
*/
|
|
168
|
+
declare function useProduct(slug: string): any;
|
|
169
|
+
/**
|
|
170
|
+
* Hook for fetching recommended products.
|
|
171
|
+
* Fetches from Next.js API route to avoid exposing backend URLs.
|
|
172
|
+
*/
|
|
173
|
+
declare function useRecommendedProducts(params?: ListParams): any;
|
|
174
|
+
|
|
175
|
+
declare const wishlistKeys: {
|
|
176
|
+
all: readonly ["wishlist"];
|
|
177
|
+
list: () => readonly ["wishlist", "list"];
|
|
178
|
+
check: (productId: string) => readonly ["wishlist", "check", string];
|
|
179
|
+
};
|
|
180
|
+
declare function useWishlist(arg1?: SdkConfig | {
|
|
181
|
+
page?: number;
|
|
182
|
+
pageSize?: number;
|
|
183
|
+
}, arg2?: string | null, arg3?: {
|
|
184
|
+
page?: number;
|
|
185
|
+
pageSize?: number;
|
|
186
|
+
}): any;
|
|
187
|
+
declare function useCheckInWishlist(arg1?: SdkConfig | string, arg2?: string | null, arg3?: string): any;
|
|
188
|
+
declare function useAddToWishlist(config?: SdkConfig, accessToken?: string | null): any;
|
|
189
|
+
declare function useRemoveFromWishlist(config?: SdkConfig, accessToken?: string | null): any;
|
|
190
|
+
declare function useRemoveProductFromWishlist(config?: SdkConfig, accessToken?: string | null): any;
|
|
191
|
+
|
|
192
|
+
declare function useAvailableSlots(arg1?: SdkConfig | string, arg2?: string, arg3?: string, arg4?: string): any;
|
|
193
|
+
declare function useBookAppointment(config?: SdkConfig, accessToken?: string | null): any;
|
|
194
|
+
declare function useAppointments(config?: SdkConfig, accessToken?: string | null): any;
|
|
195
|
+
declare function useAppointment(arg1?: SdkConfig | string, arg2?: string | null, arg3?: string): any;
|
|
196
|
+
declare function useCancelAppointment(config?: SdkConfig, accessToken?: string | null): any;
|
|
197
|
+
declare function useDeliverables(arg1?: SdkConfig | string, arg2?: string | null, arg3?: string): any;
|
|
198
|
+
declare function useApproveDeliverable(config?: SdkConfig, accessToken?: string | null, order_id?: string, deliverable_id?: string): any;
|
|
199
|
+
declare function useRequestRevision(config?: SdkConfig, accessToken?: string | null, order_id?: string, deliverable_id?: string): any;
|
|
200
|
+
|
|
201
|
+
declare function useConsultations(config?: SdkConfig, accessToken?: string | null): any;
|
|
202
|
+
declare function useConsultation(arg1?: SdkConfig | string, arg2?: string | null, arg3?: string): any;
|
|
203
|
+
declare function useCreateConsultation(config?: SdkConfig, accessToken?: string | null): any;
|
|
204
|
+
declare function useSendMessage(arg1?: SdkConfig | string, arg2?: string | null, arg3?: string): any;
|
|
205
|
+
declare function useAcceptQuote(arg1?: SdkConfig | string, arg2?: string | null, arg3?: string): any;
|
|
206
|
+
declare function useRejectQuote(arg1?: SdkConfig | string, arg2?: string | null, arg3?: string): any;
|
|
207
|
+
|
|
208
|
+
interface ConsultationMessageData {
|
|
209
|
+
event: string;
|
|
210
|
+
data: {
|
|
211
|
+
consultation_id: string;
|
|
212
|
+
message_id: string;
|
|
213
|
+
sender_id: string;
|
|
214
|
+
sender_role: string;
|
|
215
|
+
message: string;
|
|
216
|
+
attachments?: Array<{
|
|
217
|
+
url: string;
|
|
218
|
+
type: string;
|
|
219
|
+
name: string;
|
|
220
|
+
}>;
|
|
221
|
+
created_at: string;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
interface ConsultationQuoteData {
|
|
225
|
+
event: string;
|
|
226
|
+
data: {
|
|
227
|
+
consultation_id: string;
|
|
228
|
+
quote_amount: number;
|
|
229
|
+
deposit_amount?: number;
|
|
230
|
+
merchant_notes?: string;
|
|
231
|
+
updated_at: string;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
interface ConsultationStatusData {
|
|
235
|
+
event: string;
|
|
236
|
+
data: {
|
|
237
|
+
consultation_id: string;
|
|
238
|
+
status: string;
|
|
239
|
+
updated_at: string;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
interface UseConsultationStreamOptions {
|
|
243
|
+
config: SdkConfig;
|
|
244
|
+
consultationId: string;
|
|
245
|
+
onMessage?: (data: ConsultationMessageData) => void;
|
|
246
|
+
onQuote?: (data: ConsultationQuoteData) => void;
|
|
247
|
+
onStatusChange?: (data: ConsultationStatusData) => void;
|
|
248
|
+
onError?: (error: Error) => void;
|
|
249
|
+
}
|
|
250
|
+
declare function useConsultationStream({ config, consultationId, onMessage, onQuote, onStatusChange, onError, }: UseConsultationStreamOptions): {
|
|
251
|
+
isConnected: boolean;
|
|
252
|
+
lastEvent: any;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
interface PaymentSuccessData {
|
|
256
|
+
event: string;
|
|
257
|
+
data: {
|
|
258
|
+
transaction_id: string;
|
|
259
|
+
order_id: string;
|
|
260
|
+
amount: number;
|
|
261
|
+
currency: string;
|
|
262
|
+
status: string;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
interface DigitalReadyData {
|
|
266
|
+
event: string;
|
|
267
|
+
data: {
|
|
268
|
+
order_id: string;
|
|
269
|
+
business_id: string;
|
|
270
|
+
customer_id: string;
|
|
271
|
+
download_links: Array<{
|
|
272
|
+
item_id: string;
|
|
273
|
+
product_name: string;
|
|
274
|
+
url: string;
|
|
275
|
+
token: string;
|
|
276
|
+
expires_at: string;
|
|
277
|
+
max_downloads: number;
|
|
278
|
+
}>;
|
|
279
|
+
fulfilled_at: string;
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
interface BespokeUpdateData {
|
|
283
|
+
event: string;
|
|
284
|
+
data: {
|
|
285
|
+
order_id: string;
|
|
286
|
+
business_id: string;
|
|
287
|
+
update_type: string;
|
|
288
|
+
message: string;
|
|
289
|
+
stage?: string;
|
|
290
|
+
updated_at: string;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
interface ConsultationUpdateData {
|
|
294
|
+
event: string;
|
|
295
|
+
data: {
|
|
296
|
+
consultation_id: string;
|
|
297
|
+
business_id: string;
|
|
298
|
+
customer_id: string;
|
|
299
|
+
status: string;
|
|
300
|
+
message?: string;
|
|
301
|
+
updated_at: string;
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
interface ServiceBookingUpdateData {
|
|
305
|
+
event: string;
|
|
306
|
+
data: {
|
|
307
|
+
booking_id: string;
|
|
308
|
+
order_id: string;
|
|
309
|
+
business_id: string;
|
|
310
|
+
customer_id: string;
|
|
311
|
+
status: string;
|
|
312
|
+
appointment_date?: string;
|
|
313
|
+
updated_at: string;
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
interface UseOrderStreamOptions {
|
|
317
|
+
config?: SdkConfig;
|
|
318
|
+
orderId: string;
|
|
319
|
+
onPaymentComplete?: (data: PaymentSuccessData) => void;
|
|
320
|
+
onDigitalReady?: (data: DigitalReadyData) => void;
|
|
321
|
+
onBespokeUpdate?: (data: BespokeUpdateData) => void;
|
|
322
|
+
onConsultationUpdate?: (data: ConsultationUpdateData) => void;
|
|
323
|
+
onServiceBookingUpdate?: (data: ServiceBookingUpdateData) => void;
|
|
324
|
+
onError?: (error: Error) => void;
|
|
325
|
+
}
|
|
326
|
+
declare function useOrderStream({ config: explicitConfig, orderId, onPaymentComplete, onDigitalReady, onBespokeUpdate, onConsultationUpdate, onServiceBookingUpdate, onError }: UseOrderStreamOptions): null;
|
|
327
|
+
|
|
328
|
+
declare function useIsMounted(): boolean;
|
|
329
|
+
|
|
330
|
+
declare function useIsMobile(): boolean;
|
|
331
|
+
|
|
332
|
+
interface GoogleTranslateOptions {
|
|
333
|
+
pageLanguage: string;
|
|
334
|
+
includedLanguages?: string;
|
|
335
|
+
autoDisplay?: boolean;
|
|
336
|
+
layout?: number;
|
|
337
|
+
}
|
|
338
|
+
interface GoogleTranslateElement {
|
|
339
|
+
new (options: GoogleTranslateOptions, elementId: string): void;
|
|
340
|
+
}
|
|
341
|
+
interface GoogleNamespace {
|
|
342
|
+
translate?: {
|
|
343
|
+
TranslateElement: GoogleTranslateElement;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
declare global {
|
|
347
|
+
interface Window {
|
|
348
|
+
googleTranslateElementInit?: () => void;
|
|
349
|
+
google?: GoogleNamespace;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
declare function useGoogleTranslate(configOrLang?: SdkConfig | string, appLang?: string): {
|
|
353
|
+
isLoaded: boolean;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Hook for creating a Dedicated Virtual Account (DVA)
|
|
358
|
+
* Optional config and accessToken — read from SdkContext if omitted.
|
|
359
|
+
*/
|
|
360
|
+
declare function useCreateDVA(config?: SdkConfig, accessToken?: string | null): any;
|
|
361
|
+
/**
|
|
362
|
+
* Hook for initiating card payment
|
|
363
|
+
* Optional config and accessToken — read from SdkContext if omitted.
|
|
364
|
+
*/
|
|
365
|
+
declare function useInitiatePayment(config?: SdkConfig, accessToken?: string | null): any;
|
|
366
|
+
/**
|
|
367
|
+
* Hook for verifying a transaction
|
|
368
|
+
* Optional config — read from SdkContext if omitted.
|
|
369
|
+
*/
|
|
370
|
+
declare function useVerifyTransaction(config?: SdkConfig): any;
|
|
371
|
+
/**
|
|
372
|
+
* Hook for getting transaction status
|
|
373
|
+
* Optional config — read from SdkContext if omitted.
|
|
374
|
+
*/
|
|
375
|
+
declare function useTransactionStatus(arg1?: SdkConfig | string, arg2?: string | boolean, arg3?: boolean): any;
|
|
376
|
+
/**
|
|
377
|
+
* Hook for checking transaction status with automatic polling
|
|
378
|
+
* Optional config — read from SdkContext if omitted.
|
|
379
|
+
*/
|
|
380
|
+
declare function usePollTransactionStatus(arg1?: SdkConfig | string, arg2?: string | boolean, arg3?: boolean): any;
|
|
381
|
+
|
|
382
|
+
interface UseCmsEntriesReturn {
|
|
383
|
+
entries: CmsEntry[];
|
|
384
|
+
total: number;
|
|
385
|
+
page: number;
|
|
386
|
+
page_size: number;
|
|
387
|
+
isLoading: boolean;
|
|
388
|
+
error: Error | null;
|
|
389
|
+
refetch: () => void;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Hook to list CMS entries for a specific model.
|
|
393
|
+
* Signature can be:
|
|
394
|
+
* useCmsEntries(config, modelSlug, params)
|
|
395
|
+
* useCmsEntries(modelSlug, params)
|
|
396
|
+
*/
|
|
397
|
+
declare function useCmsEntries(configOrModelSlug: SdkConfig | string, modelSlugOrParams?: string | ListCmsEntriesParams, maybeParams?: ListCmsEntriesParams): UseCmsEntriesReturn;
|
|
398
|
+
interface UseCmsEntryReturn {
|
|
399
|
+
entry: CmsEntry | undefined;
|
|
400
|
+
isLoading: boolean;
|
|
401
|
+
error: Error | null;
|
|
402
|
+
refetch: () => void;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Hook to get a single CMS entry by ID.
|
|
406
|
+
* Signature can be:
|
|
407
|
+
* useCmsEntry(config, modelSlug, entryId)
|
|
408
|
+
* useCmsEntry(modelSlug, entryId)
|
|
409
|
+
*/
|
|
410
|
+
declare function useCmsEntry(configOrModelSlug: SdkConfig | string, modelSlugOrEntryId: string, maybeEntryId?: string): UseCmsEntryReturn;
|
|
411
|
+
interface UseCreateCmsEntryReturn {
|
|
412
|
+
createEntry: (params: CreateCmsEntryParams) => void;
|
|
413
|
+
isLoading: boolean;
|
|
414
|
+
error: Error | null;
|
|
415
|
+
}
|
|
416
|
+
declare function useCreateCmsEntry(config?: SdkConfig, accessToken?: string | null, modelSlug?: string): UseCreateCmsEntryReturn;
|
|
417
|
+
interface UseUpdateCmsEntryReturn {
|
|
418
|
+
updateEntry: (entryId: string, params: UpdateCmsEntryParams) => void;
|
|
419
|
+
isLoading: boolean;
|
|
420
|
+
error: Error | null;
|
|
421
|
+
}
|
|
422
|
+
declare function useUpdateCmsEntry(config?: SdkConfig, accessToken?: string | null, modelSlug?: string): UseUpdateCmsEntryReturn;
|
|
423
|
+
interface UseDeleteCmsEntryReturn {
|
|
424
|
+
deleteEntry: (entryId: string) => void;
|
|
425
|
+
isLoading: boolean;
|
|
426
|
+
error: Error | null;
|
|
427
|
+
}
|
|
428
|
+
declare function useDeleteCmsEntry(config?: SdkConfig, accessToken?: string | null, modelSlug?: string): UseDeleteCmsEntryReturn;
|
|
429
|
+
|
|
430
|
+
export { type CartContextValue, CartCtx, CartProvider, type UseCartReturn, type UseCmsEntriesReturn, type UseCmsEntryReturn, type UseCreateCmsEntryReturn, type UseDeleteCmsEntryReturn, type UseOrderStreamOptions, type UseUpdateCmsEntryReturn, collectionKeys, getCountries, getStates, getSupportedCurrenciesList, getSupportedLanguagesList, productKeys, useAcceptQuote, useAddToWishlist, useAppointment, useAppointments, useApproveDeliverable, useAuthUser, useAvailableSlots, useBespokeAvailability, useBookAppointment, useCancelAppointment, useCancelOrder, useCart, useCheckInWishlist, useCmsEntries, useCmsEntry, useConsultation, useConsultationStream, useConsultations, useCountries, useCreateCmsEntry, useCreateConsultation, useCreateDVA, useCreateOrder, useCurrencies, useDeleteCmsEntry, useDeliverables, useFeaturedProducts, useFindOrder, useGoogleTranslate, useInitiatePayment, useIsMobile, useIsMounted, useLatestProducts, useLogin, useLogout, useLowStockProducts, useNewProducts, useOnSaleProducts, useOrder, useOrderStream, useOrderTracking, useOrders, useOrdersList, usePollTransactionStatus, usePopularProducts, useProduct, useRecommendedProducts, useRegister, useRejectQuote, useRemoveFromWishlist, useRemoveProductFromWishlist, useRequestRevision, useSendMessage, useStates, useStorefrontCollection, useStorefrontCollections, useStorefrontProducts, useSupportedLanguages, useTransactionStatus, useUpdateCmsEntry, useUpdateProfile, useVerifyTransaction, useWishlist, wishlistKeys };
|