refactor: use specta for commands (#192)

* feat: add tauri-specta

* refactor: system library

* chore: format
This commit is contained in:
雨宮蓮
2024-05-25 15:21:40 +07:00
committed by GitHub
parent 7449000f5f
commit bba324ea53
92 changed files with 2164 additions and 2071 deletions

View File

@@ -10,6 +10,7 @@ use tauri::{LogicalPosition, LogicalSize, Manager, WebviewUrl};
use tauri_plugin_decorum::WebviewWindowExt;
#[tauri::command]
#[specta::specta]
pub fn create_column(
label: &str,
x: f32,
@@ -45,6 +46,7 @@ pub fn create_column(
}
#[tauri::command]
#[specta::specta]
pub fn close_column(label: &str, app_handle: tauri::AppHandle) -> Result<bool, ()> {
match app_handle.get_webview(label) {
Some(webview) => {
@@ -59,6 +61,7 @@ pub fn close_column(label: &str, app_handle: tauri::AppHandle) -> Result<bool, (
}
#[tauri::command]
#[specta::specta]
pub fn reposition_column(
label: &str,
x: f32,
@@ -78,6 +81,7 @@ pub fn reposition_column(
}
#[tauri::command]
#[specta::specta]
pub fn resize_column(
label: &str,
width: f32,
@@ -97,6 +101,7 @@ pub fn resize_column(
}
#[tauri::command]
#[specta::specta]
pub fn open_window(
label: &str,
title: &str,
@@ -166,6 +171,7 @@ pub fn open_window(
}
#[tauri::command]
#[specta::specta]
pub fn set_badge(count: i32) {
#[cfg(target_os = "macos")]
unsafe {