// 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 getBootstrapRelays() : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("get_bootstrap_relays") }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async setBootstrapRelays(relays: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("set_bootstrap_relays", { relays }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async collectInboxRelays(userId: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("collect_inbox_relays", { userId }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async setInboxRelays(relays: string[]) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("set_inbox_relays", { relays }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async connectInboxRelays(userId: string, ignoreCache: boolean) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("connect_inbox_relays", { userId, ignoreCache }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async disconnectInboxRelays(userId: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("disconnect_inbox_relays", { userId }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async login(account: string, password: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("login", { account, password }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async deleteAccount(id: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("delete_account", { id }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async createAccount(name: string, about: string, picture: string, password: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("create_account", { name, about, picture, password }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async importKey(key: string, password: string | null) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("import_key", { key, password }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async connectAccount(uri: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("connect_account", { uri }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async getAccounts() : Promise { return await TAURI_INVOKE("get_accounts"); }, async getMetadata(userId: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("get_metadata", { userId }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async getContactList() : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("get_contact_list") }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async getChats() : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("get_chats") }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async getChatMessages(id: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("get_chat_messages", { id }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } }, async sendMessage(to: string, message: string) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("send_message", { to, message }) }; } catch (e) { if(e instanceof Error) throw e; else return { status: "error", error: e as any }; } } } /** user-defined events **/ /** user-defined constants **/ /** user-defined types **/ /** 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: T extends null ? (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); } }, }); }, }, ); }