hive-bedrock-api 1.0.4 → 1.0.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import { Options } from "../types/API";
|
|
|
2
2
|
import { BASE_GAME_ALL, GAME_STATS, GAME_STATS_ALL, REQUEST_ALL, USER_MAIN } from "../types/GAMES";
|
|
3
3
|
import { GAME } from "../types/GAME_INFO";
|
|
4
4
|
import { MethodResponse } from "../types/METHODS";
|
|
5
|
-
export default function getAllTimeStats(playerIdentifier: string): Promise<MethodResponse<Omit<REQUEST_ALL, "main">> & {
|
|
5
|
+
export default function getAllTimeStats(playerIdentifier: string, options?: Options): Promise<MethodResponse<Omit<REQUEST_ALL, "main">> & {
|
|
6
6
|
player: USER_MAIN;
|
|
7
7
|
}>;
|
|
8
8
|
export default function getAllTimeStats<G extends GAME>(playerIdentifier: string, game: G, options?: Options): Promise<MethodResponse<GAME_STATS<BASE_GAME_ALL>[G]>>;
|
|
@@ -99,6 +99,10 @@ function getAllTimeStats(playerIdentifier, game, options) {
|
|
|
99
99
|
return __generator(this, function (_e) {
|
|
100
100
|
switch (_e.label) {
|
|
101
101
|
case 0:
|
|
102
|
+
if (typeof game === "object" && !(game instanceof Array)) {
|
|
103
|
+
options = game;
|
|
104
|
+
game = undefined;
|
|
105
|
+
}
|
|
102
106
|
if (!!game) return [3 /*break*/, 4];
|
|
103
107
|
_e.label = 1;
|
|
104
108
|
case 1:
|
|
@@ -9,6 +9,5 @@ interface OptionsType extends Options {
|
|
|
9
9
|
skip?: number;
|
|
10
10
|
amount?: number;
|
|
11
11
|
}
|
|
12
|
-
export default function getMonthlyLeaderboard<G extends GAME>(game: G, options?:
|
|
13
|
-
export default function getMonthlyLeaderboard<G extends GAME>(game: G, options: OptionsType): Promise<MethodResponse<LB_STATS<G>[]>>;
|
|
12
|
+
export default function getMonthlyLeaderboard<G extends GAME>(game: G, options?: OptionsType): Promise<MethodResponse<LB_STATS<G>[]>>;
|
|
14
13
|
export {};
|
|
@@ -7,10 +7,9 @@ interface OptionsType extends Options {
|
|
|
7
7
|
month?: number;
|
|
8
8
|
date?: Date;
|
|
9
9
|
}
|
|
10
|
-
export default function getMonthlyStats(playerIdentifier: string): Promise<MethodResponse<Omit<REQUEST_MONTHLY, "main">>>;
|
|
11
|
-
export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G): Promise<MethodResponse<GAME_STATS<BASE_GAME_MONTHLY>[G]>>;
|
|
12
|
-
export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G, options
|
|
13
|
-
export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G[]): Promise<MethodResponse<{
|
|
10
|
+
export default function getMonthlyStats(playerIdentifier: string, options?: Options): Promise<MethodResponse<Omit<REQUEST_MONTHLY, "main">>>;
|
|
11
|
+
export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G, options?: OptionsType): Promise<MethodResponse<GAME_STATS<BASE_GAME_MONTHLY>[G]>>;
|
|
12
|
+
export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G[], options?: Options): Promise<MethodResponse<{
|
|
14
13
|
[M in G]: GAME_STATS_ALL<M>;
|
|
15
14
|
}>>;
|
|
16
15
|
export {};
|
|
@@ -77,6 +77,10 @@ function getMonthlyStats(playerIdentifier, game, options) {
|
|
|
77
77
|
return __generator(this, function (_j) {
|
|
78
78
|
switch (_j.label) {
|
|
79
79
|
case 0:
|
|
80
|
+
if (typeof game === "object" && !(game instanceof Array)) {
|
|
81
|
+
options = game;
|
|
82
|
+
game = undefined;
|
|
83
|
+
}
|
|
80
84
|
if (!!game) return [3 /*break*/, 4];
|
|
81
85
|
_j.label = 1;
|
|
82
86
|
case 1:
|