use std::{num::NonZeroU32, str::FromStr};
use bitwarden_crypto::{SymmetricCryptoKey, safe};
use bitwarden_uniffi_error::convert_result;
use uuid::Uuid;
use crate::key_management::SignedSecurityState;
uniffi::use_remote_type!(bitwarden_crypto::NonZeroU32);
uniffi::use_remote_type!(bitwarden_crypto::safe::PasswordProtectedKeyEnvelope);
uniffi::use_remote_type!(bitwarden_crypto::SymmetricCryptoKey);
type DateTime = chrono::DateTime<chrono::Utc>;
uniffi::custom_type!(DateTime, std::time::SystemTime, { remote });
uniffi::custom_type!(Uuid, String, {
remote,
try_lift: |val| convert_result(Uuid::parse_str(&val)),
lower: |obj| obj.to_string(),
});
#[allow(dead_code)]
#[derive(uniffi::Record)]
struct UniffiConverterDummyRecord {
uuid: Uuid,
date: DateTime,
}
uniffi::custom_type!(SignedSecurityState, String, {
try_lift: |val| {
convert_result(SignedSecurityState::from_str(&val))
},
lower: |obj| obj.into(),
});