refactor: use specta for commands (#192)
* feat: add tauri-specta * refactor: system library * chore: format
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user