Skip to main content

web_sys/features/
gen_DomParser.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 = "DOMParser",
10        typescript_type = "DOMParser"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `DomParser` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `DomParser`*"]
18    pub type DomParser;
19    #[wasm_bindgen(catch, constructor, js_class = "DOMParser")]
20    #[doc = "The `new DomParser(..)` constructor, creating a new instance of `DomParser`."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/DOMParser)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `DomParser`*"]
25    pub fn new() -> Result<DomParser, JsValue>;
26    #[cfg(all(feature = "Document", feature = "SupportedType",))]
27    #[wasm_bindgen(catch, method, js_class = "DOMParser", js_name = "parseFromString")]
28    #[doc = "The `parseFromString()` method."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `Document`, `DomParser`, `SupportedType`*"]
33    pub fn parse_from_string(
34        this: &DomParser,
35        str: &str,
36        type_: SupportedType,
37    ) -> Result<Document, JsValue>;
38}