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