import type { AccountsState, AuthStatus, LoginCredentials, TwoFactorMethod, TwoFactorPayload, } from "./types/auth"; import type { SocialSnapshot, UserProfile, UserStatus } from "./types/user"; import type { FavoriteWorldFolder, World, WorldSnapshot } from "./types/world"; import type { Instance } from "./types/instance"; import type { Avatar } from "./types/avatar"; import type { RepoStats, StoredEntity } from "./types/repository"; import type { AccountSettings, ContentFilterKey, Pending2Fa, RecoveryCode } from "./types/settings"; import type { Group, GroupSnapshot } from "./types/group"; import type { EnhancementId, EnhancementsSnapshot } from "./types/enhancements"; import type { GallerySnapshot, Photo, ThumbCacheStats } from "./types/gallery"; import type { AppConfig } from "./types/appConfig"; import type { GameStatus } from "./types/game"; import type { IpcResult } from "./types/result"; import type { CacheEntryInfo, CacheStats, DebugSnapshot, LogEntry, WsEvent } from "./types/debug"; export interface CacheUpdate { cache: CacheEntryInfo[]; stats: CacheStats; } export interface IpcRequests { "auth:status": () => IpcResult; "auth:login": (creds: LoginCredentials) => IpcResult; "auth:verify2fa": (payload: TwoFactorPayload) => IpcResult; "auth:logout": () => IpcResult; "accounts:list": () => IpcResult; "accounts:switch": (id: string) => IpcResult; "accounts:remove": (id: string) => IpcResult; "user:me": () => IpcResult; "user:get": (userId: string) => IpcResult; "user:getByName": (username: string) => IpcResult; "user:search": (query: string) => IpcResult; "friends:list": () => IpcResult; "world:byUser": (userId: string) => IpcResult; "world:search": (query: string) => IpcResult; "world:favorites": (userId: string) => IpcResult; "world:get": (worldId: string) => IpcResult; "world:snapshot": () => IpcResult; "instance:get": (location: { worldId: string; instanceId: string }) => IpcResult; "avatar:get": (avatarId: string) => IpcResult; "avatar:favorites": () => IpcResult; "group:byUser": (userId: string) => IpcResult; "group:represented": (userId: string) => IpcResult; "group:get": (groupId: string) => IpcResult; "group:snapshot": () => IpcResult; "social:snapshot": () => IpcResult; "settings:get": () => IpcResult; "settings:displayName": (p: { displayName: string; currentPassword: string; }) => IpcResult; "settings:revertDisplayName": (p: { currentPassword: string }) => IpcResult; "settings:email": (p: { email: string; currentPassword: string }) => IpcResult; "settings:password": (p: { currentPassword: string; newPassword: string; }) => IpcResult; "settings:privacy": (p: { sharedConnectionsHidden?: boolean; discordFriendsHidden?: boolean; }) => IpcResult; "settings:status": (p: { status: UserStatus; statusDescription: string }) => IpcResult; "settings:contentFilters": (filters: ContentFilterKey[]) => IpcResult; "settings:enable2fa": () => IpcResult; "settings:verify2fa": (code: string) => IpcResult<{ verified: boolean }>; "settings:disable2fa": () => IpcResult; "settings:recoveryCodes": () => IpcResult; "settings:reverify2fa": (p: { method: TwoFactorMethod; code: string; }) => IpcResult<{ verified: boolean }>; "settings:resetUserData": () => IpcResult; "settings:deleteAccount": () => IpcResult; "config:get": () => IpcResult; "config:setGamePath": (p: { gamePath: string | null }) => IpcResult; "config:pickGamePath": () => IpcResult; "game:status": () => IpcResult; "game:launch": () => IpcResult; "gallery:snapshot": () => IpcResult; "gallery:reveal": (path: string) => IpcResult; "gallery:openExternal": (path: string) => IpcResult; "gallery:delete": (paths: string[]) => IpcResult; "gallery:thumbStats": () => IpcResult; "gallery:thumbClear": () => IpcResult; "enhancements:snapshot": () => IpcResult; "enhancements:setEnabled": (p: { id: EnhancementId; enabled: boolean; }) => IpcResult; "debug:snapshot": () => IpcResult; "debug:cacheInvalidate": (key: string) => IpcResult; "debug:cacheClear": () => IpcResult; "debug:repoStats": () => IpcResult; "debug:repoInspect": (name: string) => IpcResult[]>; "debug:repoClear": (name: string) => IpcResult; "debug:repoFlush": (name: string) => IpcResult; "debug:openWindow": () => IpcResult; } export interface IpcEvents { "auth:changed": AuthStatus; "accounts:changed": AccountsState; "social:seed": SocialSnapshot; "social:upsert": UserProfile; "world:seed": WorldSnapshot; "world:upsert": World; "group:seed": GroupSnapshot; "group:upsert": Group; "world:favoriteFolders": { userId: string; folders: FavoriteWorldFolder[]; done: boolean }; "game:changed": GameStatus; "gallery:added": Photo; "debug:log": LogEntry; "debug:cache": CacheUpdate; "ws:event": WsEvent; } export type IpcRequestChannel = keyof IpcRequests; export type IpcEventChannel = keyof IpcEvents;