Skip to content

Commit cb6d177

Browse files
chore: Convert some leaf nodes to TS (#4073)
1 parent b62eb5e commit cb6d177

File tree

9 files changed

+56
-4
lines changed

9 files changed

+56
-4
lines changed
File renamed without changes.

app/utils/dictionary/demography.js renamed to app/utils/dictionary/demography.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* Using a lean list of countries instead of an external dependency.
33
* All the libraries have a lot of extra data which is of no use to us at this point and unnecessarily takes up more space.
4-
*
5-
* @type {[*]}
64
*/
75
export const countries = [
86
{
File renamed without changes.

app/utils/dictionary/filters.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export const getDateRanges = function(this: any) {
2+
return [
3+
{
4+
name : this.l10n.t('All Dates'),
5+
key : 'all_dates'
6+
},
7+
{
8+
name : this.l10n.t('Today'),
9+
key : 'today'
10+
},
11+
{
12+
name : this.l10n.t('Tomorrow'),
13+
key : 'tomorrow'
14+
},
15+
{
16+
name : this.l10n.t('This week'),
17+
key : 'this_week'
18+
},
19+
{
20+
name : this.l10n.t('This Weekend'),
21+
key : 'this_weekend'
22+
},
23+
{
24+
name : this.l10n.t('Next week'),
25+
key : 'next_week'
26+
},
27+
{
28+
name : this.l10n.t('This Month'),
29+
key : 'this_month'
30+
},
31+
{
32+
name : this.l10n.t('Custom dates'),
33+
key : 'custom_dates'
34+
}
35+
];
36+
};
File renamed without changes.
File renamed without changes.

app/utils/dictionary/licenses.js renamed to app/utils/dictionary/licenses.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
export const licenses = [
1+
export interface License {
2+
name: string,
3+
link: string,
4+
imageSrc: string,
5+
logoUrl: string | null
6+
}
7+
8+
export const licenses: License[] = [
29
{
310
name : 'Attribution-NonCommercial-NoDerivs',
411
link : 'https://creativecommons.org/licenses/by-nc-nd/4.0',

app/utils/dictionary/payment.js renamed to app/utils/dictionary/payment.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
export const paymentCountries = ['US', 'AL', 'AR', 'AU', 'AT', 'BE', 'BR', 'CA', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HK', 'HU', 'IE', 'IL', 'IN', 'IT', 'JP', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NO', 'PH', 'PL', 'PT', 'SG', 'SK', 'SI', 'ES', 'SE', 'CH', 'TW', 'GB'];
22

3-
export const paymentCurrencies = [
3+
export interface PaymentCurrency {
4+
code: string,
5+
symbol: string,
6+
name: string,
7+
paypal: boolean,
8+
stripe: boolean,
9+
alipay: boolean,
10+
omise: boolean,
11+
paytm: boolean
12+
}
13+
14+
export const paymentCurrencies: PaymentCurrency[] = [
415
{
516
paypal : true,
617
code : 'PLN',

0 commit comments

Comments
 (0)