ark-api-ffi 0.17.0-pre.15

Ark low-level Wasm FFI API
Documentation
define_api_id!(0xbeff_362a_1bdd_9cd9, "file-ux-v0");

#[ark_api_macros::ark_bindgen(imports = "ark-file-ux-v0")]
mod file_ux {
    extern "C" {
        /// Lets the user save raw data to a file, popping up Save file dialog.
        ///
        /// The proposed filename must include a file extension, this will be used to set up
        /// the save dialog filter.
        #[deprecated_infallible]
        pub fn save_file_dialog(proposed_filename: &str, data: &[u8]);

        /// Lets the user read raw data from a file, popping up an Open file dialog.
        ///
        /// file_type_filter can be used to filter file types. To query for PNG
        /// files, specify "*.png", for example. Multiple filters are not yet supported.
        ///
        /// Returns an empty vector if the user cancelled the open file dialog.
        pub fn open_file_dialog(file_type_filter: &str) -> Vec<u8>;
    }
}

pub use file_ux::*;