mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-29 12:06:01 +02:00
5914fb9f36
* feat: check for license headers * add headers * format
37 lines
838 B
Rust
37 lines
838 B
Rust
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
use tauri::{AppHandle, Runtime};
|
|
|
|
#[tauri::command]
|
|
pub fn version<R: Runtime>(app: AppHandle<R>) -> String {
|
|
app.package_info().version.to_string()
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub fn name<R: Runtime>(app: AppHandle<R>) -> String {
|
|
app.package_info().name.clone()
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub fn tauri_version() -> &'static str {
|
|
tauri::VERSION
|
|
}
|
|
|
|
#[tauri::command]
|
|
#[allow(unused_variables)]
|
|
pub fn show<R: Runtime>(app: AppHandle<R>) -> tauri::Result<()> {
|
|
#[cfg(target_os = "macos")]
|
|
app.show()?;
|
|
Ok(())
|
|
}
|
|
|
|
#[tauri::command]
|
|
#[allow(unused_variables)]
|
|
pub fn hide<R: Runtime>(app: AppHandle<R>) -> tauri::Result<()> {
|
|
#[cfg(target_os = "macos")]
|
|
app.hide()?;
|
|
Ok(())
|
|
}
|