mod application;
mod commands;
mod domain;
mod infrastructure;

use std::sync::Mutex;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_fs::init())
        .plugin(tauri_plugin_dialog::init())
        .manage(commands::watch::WatcherState(Mutex::new(None)))
        .invoke_handler(tauri::generate_handler![
            commands::render::render_markdown,
            commands::render::convert_file,
            commands::render::list_md_files,
            commands::render::get_syntax_highlight_css,
            commands::watch::start_watch,
            commands::watch::stop_watch,
            commands::theme::list_themes,
            commands::theme::get_theme_css,
        ])
        .run(tauri::generate_context!())
        .expect("Erreur lors du démarrage de l'application Tauri");
}
