osrs-json-hiscores 2.14.0 → 2.14.2

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