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