-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d52fe2e
commit bb1e94e
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { tauri } from "@tauri-apps/api"; | ||
import { NoteProvider } from "./noteprovider"; | ||
|
||
class TauriNoteProvider extends NoteProvider { | ||
async list() { | ||
return await tauri.invoke("list"); | ||
} | ||
|
||
async read(name) { | ||
return await tauri.invoke("read", { name: name }); | ||
} | ||
|
||
async create() { | ||
return await tauri.invoke("create"); | ||
} | ||
|
||
async rename(old_name, new_name) { | ||
return await tauri.invoke("read", { | ||
old_name: old_name, | ||
new_name: new_name | ||
}); | ||
} | ||
|
||
async write(name, content) { | ||
await tauri.invoke("write", { | ||
name: name, | ||
content: content | ||
}); | ||
} | ||
|
||
async remove(name) { | ||
await tauri.invoke("remove", { name: name}); | ||
} | ||
|
||
async read_tags(name) { | ||
return await tauri.invoke("read_tags", { name: name}); | ||
} | ||
|
||
async write_tags(name, tags) { | ||
await tauri.invoke("write_tags", { | ||
name: name, | ||
tags: tags | ||
}); | ||
} | ||
} | ||
|
||
export { TauriNoteProvider } |