@goodhood-web/nebenan-base 4.16.0-development.2 → 4.16.0-development.4

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.
@@ -6,6 +6,7 @@ export declare const useIsBreakpointMatch: (tabletScreenBreakpoint?: number) =>
6
6
  */
7
7
  export declare const extractUserId: (gid: string | undefined | null) => number;
8
8
  export declare const formatCurrency: (cents: number, locale?: string) => string;
9
+ export declare const centsToPrice: (cents: number) => number;
9
10
  /**
10
11
  * Returns the URL string of an imported image.
11
12
  *
@@ -21,3 +22,34 @@ export declare const getImageSrc: (img: string | {
21
22
  src: string;
22
23
  width: number;
23
24
  }) => string;
25
+ export type CartPayload = {
26
+ currency: string;
27
+ products: {
28
+ category: string;
29
+ currency: string;
30
+ id: string;
31
+ name: string;
32
+ price: number;
33
+ }[];
34
+ total_value: number;
35
+ };
36
+ export declare const getSnowplowCartPayload: (id: string, name: string, value?: number) => CartPayload;
37
+ export declare const getSnowplowPurchasePayload: (value: number, id: string, name: string) => {
38
+ currency: string;
39
+ payment_method: string;
40
+ products: {
41
+ category: string;
42
+ currency: string;
43
+ id: string;
44
+ name: string;
45
+ price: number;
46
+ }[];
47
+ revenue: number;
48
+ total_quantity: number;
49
+ transaction_id: string;
50
+ };
51
+ /**
52
+ * Generates a UUID-like string using pseudo-random 4-character hexadecimal segments.
53
+ * @returns {string} A UUID-like string in the format "xxxx-xxxx-xxxx-xxxx-xxxxxx".
54
+ */
55
+ export declare const getUID: () => string;
@@ -1,8 +1,8 @@
1
- import { HoodMessage } from '../ContentCreator/ContentCreatorForm.types';
1
+ import { HoodMessage as THoodMessage } from '../ContentCreator/ContentCreatorForm.types';
2
2
  /**
3
3
  * Hook to handle Premium Feature checkout with Chargebee.
4
4
  */
5
- export declare const usePremiumFeatureCheckout: (finalizeSubmit?: (response: HoodMessage) => void) => {
5
+ export declare const usePremiumFeatureCheckout: (finalizeSubmit?: (response: THoodMessage) => void) => {
6
6
  PremiumFeatureCheckoutModal: import("react/jsx-runtime").JSX.Element;
7
- startCheckout: (postId: string, productId: string, res?: HoodMessage | undefined) => Promise<void>;
7
+ startCheckout: (postId: string, productId: string, res?: THoodMessage | undefined) => Promise<void>;
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodhood-web/nebenan-base",
3
- "version": "4.16.0-development.2",
3
+ "version": "4.16.0-development.4",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/good-hood-gmbh/goodhood-web",