feat: add initial implementation for fetching avatar data from API

- Created a new sync.ts file to handle API requests.
- Defined interfaces for AvatarApiResponse, Data, and Avatar.
- Implemented a main function to fetch avatar data from the specified endpoint.
This commit is contained in:
2025-09-23 09:27:51 +07:00 Unverified
parent be6b01a182
commit bdef3c3bd0
21 changed files with 694 additions and 171 deletions
+32
View File
@@ -0,0 +1,32 @@
async function main() {
const data: AvatarApiResponse = await fetch("https://gi.yatta.moe/api/v2/en/avatar").then(e => e.json());
}
main();
export interface AvatarApiResponse {
response: number;
data: Data;
}
export interface Data {
props: { [key: string]: string };
types: { [key: string]: string };
items: { [key: string]: Avatar };
}
export interface Avatar {
id: number | string;
rank: number;
name: string;
element: string;
weaponType: string;
region: string;
specialProp: string;
bodyType: string;
icon: string;
birthday: number[];
release: number;
route: string;
}