maxcountryman_web_sys/features/
gen_HtmlOptionsCollection.rs

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