Skip to content

Commit

Permalink
feat: augment election endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
zikeji committed Sep 15, 2024
1 parent 47e15d8 commit d3ee25f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/methods/resources/skyblock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class SkyBlockResources extends Method {
* Returns the current items from the SkyBlock gamemode.
* @example
* ```typescript
* const bingo = await client.resources.skyblock.items();
* const items = await client.resources.skyblock.items();
* ```
* @category API
*/
Expand Down
42 changes: 42 additions & 0 deletions src/types/Augmented/Resources/SkyBlock/Election.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export type ElectionMayor = {
key: string;
name: string;
perks: {
name: string;
description: string;
}[];
minister: {
key: string;
name: string;
perk: {
name: string;
description: string;
minister: boolean;
};
};
election?: {
year: number;
candidates: {
key: string;
name: string;
perks: {
name: string;
description: string;
minister: boolean;
}[];
votes: number;
}[];
};
};
export type ElectionCurrent = {
year: number;
candidates: {
key: string;
name: string;
perks: {
name: string;
description: string;
minister: boolean;
}[];
}[];
};
11 changes: 9 additions & 2 deletions src/types/AugmentedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
*/

import type { Paths } from "./api";
import { Guild } from "./Augmented/Guild";
import type { Guild } from "./Augmented/Guild";
import type { Player } from "./Augmented/Player";
import type {
ElectionCurrent,
ElectionMayor,
} from "./Augmented/Resources/SkyBlock/Election";
import type { SkyBlockProfile } from "./Augmented/SkyBlock/Profile";

export type BoostersResponse = Paths.V2Boosters.Get.Responses.$200 &
Expand Down Expand Up @@ -80,7 +84,10 @@ export type ResourcesSkyblockCollectionsResponse = Paths.V2ResourcesSkyblockColl
};

export type ResourcesSkyblockElectionResponse = Paths.V2ResourcesSkyblockElection.Get.Responses.$200 &
Record<string, unknown>;
Record<string, unknown> & {
mayor: ElectionMayor;
current: ElectionCurrent | null;
};

export type ResourcesSkyblockItemsResponse = Paths.V2ResourcesSkyblockItems.Get.Responses.$200 &
Record<string, unknown>;
Expand Down

0 comments on commit d3ee25f

Please sign in to comment.