Skip to content

Commit bc4f168

Browse files
update types
1 parent a662b74 commit bc4f168

3 files changed

Lines changed: 12 additions & 3 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.40",
3+
"version": "2.0.41",
44
"module": "dist/index.js",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { StatisticsResponse } from "./types/response/statistics-response";
1212
import { Skin } from "./types/player/skin/skin";
1313
import { Page } from "./types/pagination/pagination";
1414
import { PlayerSearchEntry } from "./types/player/player-search-entry";
15+
import { SkinsResponsePage } from "./types/response/skins-response";
1516

1617
type RequestOptions = RequestInit & { responseType?: "json" | "arrayBuffer" };
1718

@@ -315,8 +316,8 @@ export class McUtilsAPI {
315316
* @param page the page to fetch (default: 1)
316317
* @returns the list of skins or the error (if one occurred)
317318
*/
318-
async fetchSkins(page: number = 1): Promise<{ skins?: Page<Skin>; error?: ErrorResponse }> {
319-
const { data, error } = await this.request<Page<Skin>>(
319+
async fetchSkins(page: number = 1): Promise<{ skins?: SkinsResponsePage; error?: ErrorResponse }> {
320+
const { data, error } = await this.request<SkinsResponsePage>(
320321
`/skins${this.buildParams({ page: String(page) })}`
321322
);
322323
return error ? { error } : { skins: data };
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Page } from "../pagination/pagination";
2+
3+
export type SkinsResponse = {
4+
imageUrl: string;
5+
accountsUsed: number;
6+
}
7+
8+
export type SkinsResponsePage = Page<SkinsResponse>;

0 commit comments

Comments
 (0)