mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 21:24:05 +02:00
feat: move database access to rust
This commit is contained in:
parent
4b3b6eaf21
commit
a94496dbdb
5 changed files with 687 additions and 317 deletions
26
plugins/settings.ts
Normal file
26
plugins/settings.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { invoke } from "@tauri-apps/api/core";
|
||||
import type { Settings } from "~/types/types";
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
return {
|
||||
provide: {
|
||||
settings: {
|
||||
async getSetting(key: string): Promise<string> {
|
||||
return await invoke<string>("get_setting", { key });
|
||||
},
|
||||
|
||||
async saveSetting(key: string, value: string): Promise<void> {
|
||||
await invoke<void>("save_setting", { key, value });
|
||||
},
|
||||
|
||||
async getKeybind(): Promise<string[]> {
|
||||
return await invoke<string[]>("get_keybind");
|
||||
},
|
||||
|
||||
async saveKeybind(keybind: string[]): Promise<void> {
|
||||
await invoke<void>("save_keybind", { keybind });
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue