ugly hack

This commit is contained in:
Toshit Chawda 2024-09-06 20:58:15 -07:00
parent 2d25aa9c92
commit 2218f998c0
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D

View file

@ -185,6 +185,10 @@ enum EpoxyCompression {
Gzip, Gzip,
} }
// ugly hack. switch to serde-wasm-bindgen or a knockoff
cfg_if! {
if #[cfg(feature = "full")] {
#[wasm_bindgen] #[wasm_bindgen]
pub struct EpoxyClientOptions { pub struct EpoxyClientOptions {
pub wisp_v2: bool, pub wisp_v2: bool,
@ -194,10 +198,22 @@ pub struct EpoxyClientOptions {
pub redirect_limit: usize, pub redirect_limit: usize,
#[wasm_bindgen(getter_with_clone)] #[wasm_bindgen(getter_with_clone)]
pub user_agent: String, pub user_agent: String,
#[cfg(feature = "full")]
#[wasm_bindgen(getter_with_clone)] #[wasm_bindgen(getter_with_clone)]
pub pem_files: Vec<String>, pub pem_files: Vec<String>,
} }
} else {
#[wasm_bindgen]
pub struct EpoxyClientOptions {
pub wisp_v2: bool,
pub udp_extension_required: bool,
#[wasm_bindgen(getter_with_clone)]
pub websocket_protocols: Vec<String>,
pub redirect_limit: usize,
#[wasm_bindgen(getter_with_clone)]
pub user_agent: String,
}
}
}
#[wasm_bindgen] #[wasm_bindgen]
impl EpoxyClientOptions { impl EpoxyClientOptions {