web_sys/features/
gen_CssStyleSheet.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = StyleSheet , extends = :: js_sys :: Object , js_name = CSSStyleSheet , typescript_type = "CSSStyleSheet")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `CssStyleSheet` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"]
14    pub type CssStyleSheet;
15    #[cfg(feature = "CssRule")]
16    # [wasm_bindgen (structural , method , getter , js_class = "CSSStyleSheet" , js_name = ownerRule)]
17    #[doc = "Getter for the `ownerRule` field of this object."]
18    #[doc = ""]
19    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/ownerRule)"]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `CssRule`, `CssStyleSheet`*"]
22    pub fn owner_rule(this: &CssStyleSheet) -> Option<CssRule>;
23    #[cfg(feature = "CssRuleList")]
24    # [wasm_bindgen (structural , catch , method , getter , js_class = "CSSStyleSheet" , js_name = cssRules)]
25    #[doc = "Getter for the `cssRules` field of this object."]
26    #[doc = ""]
27    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/cssRules)"]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `CssRuleList`, `CssStyleSheet`*"]
30    pub fn css_rules(this: &CssStyleSheet) -> Result<CssRuleList, JsValue>;
31    #[wasm_bindgen(catch, constructor, js_class = "CSSStyleSheet")]
32    #[doc = "The `new CssStyleSheet(..)` constructor, creating a new instance of `CssStyleSheet`."]
33    #[doc = ""]
34    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet)"]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"]
37    pub fn new() -> Result<CssStyleSheet, JsValue>;
38    # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleSheet" , js_name = deleteRule)]
39    #[doc = "The `deleteRule()` method."]
40    #[doc = ""]
41    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/deleteRule)"]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"]
44    pub fn delete_rule(this: &CssStyleSheet, index: u32) -> Result<(), JsValue>;
45    # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleSheet" , js_name = insertRule)]
46    #[doc = "The `insertRule()` method."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/insertRule)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"]
51    pub fn insert_rule(this: &CssStyleSheet, rule: &str) -> Result<u32, JsValue>;
52    # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleSheet" , js_name = insertRule)]
53    #[doc = "The `insertRule()` method."]
54    #[doc = ""]
55    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/insertRule)"]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"]
58    pub fn insert_rule_with_index(
59        this: &CssStyleSheet,
60        rule: &str,
61        index: u32,
62    ) -> Result<u32, JsValue>;
63    # [wasm_bindgen (method , structural , js_class = "CSSStyleSheet" , js_name = replace)]
64    #[doc = "The `replace()` method."]
65    #[doc = ""]
66    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/replace)"]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"]
69    pub fn replace(this: &CssStyleSheet, text: &str) -> ::js_sys::Promise;
70    # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleSheet" , js_name = replaceSync)]
71    #[doc = "The `replaceSync()` method."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/replaceSync)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"]
76    pub fn replace_sync(this: &CssStyleSheet, text: &str) -> Result<(), JsValue>;
77}