@agrada_digital/pbm 0.0.107 → 0.0.108

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.
@@ -0,0 +1,75 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface PBMTheme {
4
+ primaryColor?: string;
5
+ secondaryColor?: string;
6
+ backgroundColor?: string;
7
+ textColor?: string;
8
+ borderColor?: string;
9
+ }
10
+ interface PBMProps {
11
+ original_product_price: number | string;
12
+ tenant_id: string;
13
+ ean_product: string;
14
+ is_authenticated_shopper: boolean;
15
+ custom_login_url?: string;
16
+ theme?: PBMTheme;
17
+ }
18
+ type StateComponentType = "isRegistered" | "isActivated" | "isInvalid" | "isEmpty" | "isPreview" | "isError";
19
+ interface discountTypes {
20
+ unit: number;
21
+ total: number;
22
+ }
23
+ interface usePBMTypes {
24
+ securityNumber: string;
25
+ state: StateComponentType;
26
+ availableDiscountSelected: {
27
+ quantity: number;
28
+ discount: discountTypes;
29
+ totalPrice: number;
30
+ grossPrice: number;
31
+ };
32
+ campaign: "pbm_campaign";
33
+ targetProduct: IProduct | null;
34
+ isAuthenticatedShopper: boolean;
35
+ urlAcceptTerms?: string;
36
+ urlRegisterIndustry?: string;
37
+ customLoginUrl?: string;
38
+ cardID?: string | number;
39
+ }
40
+ interface IProduct {
41
+ ean: string;
42
+ quantity?: number;
43
+ sku?: string;
44
+ skuId?: string;
45
+ price?: number;
46
+ listPrice?: number;
47
+ stockBalance?: number;
48
+ productName?: string;
49
+ productId?: number;
50
+ availabilityText?: string;
51
+ brandName?: string;
52
+ categoryName?: string;
53
+ netPrice?: number;
54
+ informativeMessage?: string;
55
+ discountMax?: number;
56
+ industryLogo?: string;
57
+ }
58
+
59
+ declare function PBM(props: PBMProps): react_jsx_runtime.JSX.Element | undefined;
60
+
61
+ interface PBMStore extends usePBMTypes {
62
+ setSecurityNumber: (securityNumber: string) => void;
63
+ setState: (state: usePBMTypes["state"]) => void;
64
+ setAvailableDiscountSelected: (availableDiscount: usePBMTypes["availableDiscountSelected"]) => void;
65
+ setTargetProduct: (targetProduct: usePBMTypes["targetProduct"]) => void;
66
+ setUrlAcceptTerms: (urlAcceptTerms: usePBMTypes["urlAcceptTerms"]) => void;
67
+ setUrlRegisterIndustry: (urlRegisterIndustry: usePBMTypes["urlRegisterIndustry"]) => void;
68
+ setIsAuthenticatedShopper: (isAuthenticatedShopper: usePBMTypes["isAuthenticatedShopper"]) => void;
69
+ setCustomLoginUrl: (customLoginUrl: usePBMTypes["customLoginUrl"]) => void;
70
+ setCardID: (cardID: usePBMTypes["cardID"]) => void;
71
+ }
72
+ declare function usePBMStore(): PBMStore;
73
+ declare function usePBMStore<T>(selector: (state: PBMStore) => T): T;
74
+
75
+ export { PBM, type PBMProps, type PBMStore, type PBMTheme, usePBMStore };