Skip to main content

web_sys/features/
gen_HtmlCollection.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 = "::js_sys::Object",
9        js_name = "HTMLCollection",
10        typescript_type = "HTMLCollection"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `HtmlCollection` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `HtmlCollection`*"]
18    pub type HtmlCollection;
19    #[wasm_bindgen(method, getter, js_class = "HTMLCollection", js_name = "length")]
20    #[doc = "Getter for the `length` field of this object."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection/length)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `HtmlCollection`*"]
25    pub fn length(this: &HtmlCollection) -> u32;
26    #[cfg(feature = "Element")]
27    #[wasm_bindgen(method, js_class = "HTMLCollection")]
28    #[doc = "The `item()` method."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection/item)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `Element`, `HtmlCollection`*"]
33    pub fn item(this: &HtmlCollection, index: u32) -> Option<Element>;
34    #[cfg(feature = "Element")]
35    #[wasm_bindgen(method, js_class = "HTMLCollection", js_name = "namedItem")]
36    #[doc = "The `namedItem()` method."]
37    #[doc = ""]
38    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection/namedItem)"]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `Element`, `HtmlCollection`*"]
41    pub fn named_item(this: &HtmlCollection, name: &str) -> Option<Element>;
42    #[cfg(feature = "Element")]
43    #[wasm_bindgen(method, js_class = "HTMLCollection", indexing_getter)]
44    #[doc = "Indexing getter. As in the literal Javascript `this[key]`."]
45    #[doc = ""]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `Element`, `HtmlCollection`*"]
48    pub fn get_with_index(this: &HtmlCollection, index: u32) -> Option<Element>;
49    #[cfg(feature = "Element")]
50    #[wasm_bindgen(method, js_class = "HTMLCollection", indexing_getter)]
51    #[doc = "Indexing getter. As in the literal Javascript `this[key]`."]
52    #[doc = ""]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `Element`, `HtmlCollection`*"]
55    pub fn get_with_name(this: &HtmlCollection, name: &str) -> Option<Element>;
56}