// This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually. /** user-defined commands **/ export const commands = { async createFriend(id: string) : Promise { return await TAURI_INVOKE("create_friend", { id }); }, async listFriends() : Promise { return await TAURI_INVOKE("list_friends"); }, async getFriend(id: string) : Promise { return await TAURI_INVOKE("get_friend", { id }); }, async deleteFriend(id: string) : Promise { return await TAURI_INVOKE("delete_friend", { id }); }, async createRemote(remote: RemoteInput) : Promise { return await TAURI_INVOKE("create_remote", { remote }); }, async listRemotes() : Promise { return await TAURI_INVOKE("list_remotes"); }, async getRemote(id: string) : Promise { return await TAURI_INVOKE("get_remote", { id }); }, async updateRemote(id: string, remote: RemoteInput) : Promise { return await TAURI_INVOKE("update_remote", { id, remote }); }, async deleteRemote(id: string) : Promise { return await TAURI_INVOKE("delete_remote", { id }); }, async getProfile() : Promise { return await TAURI_INVOKE("get_profile"); }, async updateProfile(displayName: string, skinData: number[] | null) : Promise { return await TAURI_INVOKE("update_profile", { displayName, skinData }); }, async getPublicKey() : Promise { return await TAURI_INVOKE("get_public_key"); }, async listStatuses() : Promise { return await TAURI_INVOKE("list_statuses"); }, async listFriendStatuses() : Promise { return await TAURI_INVOKE("list_friend_statuses"); }, async resolveFriendDisplayName(userId: string) : Promise { return await TAURI_INVOKE("resolve_friend_display_name", { userId }); }, async resolveSkin(userId: string, skinHash: string) : Promise { return await TAURI_INVOKE("resolve_skin", { userId, skinHash }); }, async pickAndSendImage(recipientId: string) : Promise { return await TAURI_INVOKE("pick_and_send_image", { recipientId }); }, async sendImageBytes(recipientId: string, bytes: number[]) : Promise { return await TAURI_INVOKE("send_image_bytes", { recipientId, bytes }); }, async sendInteraction(recipientId: string, content: InteractionContent) : Promise { return await TAURI_INVOKE("send_interaction", { recipientId, content }); }, async listPuppetStates() : Promise { return await TAURI_INVOKE("list_puppet_states"); }, async openActionWindow(name: string, title: string, pageUrl: string) : Promise { return await TAURI_INVOKE("open_action_window", { name, title, pageUrl }); }, async updateSceneHitboxes(hitboxes: SceneHitbox[]) : Promise { return await TAURI_INVOKE("update_scene_hitboxes", { hitboxes }); } } /** user-defined events **/ export const events = __makeEvents__<{ cursorPositionChanged: CursorPositionChanged, foregroundAppChanged: ForegroundAppChanged, friendForegroundAppChanged: FriendForegroundAppChanged, friendInteractionReceived: FriendInteractionReceived, friendStatusesChanged: FriendStatusesChanged, friendsChanged: FriendsChanged, networkStatusChanged: NetworkStatusChanged, profileChanged: ProfileChanged, puppetStatesChanged: PuppetStatesChanged, remotesChanged: RemotesChanged }>({ cursorPositionChanged: "cursor-position-changed", foregroundAppChanged: "foreground-app-changed", friendForegroundAppChanged: "friend-foreground-app-changed", friendInteractionReceived: "friend-interaction-received", friendStatusesChanged: "friend-statuses-changed", friendsChanged: "friends-changed", networkStatusChanged: "network-status-changed", profileChanged: "profile-changed", puppetStatesChanged: "puppet-states-changed", remotesChanged: "remotes-changed" }) /** user-defined constants **/ /** user-defined types **/ /** * Metadata for the currently active application, including localized and unlocalized names, and an optional base64-encoded icon. */ export type AppMeta = { local: string | null; unlocal: string | null; ico: string | null } export type ConnectionState = "connecting" | "connected" | "disconnected" export type ConnectionStatus = { remoteId: string; address: string; name: string | null; state: ConnectionState } export type CursorPosition = { x: number; y: number } export type CursorPositionChanged = { positions: Partial<{ [key in string]: CursorPositions }> } export type CursorPositions = { /** * Absolute cursor coordinates in physical pixels. */ raw: CursorPosition; /** * Cursor coordinates normalized to the source monitor for scale-independent projection. */ mapped: CursorPosition } export type ForegroundAppChanged = { meta: AppMeta } /** * A configured public-key relationship with optional cached remote metadata. * The display name remains absent until learned from a signed remote profile. */ export type Friend = { id: string; displayName: string | null; skinHash: string | null } export type FriendForegroundAppChanged = { friendId: string; meta: AppMeta } export type FriendInteractionReceived = { interactionId: string; friendId: string; content: InteractionContent } export type FriendStatusesChanged = { friendIds: string[] } export type FriendsChanged = { friends: Friend[] } export type InteractionContent = { type: "text"; text: string } | { type: "wave" } | { type: "image"; mediaType: string; data: string } export type NetworkStatusChanged = { statuses: ConnectionStatus[] } export type ProfileChanged = { profile: User } export type PuppetState = { id: string; position: CursorPosition; isMoving: boolean } export type PuppetStatesChanged = { puppets: PuppetState[] } export type Remote = { id: string; address: string; name: string | null; port: number | null } export type RemoteInput = { address: string; name: string | null; port: number | null } export type RemotesChanged = { remotes: Remote[] } export type SceneHitbox = { x: number; y: number; width: number; height: number } /** * Public user identity exchanged with peers and remote servers. `id` is the * user's Ed25519 public key and is not persisted as local profile metadata. */ export type User = { id: string; displayName: string; skinHash: string | null } /** tauri-specta globals **/ import { invoke as TAURI_INVOKE, Channel as TAURI_CHANNEL, } from "@tauri-apps/api/core"; import * as TAURI_API_EVENT from "@tauri-apps/api/event"; import { type WebviewWindow as __WebviewWindow__ } from "@tauri-apps/api/webviewWindow"; type __EventObj__ = { listen: ( cb: TAURI_API_EVENT.EventCallback, ) => ReturnType>; once: ( cb: TAURI_API_EVENT.EventCallback, ) => ReturnType>; emit: null extends T ? (payload?: T) => ReturnType : (payload: T) => ReturnType; }; export type Result = | { status: "ok"; data: T } | { status: "error"; error: E }; function __makeEvents__>( mappings: Record, ) { return new Proxy( {} as unknown as { [K in keyof T]: __EventObj__ & { (handle: __WebviewWindow__): __EventObj__; }; }, { get: (_, event) => { const name = mappings[event as keyof T]; return new Proxy((() => {}) as any, { apply: (_, __, [window]: [__WebviewWindow__]) => ({ listen: (arg: any) => window.listen(name, arg), once: (arg: any) => window.once(name, arg), emit: (arg: any) => window.emit(name, arg), }), get: (_, command: keyof __EventObj__) => { switch (command) { case "listen": return (arg: any) => TAURI_API_EVENT.listen(name, arg); case "once": return (arg: any) => TAURI_API_EVENT.once(name, arg); case "emit": return (arg: any) => TAURI_API_EVENT.emit(name, arg); } }, }); }, }, ); }