Skip to content

Commit c770092

Browse files
fix cape type
1 parent 69a49fc commit c770092

3 files changed

Lines changed: 6 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcutils-js-api",
3-
"version": "2.0.22",
3+
"version": "2.0.23",
44
"module": "dist/index.js",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type { BedrockServer } from "./types/server/impl/bedrock-server";
55
import type { JavaServer } from "./types/server/impl/java-server";
66
import type { CachedPlayer } from "./types/cache/cached-player";
77
import type { CachedPlayerName } from "./types/cache/cached-player-name";
8-
import type { CapeData } from "./types/player/cape/cape";
9-
import { ServerType } from "./types/server/server";
8+
import type { ServerType } from "./types/server/server";
9+
import type { Cape } from "./types/player/cape/cape";
1010

1111
export class McUtilsAPI {
1212
private readonly endpoint: string;
@@ -257,12 +257,12 @@ export class McUtilsAPI {
257257
* @returns the list of cape data or the error (if one occurred)
258258
*/
259259
async fetchCapes(): Promise<{
260-
capes?: CapeData[];
260+
capes?: Cape[];
261261
error?: ErrorResponse;
262262
}> {
263263
const response = await fetch(`${this.endpoint}/capes`);
264264
if (response.ok) {
265-
return { capes: (await response.json()) as CapeData[] };
265+
return { capes: (await response.json()) as Cape[] };
266266
}
267267
return {
268268
error: (await response.json()) as ErrorResponse,

src/types/player/cape/cape.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import { CapePart } from "./cape-part";
22

33
export type Cape = {
4-
textureId: string;
5-
textureUrl: string;
6-
parts: Record<CapePart, string>;
7-
};
8-
9-
export type CapeData = {
104
name: string;
115
textureId: string;
126
textureUrl: string;
137
parts: Record<CapePart, string>;
14-
};
8+
};

0 commit comments

Comments
 (0)