Skip to content

Commit

Permalink
Generate getters for all WebIDL dictionary types
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jul 28, 2024
1 parent e8b023c commit bb084e5
Show file tree
Hide file tree
Showing 551 changed files with 20,676 additions and 5,027 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
* Add bindings for `RTCRtpReceiver.jitterBufferTarget`.
[#3968](https://github.com/rustwasm/wasm-bindgen/pull/3968)

* Generate getters for all WebIDL dictionary types.
[#3993](https://github.com/rustwasm/wasm-bindgen/pull/3993)

### Changed

* Stabilize Web Share API.
Expand Down
27 changes: 21 additions & 6 deletions crates/web-sys/src/features/gen_AddEventListenerOptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,27 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub type AddEventListenerOptions;
#[doc = "Get the `capture` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, getter = "capture")]
pub fn get_capture(this: &AddEventListenerOptions) -> Option<bool>;
#[wasm_bindgen(method, setter = "capture")]
fn capture_shim(this: &AddEventListenerOptions, val: bool);
fn set_capture(this: &AddEventListenerOptions, val: bool);
#[doc = "Get the `once` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, getter = "once")]
pub fn get_once(this: &AddEventListenerOptions) -> Option<bool>;
#[wasm_bindgen(method, setter = "once")]
fn once_shim(this: &AddEventListenerOptions, val: bool);
fn set_once(this: &AddEventListenerOptions, val: bool);
#[doc = "Get the `passive` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, getter = "passive")]
pub fn get_passive(this: &AddEventListenerOptions) -> Option<bool>;
#[wasm_bindgen(method, setter = "passive")]
fn passive_shim(this: &AddEventListenerOptions, val: bool);
fn set_passive(this: &AddEventListenerOptions, val: bool);
}
impl AddEventListenerOptions {
#[doc = "Construct a new `AddEventListenerOptions`."]
Expand All @@ -30,21 +45,21 @@ impl AddEventListenerOptions {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub fn capture(&mut self, val: bool) -> &mut Self {
self.capture_shim(val);
self.set_capture(val);
self
}
#[doc = "Change the `once` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub fn once(&mut self, val: bool) -> &mut Self {
self.once_shim(val);
self.set_once(val);
self
}
#[doc = "Change the `passive` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub fn passive(&mut self, val: bool) -> &mut Self {
self.passive_shim(val);
self.set_passive(val);
self
}
}
Expand Down
18 changes: 14 additions & 4 deletions crates/web-sys/src/features/gen_AesCbcParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
pub type AesCbcParams;
#[doc = "Get the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesCbcParams) -> String;
#[wasm_bindgen(method, setter = "name")]
fn name_shim(this: &AesCbcParams, val: &str);
fn set_name(this: &AesCbcParams, val: &str);
#[doc = "Get the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[wasm_bindgen(method, getter = "iv")]
pub fn get_iv(this: &AesCbcParams) -> ::js_sys::Object;
#[wasm_bindgen(method, setter = "iv")]
fn iv_shim(this: &AesCbcParams, val: &::js_sys::Object);
fn set_iv(this: &AesCbcParams, val: &::js_sys::Object);
}
impl AesCbcParams {
#[doc = "Construct a new `AesCbcParams`."]
Expand All @@ -30,14 +40,14 @@ impl AesCbcParams {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
self.name_shim(val);
self.set_name(val);
self
}
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self {
self.iv_shim(val);
self.set_iv(val);
self
}
}
27 changes: 21 additions & 6 deletions crates/web-sys/src/features/gen_AesCtrParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,27 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub type AesCtrParams;
#[doc = "Get the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesCtrParams) -> String;
#[wasm_bindgen(method, setter = "name")]
fn name_shim(this: &AesCtrParams, val: &str);
fn set_name(this: &AesCtrParams, val: &str);
#[doc = "Get the `counter` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, getter = "counter")]
pub fn get_counter(this: &AesCtrParams) -> ::js_sys::Object;
#[wasm_bindgen(method, setter = "counter")]
fn counter_shim(this: &AesCtrParams, val: &::js_sys::Object);
fn set_counter(this: &AesCtrParams, val: &::js_sys::Object);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesCtrParams) -> u8;
#[wasm_bindgen(method, setter = "length")]
fn length_shim(this: &AesCtrParams, val: u8);
fn set_length(this: &AesCtrParams, val: u8);
}
impl AesCtrParams {
#[doc = "Construct a new `AesCtrParams`."]
Expand All @@ -33,21 +48,21 @@ impl AesCtrParams {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
self.name_shim(val);
self.set_name(val);
self
}
#[doc = "Change the `counter` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub fn counter(&mut self, val: &::js_sys::Object) -> &mut Self {
self.counter_shim(val);
self.set_counter(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub fn length(&mut self, val: u8) -> &mut Self {
self.length_shim(val);
self.set_length(val);
self
}
}
18 changes: 14 additions & 4 deletions crates/web-sys/src/features/gen_AesDerivedKeyParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
pub type AesDerivedKeyParams;
#[doc = "Get the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesDerivedKeyParams) -> String;
#[wasm_bindgen(method, setter = "name")]
fn name_shim(this: &AesDerivedKeyParams, val: &str);
fn set_name(this: &AesDerivedKeyParams, val: &str);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesDerivedKeyParams) -> u32;
#[wasm_bindgen(method, setter = "length")]
fn length_shim(this: &AesDerivedKeyParams, val: u32);
fn set_length(this: &AesDerivedKeyParams, val: u32);
}
impl AesDerivedKeyParams {
#[doc = "Construct a new `AesDerivedKeyParams`."]
Expand All @@ -30,14 +40,14 @@ impl AesDerivedKeyParams {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
self.name_shim(val);
self.set_name(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
pub fn length(&mut self, val: u32) -> &mut Self {
self.length_shim(val);
self.set_length(val);
self
}
}
36 changes: 28 additions & 8 deletions crates/web-sys/src/features/gen_AesGcmParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,34 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub type AesGcmParams;
#[doc = "Get the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesGcmParams) -> String;
#[wasm_bindgen(method, setter = "name")]
fn name_shim(this: &AesGcmParams, val: &str);
fn set_name(this: &AesGcmParams, val: &str);
#[doc = "Get the `additionalData` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "additionalData")]
pub fn get_additional_data(this: &AesGcmParams) -> Option<::js_sys::Object>;
#[wasm_bindgen(method, setter = "additionalData")]
fn additional_data_shim(this: &AesGcmParams, val: &::js_sys::Object);
fn set_additional_data(this: &AesGcmParams, val: &::js_sys::Object);
#[doc = "Get the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "iv")]
pub fn get_iv(this: &AesGcmParams) -> ::js_sys::Object;
#[wasm_bindgen(method, setter = "iv")]
fn iv_shim(this: &AesGcmParams, val: &::js_sys::Object);
fn set_iv(this: &AesGcmParams, val: &::js_sys::Object);
#[doc = "Get the `tagLength` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "tagLength")]
pub fn get_tag_length(this: &AesGcmParams) -> Option<u8>;
#[wasm_bindgen(method, setter = "tagLength")]
fn tag_length_shim(this: &AesGcmParams, val: u8);
fn set_tag_length(this: &AesGcmParams, val: u8);
}
impl AesGcmParams {
#[doc = "Construct a new `AesGcmParams`."]
Expand All @@ -34,28 +54,28 @@ impl AesGcmParams {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
self.name_shim(val);
self.set_name(val);
self
}
#[doc = "Change the `additionalData` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn additional_data(&mut self, val: &::js_sys::Object) -> &mut Self {
self.additional_data_shim(val);
self.set_additional_data(val);
self
}
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self {
self.iv_shim(val);
self.set_iv(val);
self
}
#[doc = "Change the `tagLength` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn tag_length(&mut self, val: u8) -> &mut Self {
self.tag_length_shim(val);
self.set_tag_length(val);
self
}
}
18 changes: 14 additions & 4 deletions crates/web-sys/src/features/gen_AesKeyAlgorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
pub type AesKeyAlgorithm;
#[doc = "Get the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesKeyAlgorithm) -> String;
#[wasm_bindgen(method, setter = "name")]
fn name_shim(this: &AesKeyAlgorithm, val: &str);
fn set_name(this: &AesKeyAlgorithm, val: &str);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesKeyAlgorithm) -> u16;
#[wasm_bindgen(method, setter = "length")]
fn length_shim(this: &AesKeyAlgorithm, val: u16);
fn set_length(this: &AesKeyAlgorithm, val: u16);
}
impl AesKeyAlgorithm {
#[doc = "Construct a new `AesKeyAlgorithm`."]
Expand All @@ -30,14 +40,14 @@ impl AesKeyAlgorithm {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
self.name_shim(val);
self.set_name(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
pub fn length(&mut self, val: u16) -> &mut Self {
self.length_shim(val);
self.set_length(val);
self
}
}
18 changes: 14 additions & 4 deletions crates/web-sys/src/features/gen_AesKeyGenParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
pub type AesKeyGenParams;
#[doc = "Get the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesKeyGenParams) -> String;
#[wasm_bindgen(method, setter = "name")]
fn name_shim(this: &AesKeyGenParams, val: &str);
fn set_name(this: &AesKeyGenParams, val: &str);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesKeyGenParams) -> u16;
#[wasm_bindgen(method, setter = "length")]
fn length_shim(this: &AesKeyGenParams, val: u16);
fn set_length(this: &AesKeyGenParams, val: u16);
}
impl AesKeyGenParams {
#[doc = "Construct a new `AesKeyGenParams`."]
Expand All @@ -30,14 +40,14 @@ impl AesKeyGenParams {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
self.name_shim(val);
self.set_name(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
pub fn length(&mut self, val: u16) -> &mut Self {
self.length_shim(val);
self.set_length(val);
self
}
}
9 changes: 7 additions & 2 deletions crates/web-sys/src/features/gen_Algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
pub type Algorithm;
#[doc = "Get the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &Algorithm) -> String;
#[wasm_bindgen(method, setter = "name")]
fn name_shim(this: &Algorithm, val: &str);
fn set_name(this: &Algorithm, val: &str);
}
impl Algorithm {
#[doc = "Construct a new `Algorithm`."]
Expand All @@ -27,7 +32,7 @@ impl Algorithm {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
self.name_shim(val);
self.set_name(val);
self
}
}
Loading

0 comments on commit bb084e5

Please sign in to comment.