Skip to content

Commit 6c70216

Browse files
committed
types(museum): correct & augment museum endpoint typing
Resolves #461
1 parent 6b7b44b commit 6c70216

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { Components } from "../../api";
2+
import { MinecraftInventoryData } from "../../AugmentedTypes";
3+
4+
export type SkyBlockMuseumItem = {
5+
donated_time: number;
6+
featured_slot: string;
7+
borrowing?: boolean;
8+
items: MinecraftInventoryData;
9+
};
10+
11+
/** augment the typing of items / special */
12+
export type SkyBlockMuseumMember = Omit<
13+
Components.Schemas.SkyBlockMuseum,
14+
"items"
15+
> & {
16+
items?: {
17+
[key: string]: SkyBlockMuseumItem | undefined;
18+
};
19+
special?: SkyBlockMuseumItem[];
20+
};

src/types/AugmentedTypes.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type {
1010
ElectionMayor,
1111
} from "./Augmented/Resources/SkyBlock/Election";
1212
import type { SkyBlockAuction } from "./Augmented/SkyBlock/Auction";
13+
import type { SkyBlockMuseumMember } from "./Augmented/SkyBlock/Museum";
1314
import type { SkyBlockProfile } from "./Augmented/SkyBlock/Profile";
1415

1516
export type BoostersResponse = Paths.V2Boosters.Get.Responses.$200 &
@@ -220,8 +221,13 @@ export type SkyblockProfilesResponse = Omit<
220221
profiles: SkyBlockProfile[];
221222
};
222223

223-
export type SkyblockMuseumResponse = Paths.V2SkyblockMuseum.Get.Responses.$200 &
224-
Record<string, unknown>;
224+
export type SkyblockMuseumResponse = Omit<Paths.V2SkyblockMuseum.Get.Responses.$200, 'profile'> &
225+
Record<string, unknown> & {
226+
success?: true;
227+
members: {
228+
[key: string]: SkyBlockMuseumMember | undefined
229+
};
230+
};
225231

226232
export type SkyblockGardenResponse = Paths.V2SkyblockGarden.Get.Responses.$200 &
227233
Record<string, unknown>;

0 commit comments

Comments
 (0)