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.
package/lib/hiscores.d.ts CHANGED
@@ -1,43 +1,47 @@
1
- import { Player, Stats, Gamemode, SkillName, PlayerSkillRow, ActivityName, PlayerActivityRow, GetStatsOptions } from './types';
2
- /**
3
- * Screen scrapes the hiscores to get the formatted rsn of a player.
4
- *
5
- * @param rsn Username of the player.
6
- * @returns Formatted version of the rsn.
7
- */
8
- export declare function getRSNFormat(rsn: string): Promise<string>;
9
- /**
10
- * Parses CSV string of raw stats and returns a stats object.
11
- *
12
- * @param csv Raw CSV from the official OSRS API.
13
- * @returns Parsed stats object.
14
- */
15
- export declare function parseStats(csv: string): Stats;
16
- /**
17
- * Fetches stats from the OSRS API and consolidates the info into a player object.
18
- *
19
- * **Note:** This function will make up to 5 separate network requests.
20
- * As such, it is highly subject to the performance of the official OSRS API.
21
- *
22
- * @param rsn Username of the player.
23
- * @returns Player object.
24
- */
25
- export declare function getStats(rsn: string, options?: GetStatsOptions): Promise<Player>;
26
- /**
27
- * Fetches stats from the OSRS API and returns them as an object.
28
- *
29
- * @param rsn Username of the player.
30
- * @param mode Gamemode to fetch ranks for.
31
- * @returns Stats object.
32
- */
33
- export declare function getStatsByGamemode(rsn: string, mode?: Gamemode): Promise<Stats>;
34
- export declare function getSkillPage(skill: SkillName, mode?: Gamemode, page?: number): Promise<PlayerSkillRow[]>;
35
- /**
36
- * Screen scrapes a hiscores page of an activity or boss and returns an array of up to 25 players.
37
- *
38
- * @param activity Name of the activity or boss to fetch hiscores for.
39
- * @param mode Gamemode to fetch ranks for.
40
- * @param page Page number.
41
- * @returns Array of `PlayerActivityRow` objects.
42
- */
43
- export declare function getActivityPage(activity: ActivityName, mode?: Gamemode, page?: number): Promise<PlayerActivityRow[]>;
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { Player, Stats, Gamemode, SkillName, PlayerSkillRow, ActivityName, PlayerActivityRow, GetStatsOptions } from './types';
3
+ /**
4
+ * Screen scrapes the hiscores to get the formatted rsn of a player.
5
+ *
6
+ * @param rsn Username of the player.
7
+ * @param config Optional axios request config object.
8
+ * @returns Formatted version of the rsn.
9
+ */
10
+ export declare function getRSNFormat(rsn: string, config?: AxiosRequestConfig): Promise<string>;
11
+ /**
12
+ * Parses CSV string of raw stats and returns a stats object.
13
+ *
14
+ * @param csv Raw CSV from the official OSRS API.
15
+ * @returns Parsed stats object.
16
+ */
17
+ export declare function parseStats(csv: string): Stats;
18
+ /**
19
+ * Fetches stats from the OSRS API and consolidates the info into a player object.
20
+ *
21
+ * **Note:** This function will make up to 5 separate network requests.
22
+ * As such, it is highly subject to the performance of the official OSRS API.
23
+ *
24
+ * @param rsn Username of the player.
25
+ * @returns Player object.
26
+ */
27
+ export declare function getStats(rsn: string, options?: GetStatsOptions): Promise<Player>;
28
+ /**
29
+ * Fetches stats from the OSRS API and returns them as an object.
30
+ *
31
+ * @param rsn Username of the player.
32
+ * @param mode Gamemode to fetch ranks for.
33
+ * @param config Optional axios request config object.
34
+ * @returns Stats object.
35
+ */
36
+ export declare function getStatsByGamemode(rsn: string, mode?: Gamemode, config?: AxiosRequestConfig): Promise<Stats>;
37
+ export declare function getSkillPage(skill: SkillName, mode?: Gamemode, page?: number, config?: AxiosRequestConfig): Promise<PlayerSkillRow[]>;
38
+ /**
39
+ * Screen scrapes a hiscores page of an activity or boss and returns an array of up to 25 players.
40
+ *
41
+ * @param activity Name of the activity or boss to fetch hiscores for.
42
+ * @param mode Gamemode to fetch ranks for.
43
+ * @param page Page number.
44
+ * @param config Optional axios request config object.
45
+ * @returns Array of `PlayerActivityRow` objects.
46
+ */
47
+ export declare function getActivityPage(activity: ActivityName, mode?: Gamemode, page?: number, config?: AxiosRequestConfig): Promise<PlayerActivityRow[]>;