refactor: add type definitions for API responses

This commit is contained in:
pa
2025-07-16 13:31:48 +09:00
committed by Natsumi
parent 342850dc7e
commit 0e50a67c25
17 changed files with 601 additions and 206 deletions

50
src/types/common.d.ts vendored
View File

@@ -13,4 +13,54 @@ export interface UnityPackage {
unitySortNumber?: number;
worldSignature?: string;
[key: string]: any;
}
// Base content types
export interface BaseContent {
id: string;
name: string;
authorId: string;
authorName: string;
description: string;
imageUrl: string;
thumbnailImageUrl: string;
created_at: string;
updated_at: string;
releaseStatus: string;
tags: string[];
featured: boolean;
unityPackages: UnityPackage[];
}
// Base Avatar - core avatar properties
export interface BaseAvatar extends BaseContent {
acknowledgements: string | null;
pendingUpload: boolean;
performance: {
[platform: string]: string | number;
};
searchable: boolean;
styles: {
primary: string | null;
secondary: string | null;
};
unityPackageUrl: string;
unityPackageUrlObject: {
unityPackageUrl: string;
};
version: number;
}
// Base World - core world properties
export interface BaseWorld extends BaseContent {
capacity: number;
recommendedCapacity: number;
favorites: number;
heat: number;
popularity: number;
previewYoutubeId: string | null;
publicationDate: string;
labsPublicationDate: string;
organization: string;
udonProducts: any[];
}