// 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(friend: User) : Promise { return await TAURI_INVOKE("create_friend", { friend }); }, 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) : Promise { return await TAURI_INVOKE("update_profile", { displayName }); }, async getPublicKey() : Promise { return await TAURI_INVOKE("get_public_key"); }, async listStatuses() : Promise { return await TAURI_INVOKE("list_statuses"); }, 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, friendsChanged: FriendsChanged, networkStatusChanged: NetworkStatusChanged, profileChanged: ProfileChanged, remotesChanged: RemotesChanged }>({ cursorPositionChanged: "cursor-position-changed", foregroundAppChanged: "foreground-app-changed", friendForegroundAppChanged: "friend-foreground-app-changed", friendsChanged: "friends-changed", networkStatusChanged: "network-status-changed", profileChanged: "profile-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 } export type FriendForegroundAppChanged = { friendId: string; meta: AppMeta } export type FriendsChanged = { friends: User[] } export type NetworkStatusChanged = { statuses: ConnectionStatus[] } export type ProfileChanged = { profile: User } 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 } /** 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); } }, }); }, }, ); }