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