1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = OffscreenCanvas , typescript_type = "OffscreenCanvas")]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `OffscreenCanvas` class."]
9     #[doc = ""]
10     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas)"]
11     #[doc = ""]
12     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
13     pub type OffscreenCanvas;
14     # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvas" , js_name = width)]
15     #[doc = "Getter for the `width` field of this object."]
16     #[doc = ""]
17     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/width)"]
18     #[doc = ""]
19     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
width(this: &OffscreenCanvas) -> u3220     pub fn width(this: &OffscreenCanvas) -> u32;
21     # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvas" , js_name = width)]
22     #[doc = "Setter for the `width` field of this object."]
23     #[doc = ""]
24     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/width)"]
25     #[doc = ""]
26     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
set_width(this: &OffscreenCanvas, value: u32)27     pub fn set_width(this: &OffscreenCanvas, value: u32);
28     # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvas" , js_name = height)]
29     #[doc = "Getter for the `height` field of this object."]
30     #[doc = ""]
31     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/height)"]
32     #[doc = ""]
33     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
height(this: &OffscreenCanvas) -> u3234     pub fn height(this: &OffscreenCanvas) -> u32;
35     # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvas" , js_name = height)]
36     #[doc = "Setter for the `height` field of this object."]
37     #[doc = ""]
38     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/height)"]
39     #[doc = ""]
40     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
set_height(this: &OffscreenCanvas, value: u32)41     pub fn set_height(this: &OffscreenCanvas, value: u32);
42     #[wasm_bindgen(catch, constructor, js_class = "OffscreenCanvas")]
43     #[doc = "The `new OffscreenCanvas(..)` constructor, creating a new instance of `OffscreenCanvas`."]
44     #[doc = ""]
45     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/OffscreenCanvas)"]
46     #[doc = ""]
47     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
new(width: u32, height: u32) -> Result<OffscreenCanvas, JsValue>48     pub fn new(width: u32, height: u32) -> Result<OffscreenCanvas, JsValue>;
49     # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = getContext)]
50     #[doc = "The `getContext()` method."]
51     #[doc = ""]
52     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/getContext)"]
53     #[doc = ""]
54     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
get_context( this: &OffscreenCanvas, context_id: &str, ) -> Result<Option<::js_sys::Object>, JsValue>55     pub fn get_context(
56         this: &OffscreenCanvas,
57         context_id: &str,
58     ) -> Result<Option<::js_sys::Object>, JsValue>;
59     # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = getContext)]
60     #[doc = "The `getContext()` method."]
61     #[doc = ""]
62     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/getContext)"]
63     #[doc = ""]
64     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
get_context_with_context_options( this: &OffscreenCanvas, context_id: &str, context_options: &::wasm_bindgen::JsValue, ) -> Result<Option<::js_sys::Object>, JsValue>65     pub fn get_context_with_context_options(
66         this: &OffscreenCanvas,
67         context_id: &str,
68         context_options: &::wasm_bindgen::JsValue,
69     ) -> Result<Option<::js_sys::Object>, JsValue>;
70     # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = toBlob)]
71     #[doc = "The `toBlob()` method."]
72     #[doc = ""]
73     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/toBlob)"]
74     #[doc = ""]
75     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
to_blob(this: &OffscreenCanvas) -> Result<::js_sys::Promise, JsValue>76     pub fn to_blob(this: &OffscreenCanvas) -> Result<::js_sys::Promise, JsValue>;
77     # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = toBlob)]
78     #[doc = "The `toBlob()` method."]
79     #[doc = ""]
80     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/toBlob)"]
81     #[doc = ""]
82     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
to_blob_with_type( this: &OffscreenCanvas, type_: &str, ) -> Result<::js_sys::Promise, JsValue>83     pub fn to_blob_with_type(
84         this: &OffscreenCanvas,
85         type_: &str,
86     ) -> Result<::js_sys::Promise, JsValue>;
87     # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = toBlob)]
88     #[doc = "The `toBlob()` method."]
89     #[doc = ""]
90     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/toBlob)"]
91     #[doc = ""]
92     #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"]
to_blob_with_type_and_encoder_options( this: &OffscreenCanvas, type_: &str, encoder_options: &::wasm_bindgen::JsValue, ) -> Result<::js_sys::Promise, JsValue>93     pub fn to_blob_with_type_and_encoder_options(
94         this: &OffscreenCanvas,
95         type_: &str,
96         encoder_options: &::wasm_bindgen::JsValue,
97     ) -> Result<::js_sys::Promise, JsValue>;
98     #[cfg(feature = "ImageBitmap")]
99     # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = transferToImageBitmap)]
100     #[doc = "The `transferToImageBitmap()` method."]
101     #[doc = ""]
102     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/transferToImageBitmap)"]
103     #[doc = ""]
104     #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `OffscreenCanvas`*"]
transfer_to_image_bitmap(this: &OffscreenCanvas) -> Result<ImageBitmap, JsValue>105     pub fn transfer_to_image_bitmap(this: &OffscreenCanvas) -> Result<ImageBitmap, JsValue>;
106 }
107