@gomusdev/web-components 1.52.0 → 1.53.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.
@@ -0,0 +1,14 @@
1
+ import { Cart } from '../../../lib/models/cart/cart.svelte.ts';
2
+ import { CartItem } from '../../../lib/models/cart/types.ts';
3
+ import { PostCartResponse } from '@gomus/types';
4
+ type PostCartData = Exclude<PostCartResponse['data'], never>;
5
+ export type ApiItem = PostCartData['items'][number];
6
+ export type DisplayItem = CartItem & {
7
+ display: NonNullable<CartItem['display']>;
8
+ };
9
+ export type DisplayCartResult = {
10
+ cart: Cart;
11
+ appliedCoupons: Set<string>;
12
+ };
13
+ export declare function createDisplayCart(baseCart: Cart, apiItems: ApiItem[]): DisplayCartResult;
14
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function getQuantity(value: unknown, fallback: number): number;
2
+ export declare function normalizeTime(value: string | null | undefined): string | null;
@@ -1,2 +1,7 @@
1
- import { default as UIForm } from '../forms/ui/generic/Form.svelte';
2
- export declare function redeem(form: UIForm): Promise<void>;
1
+ export type RedeemResult = {
2
+ success: true;
3
+ } | {
4
+ success: false;
5
+ errors: string[];
6
+ };
7
+ export declare function redeem(token: string): Promise<RedeemResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -9,6 +9,7 @@ export declare class FormDetails {
9
9
  */
10
10
  successMessage: string | undefined;
11
11
  get formData(): any;
12
+ fieldValue(key: string): string | boolean | undefined;
12
13
  get apiErrors(): string[] | Record<string, string[]>;
13
14
  /**
14
15
  * Sets API errors for the current instance.
@@ -19,14 +19,14 @@ export declare class SegmentDetails {
19
19
  shipped_with_merchandise_id: null;
20
20
  shipping_mode: string;
21
21
  id: number;
22
- time: string;
23
- quantity: number;
22
+ time: string | undefined;
23
+ quantity: number | undefined;
24
24
  } | {
25
25
  shipped_with_merchandise_id: null;
26
26
  shipping_mode: string;
27
27
  id: number;
28
28
  quantities: {
29
- [x: number]: number;
29
+ [x: number]: number | undefined;
30
30
  };
31
31
  };
32
32
  }[];