osrs-json-hiscores 2.14.1 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,245 +1,257 @@
1
- "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
3
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4
- to[j] = from[i];
5
- return to;
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.INVALID_FORMAT_ERROR = exports.FORMATTED_RIFTS_CLOSED = exports.FORMATTED_LEAGUE_POINTS = exports.FORMATTED_SOUL_WARS = exports.FORMATTED_PVP_ARENA = exports.FORMATTED_LMS = exports.FORMATTED_BH_NAMES = exports.FORMATTED_CLUE_NAMES = exports.FORMATTED_SKILL_NAMES = exports.FORMATTED_BOSS_NAMES = exports.ACTIVITIES = exports.BOSSES = exports.GAMEMODES = exports.BH_MODES = exports.CLUES = exports.SKILLS = exports.GAMEMODE_URL = exports.SCORES_URL = exports.STATS_URL = exports.BASE_URL = void 0;
9
- exports.BASE_URL = 'https://secure.runescape.com/m=hiscore_oldschool';
10
- exports.STATS_URL = 'index_lite.ws?player=';
11
- exports.SCORES_URL = 'overall.ws?';
12
- exports.GAMEMODE_URL = {
13
- main: exports.BASE_URL + "/",
14
- ironman: exports.BASE_URL + "_ironman/",
15
- hardcore: exports.BASE_URL + "_hardcore_ironman/",
16
- ultimate: exports.BASE_URL + "_ultimate/",
17
- deadman: exports.BASE_URL + "_deadman/",
18
- seasonal: exports.BASE_URL + "_seasonal/",
19
- tournament: exports.BASE_URL + "_tournament/",
20
- skiller: exports.BASE_URL + "_skiller/",
21
- oneDefence: exports.BASE_URL + "_skiller_defence/",
22
- freshStart: exports.BASE_URL + "_fresh_start/"
23
- };
24
- exports.SKILLS = [
25
- 'overall',
26
- 'attack',
27
- 'defence',
28
- 'strength',
29
- 'hitpoints',
30
- 'ranged',
31
- 'prayer',
32
- 'magic',
33
- 'cooking',
34
- 'woodcutting',
35
- 'fletching',
36
- 'fishing',
37
- 'firemaking',
38
- 'crafting',
39
- 'smithing',
40
- 'mining',
41
- 'herblore',
42
- 'agility',
43
- 'thieving',
44
- 'slayer',
45
- 'farming',
46
- 'runecraft',
47
- 'hunter',
48
- 'construction'
49
- ];
50
- exports.CLUES = [
51
- 'all',
52
- 'beginner',
53
- 'easy',
54
- 'medium',
55
- 'hard',
56
- 'elite',
57
- 'master'
58
- ];
59
- exports.BH_MODES = ['hunterV2', 'rogueV2', 'hunter', 'rogue'];
60
- exports.GAMEMODES = [
61
- 'main',
62
- 'ironman',
63
- 'hardcore',
64
- 'ultimate',
65
- 'deadman',
66
- 'seasonal',
67
- 'tournament'
68
- ];
69
- exports.BOSSES = [
70
- 'abyssalSire',
71
- 'alchemicalHydra',
72
- 'artio',
73
- 'barrows',
74
- 'bryophyta',
75
- 'callisto',
76
- 'calvarion',
77
- 'cerberus',
78
- 'chambersOfXeric',
79
- 'chambersOfXericChallengeMode',
80
- 'chaosElemental',
81
- 'chaosFanatic',
82
- 'commanderZilyana',
83
- 'corporealBeast',
84
- 'crazyArchaeologist',
85
- 'dagannothPrime',
86
- 'dagannothRex',
87
- 'dagannothSupreme',
88
- 'derangedArchaeologist',
89
- 'generalGraardor',
90
- 'giantMole',
91
- 'grotesqueGuardians',
92
- 'hespori',
93
- 'kalphiteQueen',
94
- 'kingBlackDragon',
95
- 'kraken',
96
- 'kreeArra',
97
- 'krilTsutsaroth',
98
- 'mimic',
99
- 'nex',
100
- 'nightmare',
101
- 'phosanisNightmare',
102
- 'obor',
103
- 'phantomMuspah',
104
- 'sarachnis',
105
- 'scorpia',
106
- 'skotizo',
107
- 'spindel',
108
- 'tempoross',
109
- 'gauntlet',
110
- 'corruptedGauntlet',
111
- 'theatreOfBlood',
112
- 'theatreOfBloodHardMode',
113
- 'thermonuclearSmokeDevil',
114
- 'tombsOfAmascut',
115
- 'tombsOfAmascutExpertMode',
116
- 'tzKalZuk',
117
- 'tzTokJad',
118
- 'venenatis',
119
- 'vetion',
120
- 'vorkath',
121
- 'wintertodt',
122
- 'zalcano',
123
- 'zulrah'
124
- ];
125
- exports.ACTIVITIES = __spreadArray([
126
- 'leaguePoints',
127
- 'hunterBHV2',
128
- 'rogueBHV2',
129
- 'hunterBH',
130
- 'rogueBH',
131
- 'allClues',
132
- 'beginnerClues',
133
- 'easyClues',
134
- 'mediumClues',
135
- 'hardClues',
136
- 'eliteClues',
137
- 'masterClues',
138
- 'lastManStanding',
139
- 'pvpArena',
140
- 'soulWarsZeal',
141
- 'riftsClosed'
142
- ], exports.BOSSES);
143
- exports.FORMATTED_BOSS_NAMES = {
144
- abyssalSire: 'Abyssal Sire',
145
- alchemicalHydra: 'Alchemical Hydra',
146
- artio: 'Artio',
147
- barrows: 'Barrows Chests',
148
- bryophyta: 'Bryophyta',
149
- callisto: 'Callisto',
150
- calvarion: "Calvar'ion",
151
- cerberus: 'Cerberus',
152
- chambersOfXeric: 'Chambers of Xeric',
153
- chambersOfXericChallengeMode: 'Chambers of Xeric: Challenge Mode',
154
- chaosElemental: 'Chaos Elemental',
155
- chaosFanatic: 'Chaos Fanatic',
156
- commanderZilyana: 'Commander Zilyana',
157
- corporealBeast: 'Corporeal Beast',
158
- crazyArchaeologist: 'Crazy Archaeologist',
159
- dagannothPrime: 'Dagannoth Prime',
160
- dagannothRex: 'Dagannoth Rex',
161
- dagannothSupreme: 'Dagannoth Supreme',
162
- derangedArchaeologist: 'Deranged Archaeologist',
163
- generalGraardor: 'General Graardor',
164
- giantMole: 'Giant Mole',
165
- grotesqueGuardians: 'Grotesque Guardians',
166
- hespori: 'Hespori',
167
- kalphiteQueen: 'Kalphite Queen',
168
- kingBlackDragon: 'King Black Dragon',
169
- kraken: 'Kraken',
170
- kreeArra: "Kree'Arra",
171
- krilTsutsaroth: "K'ril Tsutsaroth",
172
- mimic: 'Mimic',
173
- nex: 'Nex',
174
- nightmare: 'The Nightmare of Ashihama',
175
- phosanisNightmare: "Phosani's Nightmare",
176
- obor: 'Obor',
177
- phantomMuspah: 'Phantom Muspah',
178
- sarachnis: 'Sarachnis',
179
- scorpia: 'Scorpia',
180
- skotizo: 'Skotizo',
181
- spindel: 'Spindel',
182
- tempoross: 'Tempoross',
183
- gauntlet: 'The Gauntlet',
184
- corruptedGauntlet: 'The Corrupted Gauntlet',
185
- theatreOfBlood: 'Theatre of Blood',
186
- theatreOfBloodHardMode: 'Theatre of Blood: Hard Mode',
187
- thermonuclearSmokeDevil: 'Thermonuclear Smoke Devil',
188
- tombsOfAmascut: 'Tombs of Amascut',
189
- tombsOfAmascutExpertMode: 'Tombs of Amascut: Expert Mode',
190
- tzKalZuk: 'TzKal-Zuk',
191
- tzTokJad: 'TzTok-Jad',
192
- venenatis: 'Venenatis',
193
- vetion: "Vet'ion",
194
- vorkath: 'Vorkath',
195
- wintertodt: 'Wintertodt',
196
- zalcano: 'Zalcano',
197
- zulrah: 'Zulrah'
198
- };
199
- exports.FORMATTED_SKILL_NAMES = {
200
- overall: 'Overall',
201
- attack: 'Attack',
202
- defence: 'Defence',
203
- strength: 'Strength',
204
- hitpoints: 'Hitpoints',
205
- ranged: 'Ranged',
206
- prayer: 'Prayer',
207
- magic: 'Magic',
208
- cooking: 'Cooking',
209
- woodcutting: 'Woodcutting',
210
- fletching: 'Fletching',
211
- fishing: 'Fishing',
212
- firemaking: 'Firemaking',
213
- crafting: 'Crafting',
214
- smithing: 'Smithing',
215
- mining: 'Mining',
216
- herblore: 'Herblore',
217
- agility: 'Agility',
218
- thieving: 'Thieving',
219
- slayer: 'Slayer',
220
- farming: 'Farming',
221
- runecraft: 'Runecraft',
222
- hunter: 'Hunter',
223
- construction: 'Construction'
224
- };
225
- exports.FORMATTED_CLUE_NAMES = {
226
- all: 'Clue Scrolls (all)',
227
- beginner: 'Clue Scrolls (beginner)',
228
- easy: 'Clue Scrolls (easy)',
229
- medium: 'Clue Scrolls (medium)',
230
- hard: 'Clue Scrolls (hard)',
231
- elite: 'Clue Scrolls (elite)',
232
- master: 'Clue Scrolls (master)'
233
- };
234
- exports.FORMATTED_BH_NAMES = {
235
- rogue: 'Bounty Hunter (Legacy) - Rogue',
236
- hunter: 'Bounty Hunter (Legacy) - Hunter',
237
- rogueV2: 'Bounty Hunter - Rogue',
238
- hunterV2: 'Bounty Hunter - Hunter'
239
- };
240
- exports.FORMATTED_LMS = 'Last Man Standing';
241
- exports.FORMATTED_PVP_ARENA = 'PvP Arena';
242
- exports.FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
243
- exports.FORMATTED_LEAGUE_POINTS = 'League Points';
244
- exports.FORMATTED_RIFTS_CLOSED = 'Rifts Closed';
245
- exports.INVALID_FORMAT_ERROR = 'Invalid hiscores format';
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.INVALID_FORMAT_ERROR = exports.FORMATTED_RIFTS_CLOSED = exports.FORMATTED_LEAGUE_POINTS = exports.FORMATTED_SOUL_WARS = exports.FORMATTED_PVP_ARENA = exports.FORMATTED_LMS = exports.FORMATTED_BH_NAMES = exports.FORMATTED_CLUE_NAMES = exports.FORMATTED_SKILL_NAMES = exports.FORMATTED_BOSS_NAMES = exports.ACTIVITIES = exports.BOSSES = exports.GAMEMODES = exports.BH_MODES = exports.CLUES = exports.SKILLS = exports.GAMEMODE_URL = exports.SCORES_URL = exports.STATS_URL = exports.BASE_URL = void 0;
13
+ exports.BASE_URL = 'https://secure.runescape.com/m=hiscore_oldschool';
14
+ exports.STATS_URL = 'index_lite.ws?player=';
15
+ exports.SCORES_URL = 'overall.ws?';
16
+ exports.GAMEMODE_URL = {
17
+ main: "".concat(exports.BASE_URL, "/"),
18
+ ironman: "".concat(exports.BASE_URL, "_ironman/"),
19
+ hardcore: "".concat(exports.BASE_URL, "_hardcore_ironman/"),
20
+ ultimate: "".concat(exports.BASE_URL, "_ultimate/"),
21
+ deadman: "".concat(exports.BASE_URL, "_deadman/"),
22
+ seasonal: "".concat(exports.BASE_URL, "_seasonal/"),
23
+ tournament: "".concat(exports.BASE_URL, "_tournament/"),
24
+ skiller: "".concat(exports.BASE_URL, "_skiller/"),
25
+ oneDefence: "".concat(exports.BASE_URL, "_skiller_defence/"),
26
+ freshStart: "".concat(exports.BASE_URL, "_fresh_start/")
27
+ };
28
+ exports.SKILLS = [
29
+ 'overall',
30
+ 'attack',
31
+ 'defence',
32
+ 'strength',
33
+ 'hitpoints',
34
+ 'ranged',
35
+ 'prayer',
36
+ 'magic',
37
+ 'cooking',
38
+ 'woodcutting',
39
+ 'fletching',
40
+ 'fishing',
41
+ 'firemaking',
42
+ 'crafting',
43
+ 'smithing',
44
+ 'mining',
45
+ 'herblore',
46
+ 'agility',
47
+ 'thieving',
48
+ 'slayer',
49
+ 'farming',
50
+ 'runecraft',
51
+ 'hunter',
52
+ 'construction'
53
+ ];
54
+ exports.CLUES = [
55
+ 'all',
56
+ 'beginner',
57
+ 'easy',
58
+ 'medium',
59
+ 'hard',
60
+ 'elite',
61
+ 'master'
62
+ ];
63
+ exports.BH_MODES = ['hunterV2', 'rogueV2', 'hunter', 'rogue'];
64
+ exports.GAMEMODES = [
65
+ 'main',
66
+ 'ironman',
67
+ 'hardcore',
68
+ 'ultimate',
69
+ 'deadman',
70
+ 'seasonal',
71
+ 'tournament'
72
+ ];
73
+ exports.BOSSES = [
74
+ 'abyssalSire',
75
+ 'alchemicalHydra',
76
+ 'artio',
77
+ 'barrows',
78
+ 'bryophyta',
79
+ 'callisto',
80
+ 'calvarion',
81
+ 'cerberus',
82
+ 'chambersOfXeric',
83
+ 'chambersOfXericChallengeMode',
84
+ 'chaosElemental',
85
+ 'chaosFanatic',
86
+ 'commanderZilyana',
87
+ 'corporealBeast',
88
+ 'crazyArchaeologist',
89
+ 'dagannothPrime',
90
+ 'dagannothRex',
91
+ 'dagannothSupreme',
92
+ 'derangedArchaeologist',
93
+ 'dukeSucellus',
94
+ 'generalGraardor',
95
+ 'giantMole',
96
+ 'grotesqueGuardians',
97
+ 'hespori',
98
+ 'kalphiteQueen',
99
+ 'kingBlackDragon',
100
+ 'kraken',
101
+ 'kreeArra',
102
+ 'krilTsutsaroth',
103
+ 'mimic',
104
+ 'nex',
105
+ 'nightmare',
106
+ 'phosanisNightmare',
107
+ 'obor',
108
+ 'phantomMuspah',
109
+ 'sarachnis',
110
+ 'scorpia',
111
+ 'skotizo',
112
+ 'spindel',
113
+ 'tempoross',
114
+ 'gauntlet',
115
+ 'corruptedGauntlet',
116
+ 'leviathan',
117
+ 'whisperer',
118
+ 'theatreOfBlood',
119
+ 'theatreOfBloodHardMode',
120
+ 'thermonuclearSmokeDevil',
121
+ 'tombsOfAmascut',
122
+ 'tombsOfAmascutExpertMode',
123
+ 'tzKalZuk',
124
+ 'tzTokJad',
125
+ 'vardorvis',
126
+ 'venenatis',
127
+ 'vetion',
128
+ 'vorkath',
129
+ 'wintertodt',
130
+ 'zalcano',
131
+ 'zulrah'
132
+ ];
133
+ exports.ACTIVITIES = __spreadArray([
134
+ 'leaguePoints',
135
+ 'hunterBHV2',
136
+ 'rogueBHV2',
137
+ 'hunterBH',
138
+ 'rogueBH',
139
+ 'allClues',
140
+ 'beginnerClues',
141
+ 'easyClues',
142
+ 'mediumClues',
143
+ 'hardClues',
144
+ 'eliteClues',
145
+ 'masterClues',
146
+ 'lastManStanding',
147
+ 'pvpArena',
148
+ 'soulWarsZeal',
149
+ 'riftsClosed'
150
+ ], exports.BOSSES, true);
151
+ exports.FORMATTED_BOSS_NAMES = {
152
+ abyssalSire: 'Abyssal Sire',
153
+ alchemicalHydra: 'Alchemical Hydra',
154
+ artio: 'Artio',
155
+ barrows: 'Barrows Chests',
156
+ bryophyta: 'Bryophyta',
157
+ callisto: 'Callisto',
158
+ calvarion: "Calvar'ion",
159
+ cerberus: 'Cerberus',
160
+ chambersOfXeric: 'Chambers of Xeric',
161
+ chambersOfXericChallengeMode: 'Chambers of Xeric: Challenge Mode',
162
+ chaosElemental: 'Chaos Elemental',
163
+ chaosFanatic: 'Chaos Fanatic',
164
+ commanderZilyana: 'Commander Zilyana',
165
+ corporealBeast: 'Corporeal Beast',
166
+ crazyArchaeologist: 'Crazy Archaeologist',
167
+ dagannothPrime: 'Dagannoth Prime',
168
+ dagannothRex: 'Dagannoth Rex',
169
+ dagannothSupreme: 'Dagannoth Supreme',
170
+ derangedArchaeologist: 'Deranged Archaeologist',
171
+ dukeSucellus: 'Duke Sucellus',
172
+ generalGraardor: 'General Graardor',
173
+ giantMole: 'Giant Mole',
174
+ grotesqueGuardians: 'Grotesque Guardians',
175
+ hespori: 'Hespori',
176
+ kalphiteQueen: 'Kalphite Queen',
177
+ kingBlackDragon: 'King Black Dragon',
178
+ kraken: 'Kraken',
179
+ kreeArra: "Kree'Arra",
180
+ krilTsutsaroth: "K'ril Tsutsaroth",
181
+ mimic: 'Mimic',
182
+ nex: 'Nex',
183
+ nightmare: 'The Nightmare of Ashihama',
184
+ phosanisNightmare: "Phosani's Nightmare",
185
+ obor: 'Obor',
186
+ phantomMuspah: 'Phantom Muspah',
187
+ sarachnis: 'Sarachnis',
188
+ scorpia: 'Scorpia',
189
+ skotizo: 'Skotizo',
190
+ spindel: 'Spindel',
191
+ tempoross: 'Tempoross',
192
+ gauntlet: 'The Gauntlet',
193
+ corruptedGauntlet: 'The Corrupted Gauntlet',
194
+ leviathan: 'The Leviathan',
195
+ whisperer: 'The Whisperer',
196
+ theatreOfBlood: 'Theatre of Blood',
197
+ theatreOfBloodHardMode: 'Theatre of Blood: Hard Mode',
198
+ thermonuclearSmokeDevil: 'Thermonuclear Smoke Devil',
199
+ tombsOfAmascut: 'Tombs of Amascut',
200
+ tombsOfAmascutExpertMode: 'Tombs of Amascut: Expert Mode',
201
+ tzKalZuk: 'TzKal-Zuk',
202
+ tzTokJad: 'TzTok-Jad',
203
+ vardorvis: 'Vardorvis',
204
+ venenatis: 'Venenatis',
205
+ vetion: "Vet'ion",
206
+ vorkath: 'Vorkath',
207
+ wintertodt: 'Wintertodt',
208
+ zalcano: 'Zalcano',
209
+ zulrah: 'Zulrah'
210
+ };
211
+ exports.FORMATTED_SKILL_NAMES = {
212
+ overall: 'Overall',
213
+ attack: 'Attack',
214
+ defence: 'Defence',
215
+ strength: 'Strength',
216
+ hitpoints: 'Hitpoints',
217
+ ranged: 'Ranged',
218
+ prayer: 'Prayer',
219
+ magic: 'Magic',
220
+ cooking: 'Cooking',
221
+ woodcutting: 'Woodcutting',
222
+ fletching: 'Fletching',
223
+ fishing: 'Fishing',
224
+ firemaking: 'Firemaking',
225
+ crafting: 'Crafting',
226
+ smithing: 'Smithing',
227
+ mining: 'Mining',
228
+ herblore: 'Herblore',
229
+ agility: 'Agility',
230
+ thieving: 'Thieving',
231
+ slayer: 'Slayer',
232
+ farming: 'Farming',
233
+ runecraft: 'Runecraft',
234
+ hunter: 'Hunter',
235
+ construction: 'Construction'
236
+ };
237
+ exports.FORMATTED_CLUE_NAMES = {
238
+ all: 'Clue Scrolls (all)',
239
+ beginner: 'Clue Scrolls (beginner)',
240
+ easy: 'Clue Scrolls (easy)',
241
+ medium: 'Clue Scrolls (medium)',
242
+ hard: 'Clue Scrolls (hard)',
243
+ elite: 'Clue Scrolls (elite)',
244
+ master: 'Clue Scrolls (master)'
245
+ };
246
+ exports.FORMATTED_BH_NAMES = {
247
+ rogue: 'Bounty Hunter (Legacy) - Rogue',
248
+ hunter: 'Bounty Hunter (Legacy) - Hunter',
249
+ rogueV2: 'Bounty Hunter - Rogue',
250
+ hunterV2: 'Bounty Hunter - Hunter'
251
+ };
252
+ exports.FORMATTED_LMS = 'Last Man Standing';
253
+ exports.FORMATTED_PVP_ARENA = 'PvP Arena';
254
+ exports.FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
255
+ exports.FORMATTED_LEAGUE_POINTS = 'League Points';
256
+ exports.FORMATTED_RIFTS_CLOSED = 'Rifts Closed';
257
+ exports.INVALID_FORMAT_ERROR = 'Invalid hiscores format';
@@ -1,63 +1,63 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- import { Gamemode, SkillName, ActivityName } from '../types';
3
- /**
4
- * Will generate a stats URL for the official OSRS API.
5
- *
6
- * @param gamemode Gamemode to fetch ranks for.
7
- * @param rsn Username of the player.
8
- * @returns Encoded stats URL.
9
- */
10
- export declare const getStatsURL: (gamemode: Gamemode, rsn: string) => string;
11
- /**
12
- * Will generate a player table URL for the official OSRS hiscores website.
13
- *
14
- * @param gamemode Gamemode to fetch ranks for.
15
- * @param rsn Username of the player.
16
- * @returns Encoded player table URL.
17
- */
18
- export declare const getPlayerTableURL: (gamemode: Gamemode, rsn: string) => string;
19
- /**
20
- * Will generate a skill table URL for the official OSRS hiscores website.
21
- *
22
- * @param gamemode Gamemode to fetch ranks for.
23
- * @param skill Skill to fetch ranks for.
24
- * @param page Page number.
25
- * @returns
26
- */
27
- export declare const getSkillPageURL: (gamemode: Gamemode, skill: SkillName, page: number) => string;
28
- /**
29
- * Will generate an activity table URL for the official OSRS hiscores website.
30
- *
31
- * @param gamemode Gamemode to fetch ranks for.
32
- * @param activity Activity or boss to fetch ranks for.
33
- * @param page Page number.
34
- * @returns
35
- */
36
- export declare const getActivityPageURL: (gamemode: Gamemode, activity: ActivityName, page: number) => string;
37
- /**
38
- * Extracts a number from an OSRS hiscores table cell element.
39
- *
40
- * @param el OSRS hiscores table cell element.
41
- * @returns Number parsed from cell text.
42
- */
43
- export declare const numberFromElement: (el: Element | null) => number;
44
- /**
45
- * Extracts a RSN from an OSRS hiscores table cell element.
46
- *
47
- * @param el OSRS hiscores table cell element.
48
- * @returns RSN parsed from cell text.
49
- */
50
- export declare const rsnFromElement: (el: Element | null) => string;
51
- /**
52
- * Will run an Axios `GET` request against a given URL after injecting a `User-Agent` header.
53
- *
54
- * @param url URL to run a `GET` request against.
55
- * @returns Axios response.
56
- */
57
- export declare const httpGet: <Response_1>(url: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<Response_1>>;
58
- /**
59
- * Validates that a provided RSN has the same username restrictions as Jagex.
60
- * @param rsn Username to validate.
61
- * @throws Error if the RSN fails validation.
62
- */
63
- export declare const validateRSN: (rsn: string) => void;
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { Gamemode, SkillName, ActivityName } from '../types';
3
+ /**
4
+ * Will generate a stats URL for the official OSRS API.
5
+ *
6
+ * @param gamemode Gamemode to fetch ranks for.
7
+ * @param rsn Username of the player.
8
+ * @returns Encoded stats URL.
9
+ */
10
+ export declare const getStatsURL: (gamemode: Gamemode, rsn: string) => string;
11
+ /**
12
+ * Will generate a player table URL for the official OSRS hiscores website.
13
+ *
14
+ * @param gamemode Gamemode to fetch ranks for.
15
+ * @param rsn Username of the player.
16
+ * @returns Encoded player table URL.
17
+ */
18
+ export declare const getPlayerTableURL: (gamemode: Gamemode, rsn: string) => string;
19
+ /**
20
+ * Will generate a skill table URL for the official OSRS hiscores website.
21
+ *
22
+ * @param gamemode Gamemode to fetch ranks for.
23
+ * @param skill Skill to fetch ranks for.
24
+ * @param page Page number.
25
+ * @returns
26
+ */
27
+ export declare const getSkillPageURL: (gamemode: Gamemode, skill: SkillName, page: number) => string;
28
+ /**
29
+ * Will generate an activity table URL for the official OSRS hiscores website.
30
+ *
31
+ * @param gamemode Gamemode to fetch ranks for.
32
+ * @param activity Activity or boss to fetch ranks for.
33
+ * @param page Page number.
34
+ * @returns
35
+ */
36
+ export declare const getActivityPageURL: (gamemode: Gamemode, activity: ActivityName, page: number) => string;
37
+ /**
38
+ * Extracts a number from an OSRS hiscores table cell element.
39
+ *
40
+ * @param el OSRS hiscores table cell element.
41
+ * @returns Number parsed from cell text.
42
+ */
43
+ export declare const numberFromElement: (el: Element | null) => number;
44
+ /**
45
+ * Extracts a RSN from an OSRS hiscores table cell element.
46
+ *
47
+ * @param el OSRS hiscores table cell element.
48
+ * @returns RSN parsed from cell text.
49
+ */
50
+ export declare const rsnFromElement: (el: Element | null) => string;
51
+ /**
52
+ * Will run an Axios `GET` request against a given URL after injecting a `User-Agent` header.
53
+ *
54
+ * @param url URL to run a `GET` request against.
55
+ * @returns Axios response.
56
+ */
57
+ export declare const httpGet: <Response_1>(url: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<Response_1>>;
58
+ /**
59
+ * Validates that a provided RSN has the same username restrictions as Jagex.
60
+ * @param rsn Username to validate.
61
+ * @throws Error if the RSN fails validation.
62
+ */
63
+ export declare const validateRSN: (rsn: string) => void;