#![forbid(unsafe_code)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[derive(Default)]
pub struct DisplayCapturePreferences {
display_surface_hint: Option<String>,
}
#[wasm_bindgen]
impl DisplayCapturePreferences {
#[wasm_bindgen(constructor)]
#[allow(clippy::missing_const_for_fn, reason = "wasm_bindgen constructor")]
pub fn new() -> Self {
Self {
display_surface_hint: None,
}
}
#[wasm_bindgen(getter)]
pub fn display_surface_hint(&self) -> Option<String> {
self.display_surface_hint.clone()
}
#[wasm_bindgen(setter)]
pub fn set_display_surface_hint(&mut self, hint: Option<String>) {
self.display_surface_hint = hint;
}
}
#[wasm_bindgen]
pub struct UserMediaPreferences {
video: bool,
audio: bool,
device_id_hint: Option<String>,
}
#[wasm_bindgen]
impl UserMediaPreferences {
#[wasm_bindgen(constructor)]
#[allow(clippy::missing_const_for_fn, reason = "wasm_bindgen constructor")]
pub fn new(video: bool, audio: bool) -> Self {
Self {
video,
audio,
device_id_hint: None,
}
}
#[wasm_bindgen(getter)]
#[allow(clippy::missing_const_for_fn, reason = "wasm_bindgen getter")]
pub fn video(&self) -> bool {
self.video
}
#[wasm_bindgen(getter)]
#[allow(clippy::missing_const_for_fn, reason = "wasm_bindgen getter")]
pub fn audio(&self) -> bool {
self.audio
}
#[wasm_bindgen(getter)]
pub fn device_id_hint(&self) -> Option<String> {
self.device_id_hint.clone()
}
#[wasm_bindgen(setter)]
pub fn set_device_id_hint(&mut self, id: Option<String>) {
self.device_id_hint = id;
}
}