osrs-json-hiscores 2.14.1 → 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 +47 -47
- package/lib/hiscores.js +401 -401
- package/lib/index.d.ts +5 -5
- package/lib/index.js +21 -17
- package/lib/types.d.ts +78 -78
- package/lib/types.js +2 -2
- package/lib/utils/constants.d.ts +36 -36
- package/lib/utils/constants.js +249 -245
- package/lib/utils/helpers.d.ts +63 -63
- package/lib/utils/helpers.js +119 -119
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +18 -14
- package/package.json +19 -20
package/lib/hiscores.d.ts
CHANGED
@@ -1,47 +1,47 @@
|
|
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[]>;
|
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[]>;
|