-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
global.d.ts
123 lines (110 loc) · 2.4 KB
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
declare module NodeJS {
interface Global {
browser: import('puppeteer').Browser
}
}
interface Config {
prefix: string
token: string
minutes_per_check: number
seconds_between_check: number
url_params: {
[key:string]: string
}
guild_item_limit: number
cache_limit: number
required_perms: import('discord.js').PermissionResolvable[]
tld: string
auto_cart_link: boolean
debug_enabled: boolean
custom_chromium_exec: string
}
interface Command {
name: string
description: string
usage: string
type: string
run: (bot: import('discord.js').Client, message: import('discord.js').Message, args: string[]) => Promise<void>
}
interface NotificationData {
itemName: string
coupon: number
oldPrice: number
newPrice: number
symbol: string
priceLimit: number | null
pricePercentage: number | null
difference: number | null
link: string
image: string
guildId: string
channelId: string
}
interface PartialWatchlistItem {
guildId: string
channelId: string
priceLimit: number | null // Must be below this price
pricePercentage: number | null // Must be this percentage off or more
difference: number | null// Difference between prices must be this amount or more
symbol: string
type: 'link' | 'category' | 'query'
}
interface LinkItem extends PartialWatchlistItem {
link: string
lastPrice: number
itemName: string
}
interface CategoryItem extends PartialWatchlistItem {
name: string
link: string
cache: CategoryData[]
}
interface QueryItem extends PartialWatchlistItem {
query: string
cache: SearchData[]
}
type Watchlist = Array<LinkItem | CategoryItem | QueryItem>
interface SearchData {
fullTitle: string;
ratings: string;
coupon: number;
price: string;
lastPrice: number;
symbol: string;
sale: string;
asin: string;
fullLink: string;
image: string;
}
interface Category {
name: string;
link: string;
list: CategoryData[];
node: string;
}
interface CategoryData {
fullTitle: string;
fullLink: string;
asin: string;
price: string;
lastPrice: number;
symbol: string;
image: string;
node: null;
}
interface PartialProductInfo {
fullTitle: string;
fullLink: string;
asin: string;
price: string;
lastPrice: number;
symbol: string;
image: string;
}
interface ProductInfo extends PartialProductInfo {
seller: string;
shipping: string;
rating: string;
features: string[];
availability: string;
}