@salla.sa/twilight 2.0.217 → 2.0.219
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/@salla.sa/twilight.min.js +2 -2
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/main.js +2 -2
- package/dist/cjs/main.js.map +1 -1
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/main.js +2 -2
- package/dist/esm/main.js.map +1 -1
- package/package.json +1 -1
- package/types/actions.d.ts +50 -0
- package/types/api/cart.d.ts +4 -6
- package/types/api/comment.d.ts +12 -0
- package/types/api/currency.d.ts +17 -0
- package/types/api/document.d.ts +3 -0
- package/types/api/feedback.d.ts +56 -0
- package/types/api/gift.d.ts +26 -0
- package/types/api/index.d.ts +103 -0
- package/types/api/offer.d.ts +43 -0
- package/types/api/product.d.ts +29 -0
- package/types/api/search.d.ts +22 -0
- package/types/api/twilight.d.ts +6 -0
- package/types/api/wishlist.d.ts +7 -0
- package/types/common.d.ts +42 -4
- package/types/event/comment.d.ts +7 -0
- package/types/event/currency.d.ts +9 -0
- package/types/event/document.d.ts +21 -0
- package/types/event/feedback.d.ts +18 -0
- package/types/event/gift.d.ts +7 -0
- package/types/event/index.d.ts +56 -0
- package/types/event/infiniteScroll.d.ts +12 -0
- package/types/event/offer.d.ts +9 -0
- package/types/event/product.d.ts +9 -0
- package/types/event/profile.d.ts +2 -5
- package/types/event/search.d.ts +7 -0
- package/types/event/twilight.d.ts +5 -0
- package/types/event/wishlist.d.ts +8 -0
- package/types/helpers/app-helpers.d.ts +31 -0
- package/types/helpers/salla-helpers.d.ts +17 -9
- package/types/index.d.ts +30 -89
- package/types/lib/salla-config.ts +43 -5
- package/types/lib/salla-cookie.d.ts +5 -0
- package/types/lib/salla-form.d.ts +3 -0
- package/types/lib/salla-lang.d.ts +14 -0
- package/types/lib/salla-notify.d.ts +14 -0
- package/types/lib/salla-storage.d.ts +13 -0
- package/types/tiwlight-config.d.ts +57 -57
- package/types/all.d.ts +0 -5
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {RequestErrorEventWithData, TwilightResponse} from "../common";
|
|
2
|
+
|
|
3
|
+
export default interface WishlistEvent {
|
|
4
|
+
onAdded: (callback: (response: TwilightResponse, product_id: number) => void) => void;
|
|
5
|
+
onRemoved: (callback: (response: TwilightResponse, product_id: number) => void) => void;
|
|
6
|
+
onAdditionFailed: RequestErrorEventWithData</*product_id*/number>;
|
|
7
|
+
onRemovingFailed: RequestErrorEventWithData</*product_id*/number>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {Nullable} from "../common";
|
|
2
|
+
|
|
3
|
+
type ElementOrSelector = string | HTMLElement;
|
|
4
|
+
type EventTypes = 'click' | 'keyup' | 'input' | 'change' | string;
|
|
5
|
+
export default interface AppHelpers {
|
|
6
|
+
toggleClassIf: (selector: string, classes1: string | Array<string>, classes2: string | Array<string>, callback: (element: HTMLElement) => boolean) => AppHelpers;
|
|
7
|
+
toggleElementClassIf: (element: HTMLElement, classes1: string | Array<string>, classes2: string | Array<string>, callback: (element: HTMLElement) => boolean) => AppHelpers;
|
|
8
|
+
|
|
9
|
+
isValidEmail: (email: string) => boolean;
|
|
10
|
+
|
|
11
|
+
element: (selector: ElementOrSelector) => Nullable<HTMLElement>;
|
|
12
|
+
watchElement: (name: string, selector: ElementOrSelector) => AppHelpers;
|
|
13
|
+
watchElements: (elements: { [key: string]: [value: ElementOrSelector] }) => AppHelpers;
|
|
14
|
+
hideElement: (element: ElementOrSelector) => AppHelpers;
|
|
15
|
+
showElement: (element: ElementOrSelector) => AppHelpers;
|
|
16
|
+
//💡 you can pass one or multi classes: this.removeClass(element, 'class_1', 'class_2', ...)
|
|
17
|
+
removeClass: (element: ElementOrSelector, ...className: string[]) => AppHelpers;
|
|
18
|
+
addClass: (element: ElementOrSelector, ...className: string[]) => AppHelpers;
|
|
19
|
+
//💡instead of: `document.querySelectorAll('.test').forEach(element=>{...})`
|
|
20
|
+
// you can use: `this.all('.test', element=>{...})`
|
|
21
|
+
all: (element: ElementOrSelector, callback: (element: HTMLElement) => void) => AppHelpers;
|
|
22
|
+
|
|
23
|
+
//💡instead of: `document.querySelectorAll('.test').forEach(el => el.addEventListener('keyup', callback));`
|
|
24
|
+
// you can use: `this.on('.test', 'keyup', callback)`
|
|
25
|
+
// or can use: `this.onKeyUp('.test', callback)`
|
|
26
|
+
on: (eventType: EventTypes, element: ElementOrSelector, callback: EventListener, options?: AddEventListenerOptions) => AppHelpers;
|
|
27
|
+
onClick: (element: ElementOrSelector, callback: EventListener) => AppHelpers;
|
|
28
|
+
onKeyUp: (element: ElementOrSelector, callback: EventListener) => AppHelpers;
|
|
29
|
+
onEnter: (element: ElementOrSelector, callback: EventListener) => AppHelpers;
|
|
30
|
+
debounce: (callback: () => unknown) => (...data: Nullable<any>) => Promise<unknown>
|
|
31
|
+
}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import {Price} from "../common";
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export type UrlHelper = (path: string) => string; //add any path to current url, ex: `salla.url('cart?anything=data')` output => `https://store_domain.com/cart?anything=data`
|
|
4
|
+
export default interface SallaHelpers {
|
|
4
5
|
//Numbers helpers
|
|
5
6
|
digitsOnly: (num: string | number) => number,
|
|
6
7
|
inputDigitsOnly: (input: string | HTMLInputElement) => number,
|
|
7
|
-
number: () => number,
|
|
8
|
+
number: (num: number) => number | string,
|
|
8
9
|
money: (num: number | Price) => string,
|
|
9
10
|
|
|
10
11
|
//Nested objects helpers
|
|
11
|
-
setNested: () =>
|
|
12
|
-
getNested: () =>
|
|
13
|
-
|
|
12
|
+
setNested: (object: Object, key: `${string}.${string}`, value: any) => Object,
|
|
13
|
+
getNested: (object: Object, key: `${string}.${string}`, default_?: any) => any,
|
|
14
|
+
/**
|
|
15
|
+
* @example
|
|
16
|
+
* 1- initial data: `let data={items:{total:100,...}};`
|
|
17
|
+
* 2- input: `<input name="items[total]" value="new-value">`
|
|
18
|
+
* 3- getData as Object: `salla.helpers.inputData('items[total]', 'new-value', data)`
|
|
19
|
+
* 4- output: `{name: items: value:{total:[100, 'new-value'],...}}`
|
|
20
|
+
*/
|
|
21
|
+
inputData: (inputName: `${string}[${null | string | number}]`, inputValue: any, data?: Object) => { name: string, value: string | number | Object | string[] | number[] },
|
|
14
22
|
|
|
15
23
|
//Url helpers
|
|
16
|
-
url:
|
|
17
|
-
addParamToUrl: () => string,
|
|
24
|
+
url: UrlHelper,
|
|
25
|
+
addParamToUrl: (key: string, value: string | number) => string, //`salla.helpers.addParamToUrl('lang','ar')` => `https://store_domain.com/cart?lang=ar`
|
|
18
26
|
|
|
19
|
-
//
|
|
20
|
-
debounce: () =>
|
|
27
|
+
//for advance usage:
|
|
28
|
+
debounce: (callback: Function, delay: number) => (...[]) => Promise<unknown>,
|
|
21
29
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,99 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {Price} from "./common";
|
|
5
|
-
import {SallaHelpers} from "./helpers/salla-helpers";
|
|
6
|
-
import CartEvent from "./event/cart";
|
|
7
|
-
import CouponEvent from "./event/coupon";
|
|
8
|
-
import CouponApi from "./api/coupon";
|
|
9
|
-
import AuthApi from "./api/auth";
|
|
10
|
-
import AuthEvent from "./event/auth";
|
|
11
|
-
import OrderApi from "./api/order";
|
|
12
|
-
import OrderEvent from "./event/order";
|
|
13
|
-
import ProfileApi from "./api/profile";
|
|
14
|
-
import ProfileEvent from "./event/profile";
|
|
1
|
+
import SallaApi, {ApiActionName} from './api';
|
|
2
|
+
import SallaEvent from './event';
|
|
3
|
+
import SallaActions from "./actions";
|
|
15
4
|
|
|
16
|
-
|
|
5
|
+
import SallaConfig from "./lib/salla-config";
|
|
6
|
+
import {Price} from "./common";
|
|
7
|
+
import SallaHelpers, {UrlHelper} from "./helpers/salla-helpers";
|
|
8
|
+
import AppHelpers from "./helpers/app-helpers";
|
|
9
|
+
import SallaNotify, {Logger} from "./lib/salla-notify";
|
|
10
|
+
import SallaStorage from "./lib/salla-storage";
|
|
11
|
+
import SallaLang from "./lib/salla-lang";
|
|
12
|
+
import SallaCookie from "./lib/salla-cookie";
|
|
13
|
+
import SallaForm from "./lib/salla-form";
|
|
17
14
|
|
|
18
|
-
export default interface Salla {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
cart: CartApi,
|
|
22
|
-
auth: AuthApi;
|
|
23
|
-
gift: any;
|
|
24
|
-
order: OrderApi;
|
|
25
|
-
offer: any;
|
|
26
|
-
search: any;
|
|
27
|
-
coupon: CouponApi;
|
|
28
|
-
comment: any;
|
|
29
|
-
loyalty: any;
|
|
30
|
-
product: any;
|
|
31
|
-
profile: ProfileApi;
|
|
32
|
-
currency: any;
|
|
33
|
-
document: any;
|
|
34
|
-
feedback: any;
|
|
35
|
-
twilight: any;
|
|
36
|
-
wishlist: any;
|
|
37
|
-
getHeaders: () => {
|
|
38
|
-
"Accept": string | 'application/json, text/plain, */*',
|
|
39
|
-
"X-Requested-With": 'XMLHttpRequest',
|
|
40
|
-
"S-SOURCE": 'twilight',
|
|
41
|
-
"Store-Identifier"?: number,
|
|
42
|
-
"currency"?: string | 'SAR',
|
|
43
|
-
"accept-language"?: string | 'ar',
|
|
44
|
-
"Authorization"?: string
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
event: {
|
|
48
|
-
auth: AuthEvent,
|
|
49
|
-
cart: CartEvent,
|
|
50
|
-
gift: any;
|
|
51
|
-
order: OrderEvent;
|
|
52
|
-
offer: any;
|
|
53
|
-
search: any;
|
|
54
|
-
coupon: CouponEvent;
|
|
55
|
-
comment: any;
|
|
56
|
-
loyalty: any;
|
|
57
|
-
product: any;
|
|
58
|
-
profile: ProfileEvent;
|
|
59
|
-
currency: any;
|
|
60
|
-
document: any;
|
|
61
|
-
feedback: any;
|
|
62
|
-
twilight: any;
|
|
63
|
-
wishlist: any;
|
|
15
|
+
export default interface Salla extends SallaActions {
|
|
16
|
+
api: SallaApi;
|
|
17
|
+
event: SallaEvent;
|
|
64
18
|
|
|
65
|
-
};
|
|
66
|
-
infiniteScroll: any;
|
|
67
|
-
helpers: SallaHelpers;
|
|
68
19
|
config: SallaConfig;
|
|
69
|
-
storage:
|
|
70
|
-
|
|
20
|
+
storage: SallaStorage;
|
|
21
|
+
cookie: SallaCookie;
|
|
22
|
+
lang: SallaLang;
|
|
71
23
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
order: OrderApi & { api: OrderApi, event: OrderEvent };
|
|
77
|
-
offer: { api: any, event: any };
|
|
78
|
-
search: { api: any, event: any };
|
|
79
|
-
coupon: CouponApi & { api: CouponApi, event: CouponEvent };
|
|
80
|
-
comment: { api: any, event: any };
|
|
81
|
-
loyalty: { api: any, event: any };
|
|
82
|
-
product: { api: any, event: any };
|
|
83
|
-
profile: ProfileApi & { api: ProfileApi, event: ProfileEvent };
|
|
84
|
-
currency: { api: any, event: any };
|
|
85
|
-
document: { api: any, event: any };
|
|
86
|
-
feedback: { api: any, event: any };
|
|
87
|
-
twilight: { api: any, event: any };
|
|
88
|
-
wishlist: { api: any, event: any };
|
|
24
|
+
notify: SallaNotify;
|
|
25
|
+
log: Logger;
|
|
26
|
+
success: (message: string, data?: any) => void;
|
|
27
|
+
error: (message: string, data?: any) => void;
|
|
89
28
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
lang: any;
|
|
94
|
-
onReady: any; //don't relay on it because Salla may not existed yet
|
|
95
|
-
AppHelpers: any;
|
|
29
|
+
helpers: SallaHelpers;
|
|
30
|
+
AppHelpers: AppHelpers;
|
|
31
|
+
form: SallaForm;
|
|
96
32
|
money: (money: number | Price) => string;
|
|
33
|
+
url: UrlHelper;
|
|
34
|
+
|
|
35
|
+
onReady: (callback: (event: Event) => unknown) => void; //don't relay on it because Salla may not existed yet
|
|
36
|
+
init: (config: SallaConfig) => void; // an alias for `salla.twilight.init(config)`
|
|
37
|
+
call: (action: ApiActionName | string) => any;
|
|
97
38
|
}
|
|
98
39
|
|
|
99
40
|
declare global {
|
|
@@ -1,12 +1,50 @@
|
|
|
1
|
-
import {TwilightConfig} from "../tiwlight-config";
|
|
2
|
-
import {Price} from "../common";
|
|
1
|
+
import {Language, TwilightConfig} from "../tiwlight-config";
|
|
2
|
+
import {Currency, Nullable, Price} from "../common";
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type ConfigKey =
|
|
5
|
+
'_token'
|
|
6
|
+
| 'maintenance'
|
|
7
|
+
| 'debug'
|
|
8
|
+
| 'events'
|
|
9
|
+
| 'store.url'
|
|
10
|
+
| 'store.id'
|
|
11
|
+
| 'store.logo'
|
|
12
|
+
| 'store.name'
|
|
13
|
+
| 'store.api'
|
|
14
|
+
| 'user.type'
|
|
15
|
+
| 'user.email'
|
|
16
|
+
| 'user.mobile'
|
|
17
|
+
| 'user.language_code'
|
|
18
|
+
| 'user.currency_code'
|
|
19
|
+
| 'user.country_code'
|
|
20
|
+
| 'theme.name'
|
|
21
|
+
| 'theme.mode'
|
|
22
|
+
| 'theme.translations_hash'
|
|
23
|
+
| 'theme.color'
|
|
24
|
+
| 'theme.color.primary'
|
|
25
|
+
| 'theme.color.text'
|
|
26
|
+
| 'theme.color.is_dark'
|
|
27
|
+
| 'theme.color.reverse_primary'
|
|
28
|
+
| 'theme.color.reverse_text'
|
|
29
|
+
| 'languages.ar'
|
|
30
|
+
| 'languages.en'
|
|
31
|
+
| '`languages.${string}`'
|
|
32
|
+
| 'currencies.SAR'
|
|
33
|
+
| 'currencies.USD'
|
|
34
|
+
| '`currencies.${string}`'
|
|
35
|
+
| 'page.title'
|
|
36
|
+
| 'page.slug'
|
|
37
|
+
| 'page.id';
|
|
38
|
+
export default interface SallaConfig {
|
|
5
39
|
merge: (config: TwilightConfig) => SallaConfig;
|
|
6
|
-
set: (key: string, value: string) => SallaConfig;
|
|
7
|
-
get: (key: string, default_?: any) => any;
|
|
40
|
+
set: (key: ConfigKey | string, value: string) => SallaConfig;
|
|
41
|
+
get: (key: ConfigKey | string, default_?: any) => any;
|
|
8
42
|
isRTL: () => boolean;
|
|
9
43
|
money: (money: number | Price) => string;
|
|
10
44
|
isUser: () => boolean;
|
|
11
45
|
isGuest: () => boolean;
|
|
46
|
+
languageCode: () => string | 'ar';
|
|
47
|
+
currency: (code: Nullable<string | 'SAR'>) => Currency;
|
|
48
|
+
currencies: () => Promise<{ SAR: Currency, [code: string]: Currency }>;
|
|
49
|
+
languages: () => Promise<{ ar: Language, [code: string]: Language }>;
|
|
12
50
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Lang from 'lang.js'
|
|
2
|
+
|
|
3
|
+
type Replacements = { [key: string]: string }
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @Example
|
|
7
|
+
* salla.lang.get('pages.cart.free_shipping_alert',{amount:salla.money(100)})
|
|
8
|
+
*/
|
|
9
|
+
export default interface SallaLang extends Lang {
|
|
10
|
+
translationsLoaded: boolean;
|
|
11
|
+
onLoaded: (callback: Function) => void;
|
|
12
|
+
get: (key: string, replacements?: Replacements, locale?: string | 'ar') => string;
|
|
13
|
+
set: (key: string, message: string) => SallaLang;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type NotifyType = 'error' | 'success' | 'info' | string;
|
|
2
|
+
export type Notifier = (message: string, type: NotifyType, data?: object | any) => void | unknown;
|
|
3
|
+
export type Logger = (...data: string[]) => void | unknown;
|
|
4
|
+
export default interface SallaNotify {
|
|
5
|
+
fire: (message: string, type: NotifyType, data?: object | any) => Notifier; //default is just `alert(message)
|
|
6
|
+
setNotifier: (callback: Notifier) => void;// handy to override notifier used by salla.notify.fire(salla.success, salla.error, salla.info)
|
|
7
|
+
log: Logger; //default is just `console.log(...data)`
|
|
8
|
+
setLogger: (callback: Logger) => void;// handy to override logger used by salla.log()
|
|
9
|
+
error: (message: string, data?: object | any) => Notifier; //an alias for fire(message, salla.notify.types.error, data)
|
|
10
|
+
success: (message: string, data?: object | any) => Notifier; //an alias for fire(message, salla.notify.types.success, data)
|
|
11
|
+
info: (message: string, data?: object | any) => Notifier; //an alias for fire(message, salla.notify.types.info, data)
|
|
12
|
+
sallaInitiated;
|
|
13
|
+
types: { error: 'error', success: 'success', info: 'info' }; //handy to be overridden, to be passed via salla.error, salla.info, salla.success second argument when calling salla.notify.fire(message, /*{type}*/, data)
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import localStore from 'store';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 💡 Notice that you can use dotted key for setting or getting values, ex:
|
|
5
|
+
* - salla.storage.set('cart.id',1)
|
|
6
|
+
* - `salla.storage.get('cart.id')` or `salla.storage.get('cart')?.id`
|
|
7
|
+
*/
|
|
8
|
+
export default interface SallaStorage {
|
|
9
|
+
store: localStore;
|
|
10
|
+
set: (key: string, value: any) => any;
|
|
11
|
+
get: (key: string, defaultValue?: any) => any | undefined;
|
|
12
|
+
remove: (key: string) => void;
|
|
13
|
+
}
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
id: number;
|
|
3
|
-
logo: string;
|
|
4
|
-
name: string;
|
|
5
|
-
url: string;
|
|
6
|
-
api: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface User {
|
|
10
|
-
type: string;
|
|
11
|
-
email?: any;
|
|
12
|
-
mobile?: any;
|
|
13
|
-
language: string;
|
|
14
|
-
currency: string;
|
|
15
|
-
country_code: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface Theme {
|
|
19
|
-
name: string;
|
|
20
|
-
mode: string;
|
|
21
|
-
translations_hash: string;
|
|
22
|
-
}
|
|
1
|
+
import {Currency} from "./common";
|
|
23
2
|
|
|
24
3
|
export interface Language {
|
|
25
4
|
name: string;
|
|
@@ -29,41 +8,62 @@ export interface Language {
|
|
|
29
8
|
country_code: string;
|
|
30
9
|
}
|
|
31
10
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[key: string]: Language;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface Currency {
|
|
39
|
-
code: string;
|
|
40
|
-
name: string;
|
|
41
|
-
symbol: string;
|
|
42
|
-
amount: number;
|
|
43
|
-
country_code: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface Currencies {
|
|
47
|
-
SAR: Currency;
|
|
48
|
-
|
|
49
|
-
[key: string]: Currency;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface Page {
|
|
53
|
-
title: string;
|
|
54
|
-
slug: string;
|
|
55
|
-
id?: number;
|
|
56
|
-
}
|
|
11
|
+
type Installment = 'tabby_installment' | 'tamara_installment' | 'spotii_pay';
|
|
12
|
+
type PaymentName = Installment | 'mada' | 'credit_card' | 'paypal' | 'bank' | 'stc_pay' | 'apple_pay' | 'knet';
|
|
57
13
|
|
|
58
14
|
export interface TwilightConfig {
|
|
59
|
-
_token
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
15
|
+
_token?: string;
|
|
16
|
+
maintenance?: boolean;
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
events?: { [event_name: string]: any };
|
|
19
|
+
store: {
|
|
20
|
+
url: string;
|
|
21
|
+
id?: number;
|
|
22
|
+
logo?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
api?: string;
|
|
25
|
+
settings?: {
|
|
26
|
+
auth: {
|
|
27
|
+
email_allowed: boolean;
|
|
28
|
+
mobile_allowed: boolean;
|
|
29
|
+
is_email_required: boolean;
|
|
30
|
+
};
|
|
31
|
+
arabic_numbers_enabled: boolean;
|
|
32
|
+
payments: PaymentName[];
|
|
33
|
+
installments: Installment[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
user?: {
|
|
37
|
+
type?: 'user' | 'guest';
|
|
38
|
+
email?: any;
|
|
39
|
+
mobile?: any;
|
|
40
|
+
language_code?: string;
|
|
41
|
+
currency_code?: string;
|
|
42
|
+
country_code?: string;
|
|
43
|
+
};
|
|
44
|
+
theme?: {
|
|
45
|
+
name?: string;
|
|
46
|
+
mode?: string;
|
|
47
|
+
translations_hash?: string;
|
|
48
|
+
color?: {
|
|
49
|
+
primary: string | '#5cd5c4';
|
|
50
|
+
text: string | '#ffffff';
|
|
51
|
+
is_dark: boolean;
|
|
52
|
+
reverse_primary: string | '#5cd5c4';
|
|
53
|
+
reverse_text: string | '#005544';
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
languages?: {
|
|
57
|
+
ar?: Language;
|
|
58
|
+
[key: string]: Language;
|
|
59
|
+
};
|
|
60
|
+
currencies?: {
|
|
61
|
+
SAR?: Currency;
|
|
62
|
+
[key: string]: Currency;
|
|
63
|
+
};
|
|
64
|
+
page?: {
|
|
65
|
+
title?: string;
|
|
66
|
+
slug?: string;
|
|
67
|
+
id?: number;//available in product.single, customer.orders.single, cart, thank-you, page-single
|
|
68
|
+
};
|
|
69
69
|
}
|