//! # libthreema
//!
//! The one stop shop for all your Threema needs!

// We have pretty strict linting rules and it would be a massive hassle having to conditionally
// compile all `pub(crate)` exposed items, depending on the selected features.
//
// The goal is to get it right with features `uniffi`, `wasm` and `cli` enabled (and of course, all
// feature variants still need to compile).
//
// However, it does make sense to disable this from time to time to check for actual issues.
#![cfg_attr(
    not(all(feature = "uniffi", feature = "wasm", feature = "cli")),
    allow(
        dead_code,
        unused_crate_dependencies,
        unused_imports,
        reason = "don't care for non full-feature builds"
    )
)]

// Avoids dev dependencies used only in examples to be picked up by the linter. Should no longer be
// necessary once https://github.com/rust-lang/cargo/issues/1982 has been resolved.
#[cfg(test)]
mod external_crate_false_positives {
    use anyhow as _;
    use tokio as _;
}
#[cfg(feature = "cli")]
mod external_crate_false_positives_cli_feature {
    use clap as _;
}

// Set up UniFFI scaffolding for UniFFI bindings
#[cfg(feature = "uniffi")]
uniffi::setup_scaffolding!();

/// Compiled low-level protobuf messages.
#[expect(unnameable_types, unreachable_pub, reason = "Code generated by prost")]
#[allow(
    clippy::all,
    clippy::pedantic,
    clippy::restriction,
    reason = "Code generated by prost"
)]
mod protobuf {
    pub mod common {
        include!(concat!(env!("OUT_DIR"), "/common.rs"));
    }
    pub mod csp_e2e {
        include!(concat!(env!("OUT_DIR"), "/csp_e2e.rs"));
    }
    pub mod d2d {
        include!(concat!(env!("OUT_DIR"), "/d2d.rs"));
    }
    pub mod d2m {
        include!(concat!(env!("OUT_DIR"), "/d2m.rs"));
    }
    pub mod sync {
        include!(concat!(env!("OUT_DIR"), "/sync.rs"));
    }
    pub use sync as d2d_sync;
    pub mod d2d_rendezvous {
        include!(concat!(env!("OUT_DIR"), "/rendezvous.rs"));
    }
}

pub mod bindings;
pub mod common;
pub(crate) mod crypto;
pub mod csp;
pub mod csp_e2e;
pub mod d2d_rendezvous;
pub mod https;
pub mod id_backup;
pub mod utils;
