mod windows;
use tauri::{
plugin::{Builder, TauriPlugin},
Runtime,
};
// the plugin custom command handlers if you choose to extend the API:
#[tauri::command]
// this will be accessible with `invoke('plugin:awesome|initialize')`.
// where `awesome` is the plugin name.
fn initialize() {}
#[tauri::command]
// this will be accessible with `invoke('plugin:printer|get_printers')`.
fn get_printers() -> String {
if cfg!(windows) {
return windows::get_printers();
}
panic!("Unsupported OS");
}
pub fn init<R: Runtime>() -> TauriPlugin<R> {
Builder::new("printer")
.invoke_handler(tauri::generate_handler![initialize, get_printers])
.build()
}