@salla.sa/twilight 2.0.85 → 2.0.86

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight",
3
- "version": "2.0.85",
3
+ "version": "2.0.86",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/twilight.js",
6
6
  "scripts": {
@@ -24,15 +24,10 @@
24
24
  "license": "MIT",
25
25
  "files": [
26
26
  "dist",
27
- "dataTypes",
27
+ "types",
28
28
  "watcher.js",
29
- "tailwind.js",
30
29
  "package.json",
31
- "components.js",
32
- "postInstall.js",
33
- "components/dist",
34
- "components/loader",
35
- "tailwind_css_list.js"
30
+ "postInstall.js"
36
31
  ],
37
32
  "homepage": "https://salla.dev",
38
33
  "dependencies": {
@@ -54,6 +49,5 @@
54
49
  "peerDependencies": {
55
50
  "webpack": "^4 || ^5"
56
51
  },
57
- "types": "types/index.ts",
58
- "typings": ""
52
+ "types": "types/index.ts"
59
53
  }
@@ -0,0 +1,4 @@
1
+ export interface CartApi {
2
+ latest: () => Promise<any>,
3
+ generate: () => Promise<any>,
4
+ }
@@ -0,0 +1,59 @@
1
+ export interface OptionsData {
2
+ [key: number]: number;
3
+ }
4
+
5
+ export interface Money {
6
+ amount: string;
7
+ currency: string;
8
+ }
9
+
10
+ export default interface Offer {
11
+ discount: Money;
12
+ price_after_discount: string;
13
+ is_free: boolean;
14
+ names: string;
15
+ }
16
+ export default interface CartItem {
17
+ id: number;
18
+ url: string;
19
+ quantity: number;
20
+ isAvailable: boolean;
21
+ onSale: boolean;
22
+ options_data: OptionsData;
23
+ notes: string;
24
+ product_id: number;
25
+ product_name: string;
26
+ product_currency: string;
27
+ isCustomized: boolean;
28
+ product_image: string;
29
+ product_quantity: number;
30
+ product_maximum_quantity_per_order?: any;
31
+ product_available_quantity: number;
32
+ uploaded_files?: any;
33
+ currency: string;
34
+ enable_upload_image: boolean;
35
+ enable_note: boolean;
36
+ has_options: boolean;
37
+ offer?: Offer;
38
+ has_special_price: boolean;
39
+ selectedOptions: number[];
40
+ active_advance: number;
41
+ type: string;
42
+ source?: any;
43
+ hide_quantity: boolean;
44
+ total_special_price: Money;
45
+ special_price: Money;
46
+ product_price: Money;
47
+ product_price_formatted: string;
48
+ price: Money;
49
+ formated_price: string;
50
+ total_product_price: Money;
51
+ total_product_price_formatted: string;
52
+ total: number;
53
+ special_price_formatted: string;
54
+ total_special_price_formatted: string;
55
+ display_total_price: string;
56
+ display_price: string;
57
+ _product_price: number;
58
+ _total_product_price: number;
59
+ }
package/types/index.ts ADDED
@@ -0,0 +1,38 @@
1
+ import {CartApi} from "./api/cart-api";
2
+
3
+ export interface salla {
4
+ notify: string;
5
+ api: string;
6
+ event: string;
7
+ infiniteScroll: string;
8
+ helpers: string;
9
+ config: string;
10
+ localStore: string;
11
+
12
+ //Aliases
13
+ cart: { api: any, event: CartApi };
14
+ auth: string;
15
+ gift: string;
16
+ order: string;
17
+ offer: string;
18
+ search: string;
19
+ coupon: string;
20
+ comment: string;
21
+ loyalty: string;
22
+ product: string;
23
+ currency: string;
24
+ document: string;
25
+ feedback: string;
26
+ twilight: string;
27
+ wishlist: string;
28
+
29
+ log: string;
30
+ success: string;
31
+ error: string;
32
+ onReady: string; //don't relay on it because Salla may not existed yet
33
+ AppHelpers: string;
34
+ money: string;
35
+
36
+ get: string;
37
+ set: string;
38
+ }
@@ -0,0 +1,29 @@
1
+ // @ts-ignore
2
+ import CartItem from "./cartItem";
3
+ type Nullable<T> = T | undefined | null;
4
+ interface Data {
5
+ items: CartItem[];
6
+ count: number;
7
+ total: string;
8
+ total_before_discount?: any;
9
+ coupon_discount: number;
10
+ total_discount: number;
11
+ sub_total: string;
12
+ final_total: string;
13
+ shipping_cost: number;
14
+ }
15
+
16
+ interface Sections {
17
+ ['free-shipping-bar']: Nullable<string>;
18
+ }
19
+
20
+ export interface UpdateCartItemResponse {
21
+ status: number;
22
+ success: boolean;
23
+ data: Data;
24
+ message: string;
25
+ message_code: string;
26
+ sections: Sections;
27
+ events: string;
28
+ }
29
+