fix: debug with type error checks

This commit is contained in:
pa
2025-07-16 11:04:54 +09:00
committed by Natsumi
parent 6d693e278c
commit 39381de29e
16 changed files with 188 additions and 105 deletions

View File

@@ -3,15 +3,6 @@ export type getFavorites = (params: { n: number; offset: number }) => Promise<{
params: { n: number; offset: number };
}>;
interface getFavoritesResponseItem {
favoriteId: string;
id: string;
tags: string[];
type: 'world' | 'friend' | 'avatar';
}
type getFavoritesResponseList = getFavoritesResponseItem[] | undefined;
export type getFavoriteAvatars = (params: {
n: number;
offset: number;
@@ -21,6 +12,36 @@ export type getFavoriteAvatars = (params: {
params: { n: number; offset: number; tag: string };
}>;
export type getFavoriteWorlds = (params: {
n: number;
offset: number;
}) => Promise<{
json: getFavoriteWorldsResponseList;
params: { n: number; offset: number };
}>;
export type addFavorite = (params: {
type: string;
favoriteId: string;
tags: string;
}) => Promise<{
json: addFavoriteResponse;
params: {
type: string;
favoriteId: string;
tags: string;
};
}>;
interface getFavoritesResponseItem {
favoriteId: string;
id: string;
tags: string[];
type: string;
}
type getFavoritesResponseList = getFavoritesResponseItem[] | undefined;
interface UnityPackage {
assetVersion: number;
created_at: string;
@@ -46,7 +67,7 @@ interface Styles {
secondary: null;
}
interface AvatarFavoriteItem {
interface getFavoriteAvatarsResponseItem {
acknowledgements?: null | string;
authorId: string;
authorName: string;
@@ -73,14 +94,6 @@ interface AvatarFavoriteItem {
type getFavoriteAvatarsResponseList = getFavoriteAvatarsResponseItem[];
export type getFavoriteWorlds = (params: {
n: number;
offset: number;
}) => Promise<{
json: getFavoriteWorldsResponseList;
params: { n: number; offset: number };
}>;
interface getFavoriteWorldsResponseItem {
id: string;
name: string;
@@ -109,3 +122,10 @@ interface getFavoriteWorldsResponseItem {
}
type getFavoriteWorldsResponseList = getFavoriteWorldsResponseItem[];
interface addFavoriteResponse {
favoriteId: string;
id: string;
type: 'world' | 'friend' | 'avatar';
tags: string[];
}

View File

@@ -79,37 +79,6 @@ declare global {
};
}
declare const API: {
// HTTP request methods
$bulk: (options: any, args?: any) => Promise<any>;
bulk: (options: any) => Promise<any>;
// Event system
$emit: (event: string, ...args: any[]) => void;
$off: (event: string, handler?: Function) => void;
$on: (event: string, handler: Function) => void;
// Debug functions
debug: boolean | ((message: any) => void);
debugCurrentUserDiff: boolean | ((data: any) => void);
debugFriendState: boolean | ((data: any) => void);
debugGameLog: boolean | ((data: any) => void);
debugPhotonLogging: boolean | ((data: any) => void);
debugUserDiff: boolean | ((data: any) => void);
debugWebRequests: boolean | ((data: any) => void);
debugWebSocket: boolean | ((data: any) => void);
// Configuration
dontLogMeOut: boolean;
endpointDomain: string;
endpointDomainVrchat: string;
websocketDomain: string;
websocketDomainVrchat: string;
// Error handling
errorNoty: (error: any) => void;
};
const CefSharp: {
PostMessage: (message: any) => void;
BindObjectAsync: (...args: string[]) => Promise<any>;
@@ -419,11 +388,37 @@ declare global {
setCookies(cookie: string): Promise<void>;
execute(options: {
url: string;
method: string;
method?: string;
uploadFilePUT?: boolean;
fileData?: string;
fileMIME?: string;
headers?: Record<string, string>;
data?: any;
}): Promise<{ status: number; data: string }>;
};
const electron: {
openFileDialog: () => Promise<string>;
openDirectoryDialog: () => Promise<string>;
desktopNotification: (
displayName: string,
body?: string,
image?: string
) => Promise<void>;
onWindowPositionChanged: (
Function: (event: any, position: { x: number; y: number }) => void
) => void;
onWindowSizeChanged: (
Function: (
event: any,
size: { width: number; height: number }
) => void
) => void;
onWindowStateChange: (
Function: (event: any, state: { windowState: any }) => void
) => void;
restartApp: () => Promise<void>;
};
}
export {};

View File

@@ -1,9 +1,9 @@
export type getGroup = (params: {
groupId: string;
includeRoles: boolean;
includeRoles?: boolean;
}) => Promise<{
json: getGroupResponse;
params: { groupId: string; includeRoles: boolean };
params: { groupId: string; includeRoles?: boolean };
}>;
interface Group {

View File

@@ -6,6 +6,16 @@ export type getInstance = (params: {
params: { worldId: string; instanceId: string };
}>;
export type getInstanceShortName = (instance: {
worldId: string;
instanceId: string;
shortName?: string;
}) => Promise<{
json: getInstanceShortNameResponse;
instance: { worldId: string; instanceId: string };
params?: { shortName: string };
}>;
interface getInstanceResponse {
active: boolean;
ageGate: boolean;
@@ -91,3 +101,8 @@ interface WorldUnityPackage {
unityVersion: string;
worldSignature: string;
}
interface getInstanceShortNameResponse {
secureName: string;
shortName: string;
}

51
src/types/world.d.ts vendored Normal file
View File

@@ -0,0 +1,51 @@
export type getWorld = (params: { worldId: string }) => Promise<{
json: getWorldResponse;
params: { worldId: string };
}>;
interface getWorldResponse {
authorId: string;
authorName: string;
capacity: number;
created_at: string;
defaultContentSettings: Record<string, unknown>;
description: string;
favorites: number;
featured: boolean;
heat: number;
id: string;
imageUrl: string;
instances: any[];
labsPublicationDate: string;
name: string;
occupants: number;
organization: string;
popularity: number;
previewYoutubeId: string | null;
privateOccupants: number;
publicOccupants: number;
publicationDate: string;
recommendedCapacity: number;
releaseStatus: string;
tags: string[];
thumbnailImageUrl: string;
udonProducts: any[];
unityPackages: UnityPackage[];
updated_at: string;
urlList: any[];
version: number;
visits: number;
}
interface UnityPackage {
assetUrl: string;
assetUrlObject: Record<string, unknown>;
assetVersion: number;
created_at: string;
id: string;
platform: string;
pluginUrl: string;
pluginUrlObject: Record<string, unknown>;
unitySortNumber: number;
unityVersion: string;
}