use anyhow::Result;
use crate::{ReceiverCallback, ShareFileType, ShareResult, ShareSheet};
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "macos")]
mod mac;
#[cfg(target_os = "windows")]
mod windows;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PlatformShareSupport {
pub mail: bool,
pub messages: bool,
pub airdrop: bool,
pub clipboard: bool,
pub social: bool,
pub print: bool,
pub receiver_registration: bool,
}
pub(crate) struct PlatformShareReceiver;
#[cfg(target_os = "linux")]
use linux as imp;
#[cfg(target_os = "macos")]
use mac as imp;
#[cfg(target_os = "windows")]
use windows as imp;
pub(crate) async fn show(sheet: &ShareSheet) -> Result<ShareResult> {
imp::show(sheet).await
}
pub(crate) fn register_receiver(
file_types: &[ShareFileType],
callback: ReceiverCallback,
) -> Result<PlatformShareReceiver> {
imp::register_receiver(file_types, callback)
}
pub(crate) fn support() -> PlatformShareSupport {
imp::support()
}