1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! The widget API plugin for `fs` in `@deskulpt-test/apis`.

use tauri::{
    generate_handler,
    plugin::{Builder, TauriPlugin},
    Runtime,
};

mod apis;
mod utils;

/// Build the `fs` plugin for `@deskulpt-test/apis`.
///
/// The registered APIs can be invoked as `plugin:apis-fs|<api_name>`.
pub(crate) fn init<R: Runtime>() -> TauriPlugin<R> {
    Builder::new("apis-fs")
        .invoke_handler(generate_handler![
            apis::is_file,
            apis::is_dir,
            apis::exists,
            apis::read_file,
            apis::write_file,
            apis::append_file,
            apis::remove_file,
            apis::create_dir,
            apis::remove_dir,
        ])
        .build()
}