Skip to main content

web_sys/features/
gen_HtmlOptionsCollection.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "HtmlCollection",
9        extends = "::js_sys::Object",
10        js_name = "HTMLOptionsCollection",
11        typescript_type = "HTMLOptionsCollection"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `HtmlOptionsCollection` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionsCollection`*"]
19    pub type HtmlOptionsCollection;
20    #[wasm_bindgen(method, getter, js_class = "HTMLOptionsCollection", js_name = "length")]
21    #[doc = "Getter for the `length` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/length)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionsCollection`*"]
26    pub fn length(this: &HtmlOptionsCollection) -> u32;
27    #[wasm_bindgen(method, setter, js_class = "HTMLOptionsCollection", js_name = "length")]
28    #[doc = "Setter for the `length` field of this object."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/length)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionsCollection`*"]
33    pub fn set_length(this: &HtmlOptionsCollection, value: u32);
34    #[wasm_bindgen(
35        catch,
36        method,
37        getter,
38        js_class = "HTMLOptionsCollection",
39        js_name = "selectedIndex"
40    )]
41    #[doc = "Getter for the `selectedIndex` field of this object."]
42    #[doc = ""]
43    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/selectedIndex)"]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionsCollection`*"]
46    pub fn selected_index(this: &HtmlOptionsCollection) -> Result<i32, JsValue>;
47    #[wasm_bindgen(
48        catch,
49        method,
50        setter,
51        js_class = "HTMLOptionsCollection",
52        js_name = "selectedIndex"
53    )]
54    #[doc = "Setter for the `selectedIndex` field of this object."]
55    #[doc = ""]
56    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/selectedIndex)"]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionsCollection`*"]
59    pub fn set_selected_index(this: &HtmlOptionsCollection, value: i32) -> Result<(), JsValue>;
60    #[cfg(feature = "HtmlOptionElement")]
61    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection", js_name = "add")]
62    #[doc = "The `add()` method."]
63    #[doc = ""]
64    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/add)"]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionElement`, `HtmlOptionsCollection`*"]
67    pub fn add_with_html_option_element(
68        this: &HtmlOptionsCollection,
69        element: &HtmlOptionElement,
70    ) -> Result<(), JsValue>;
71    #[cfg(feature = "HtmlOptGroupElement")]
72    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection", js_name = "add")]
73    #[doc = "The `add()` method."]
74    #[doc = ""]
75    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/add)"]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `HtmlOptGroupElement`, `HtmlOptionsCollection`*"]
78    pub fn add_with_html_opt_group_element(
79        this: &HtmlOptionsCollection,
80        element: &HtmlOptGroupElement,
81    ) -> Result<(), JsValue>;
82    #[cfg(all(feature = "HtmlElement", feature = "HtmlOptionElement",))]
83    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection", js_name = "add")]
84    #[doc = "The `add()` method."]
85    #[doc = ""]
86    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/add)"]
87    #[doc = ""]
88    #[doc = "*This API requires the following crate features to be activated: `HtmlElement`, `HtmlOptionElement`, `HtmlOptionsCollection`*"]
89    pub fn add_with_html_option_element_and_opt_html_element(
90        this: &HtmlOptionsCollection,
91        element: &HtmlOptionElement,
92        before: Option<&HtmlElement>,
93    ) -> Result<(), JsValue>;
94    #[cfg(all(feature = "HtmlElement", feature = "HtmlOptGroupElement",))]
95    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection", js_name = "add")]
96    #[doc = "The `add()` method."]
97    #[doc = ""]
98    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/add)"]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `HtmlElement`, `HtmlOptGroupElement`, `HtmlOptionsCollection`*"]
101    pub fn add_with_html_opt_group_element_and_opt_html_element(
102        this: &HtmlOptionsCollection,
103        element: &HtmlOptGroupElement,
104        before: Option<&HtmlElement>,
105    ) -> Result<(), JsValue>;
106    #[cfg(feature = "HtmlOptionElement")]
107    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection", js_name = "add")]
108    #[doc = "The `add()` method."]
109    #[doc = ""]
110    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/add)"]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionElement`, `HtmlOptionsCollection`*"]
113    pub fn add_with_html_option_element_and_opt_i32(
114        this: &HtmlOptionsCollection,
115        element: &HtmlOptionElement,
116        before: Option<i32>,
117    ) -> Result<(), JsValue>;
118    #[cfg(feature = "HtmlOptGroupElement")]
119    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection", js_name = "add")]
120    #[doc = "The `add()` method."]
121    #[doc = ""]
122    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/add)"]
123    #[doc = ""]
124    #[doc = "*This API requires the following crate features to be activated: `HtmlOptGroupElement`, `HtmlOptionsCollection`*"]
125    pub fn add_with_html_opt_group_element_and_opt_i32(
126        this: &HtmlOptionsCollection,
127        element: &HtmlOptGroupElement,
128        before: Option<i32>,
129    ) -> Result<(), JsValue>;
130    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection")]
131    #[doc = "The `remove()` method."]
132    #[doc = ""]
133    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection/remove)"]
134    #[doc = ""]
135    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionsCollection`*"]
136    pub fn remove(this: &HtmlOptionsCollection, index: i32) -> Result<(), JsValue>;
137    #[cfg(feature = "HtmlOptionElement")]
138    #[wasm_bindgen(catch, method, js_class = "HTMLOptionsCollection", indexing_setter)]
139    #[doc = "Indexing setter. As in the literal Javascript `this[key] = value`."]
140    #[doc = ""]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `HtmlOptionElement`, `HtmlOptionsCollection`*"]
143    pub fn set(
144        this: &HtmlOptionsCollection,
145        index: u32,
146        option: Option<&HtmlOptionElement>,
147    ) -> Result<(), JsValue>;
148}