-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
200 lines (167 loc) · 5.28 KB
/
index.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
export type ServerList = "skyblock-bungee-1" | "skyblock-bungee-2" | "skyblock-bungee-3" | "skyblock-hub-1" | "skyblock-hub-2" | "skyblock-skyblock" | "skyblock-economy" | "skyblock-classic" | "skyblock" | "skyblock-events" | "skywars" | "mineverse" | "skyblock-beta"
export type ShortUpdatedServerList = "skyblock" | "economy"
export type ServerCount = {
result: number
}
export type ServerInfo = {
online: boolean,
players_online: string,
max_players: string,
player_list: string[]
}
export type FriendsByID = {
success: boolean,
player: object,
married: boolean,
friends: object,
}
export type SearchResult = {
users: SearchResultUser[],
_error?: string,
}
export type SearchResultUser = {
username: string,
id: string
}
export type PlayerData = {
uuid: string;
last_username: string;
last_username_pretty: string;
info: {
last_joined: number;
first_joined: number;
last_seen: number;
};
};
export type Player = {
online: boolean;
forums_user_id: number;
data: PlayerData;
};
export type DownloadStats = {
key: string;
downloads: number;
id: string;
}
export type ForumStats = {
discussions: number;
messages: number;
members: number;
latestMember: { username: string, id: number };
mostOnlineUsers: number;
}
export type Staff = {
uuid: string;
position: string;
since: string;
username: string;
}
export type UserInfo = {
error?: string;
username?: string;
title?: string;
lastActivity?: string;
joined?: string;
messageCount?: number;
trophyPoints?: number;
positiveReactions?: number;
neutralReactions?: number;
negativeReactions?: number;
homepage?: string | null;
location?: string | null;
occupation?: string | null;
gender?: string | null;
previousNames?: string[];
description?: string;
}
export type TraderItem = {
item: string;
maximumAmount: number;
maximumAmountPerPlayer: number;
value: number;
}
export type Traders = {
entityId: number;
active: boolean;
sellable: TraderItem[];
buyable: TraderItem[];
}
/**
* @description Returns a player list of skywars
* @example skyblock.skywars().then(result => console.log(result))
*/
export function skywars(): Promise<ServerInfo>
/**
* @description Returns a player list of economy
* @example skyblock.economy().then(result => console.log(result))
*/
export function economy(): Promise<ServerInfo>
/**
* @description Returns a player list of survival
* @example skyblock.survival().then(result => console.log(result))
*
*/
export function survival(): Promise<ServerInfo>
/**
* @description Returns a player count of specific server
* @example skyblock.playerCount().then(result => console.log(result))
*/
export function playerCount(server: ServerList): Promise<ServerCount>
/**
* @description Returns forum statistics
* @example skyblock.getForumStats().then(result => console.log(result))
*/
export function getForumStats(): Promise<ForumStats | {}>
/**
* @description Returns a friend list by forums id
* @example skyblock.friendsByForumsID("1").then(result => console.log(result))
*/
export function friendsByForumsID(forums_id: string): Promise<FriendsByID>
/**
* @description Returns a friend list by minecraft username
* @example skyblock.friendsByIGN("NoobCrew").then(result => console.log(result))
*/
export function friendsByIGN(name: string): Promise<FriendsByID>
/**
* @description Returns a friend list by UUID
* @example skyblock.friendsByUUID("1ba2d16f-3d11-4a1f-b214-09e83906e6b5").then(result => console.log(result))
*/
export function friendsByUUID(uuid: string): Promise<FriendsByID>
/**
* @description Returns a list of forum members with the search query
* @example skyblock.forumsSearch("NoobCrew").then(result => console.log(result))
*/
export function forumsSearch(query: string): Promise<SearchResult>
/**
* @description Returns in game information for specified name
* @example skyblock.player("NoobCrew").then(result => console.log(result))
*/
export function player(name: string): Promise<Player>
/**
* @description Returns the uuid of specified username
* @example skyblock.getUUID("NoobCrew").then(result => console.log(result))
*/
export function getUUID(name: string): Promise<string>
/**
* @description Returns the skyblock download statistics
* @example skyblock.getDownloadStats().then(result => console.log(result))
*/
export function getDownloadStats(): Promise<DownloadStats[]>
/**
* @description Returns list of staff members
* @example skyblock.getStaff().then(result => console.log(result))
*/
export function getStaff(): Promise<Staff[]>
/**
* @description Returns the user in skyblock's API
* @example skyblock.playerByUUID("1ba2d16f-3d11-4a1f-b214-09e83906e6b5").then(result => console.log(result))
*/
export function playerByUUID(uuid: string): Promise<Player>
/**
* @description Return's the user's forum information
* @example skyblock.forumsUserInfo("1").then(result => console.log(result))
*/
export function forumsUserInfo(id: string): Promise<UserInfo>
export function getTraders(server: ShortUpdatedServerList): Promise<Traders?>
export function UUIDToName(_uuid: string): Promise<string?>
export function getAvatarURLFromForumsID(id: string | Number): string