maxcountryman_web_sys/features/
gen_HtmlCanvasElement.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = HtmlElement , extends = Element , extends = Node , extends = EventTarget , extends = :: js_sys :: Object , js_name = HTMLCanvasElement , typescript_type = "HTMLCanvasElement")]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `HtmlCanvasElement` class."]
9    #[doc = ""]
10    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement)"]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
13    pub type HtmlCanvasElement;
14    # [wasm_bindgen (structural , method , getter , js_class = "HTMLCanvasElement" , 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/HTMLCanvasElement/width)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
20    pub fn width(this: &HtmlCanvasElement) -> u32;
21    # [wasm_bindgen (structural , method , setter , js_class = "HTMLCanvasElement" , 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/HTMLCanvasElement/width)"]
25    #[doc = ""]
26    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
27    pub fn set_width(this: &HtmlCanvasElement, value: u32);
28    # [wasm_bindgen (structural , method , getter , js_class = "HTMLCanvasElement" , 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/HTMLCanvasElement/height)"]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
34    pub fn height(this: &HtmlCanvasElement) -> u32;
35    # [wasm_bindgen (structural , method , setter , js_class = "HTMLCanvasElement" , 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/HTMLCanvasElement/height)"]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
41    pub fn set_height(this: &HtmlCanvasElement, value: u32);
42    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = getContext)]
43    #[doc = "The `getContext()` method."]
44    #[doc = ""]
45    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext)"]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
48    pub fn get_context(
49        this: &HtmlCanvasElement,
50        context_id: &str,
51    ) -> Result<Option<::js_sys::Object>, JsValue>;
52    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = getContext)]
53    #[doc = "The `getContext()` method."]
54    #[doc = ""]
55    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext)"]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
58    pub fn get_context_with_context_options(
59        this: &HtmlCanvasElement,
60        context_id: &str,
61        context_options: &::wasm_bindgen::JsValue,
62    ) -> Result<Option<::js_sys::Object>, JsValue>;
63    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toBlob)]
64    #[doc = "The `toBlob()` method."]
65    #[doc = ""]
66    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)"]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
69    pub fn to_blob(this: &HtmlCanvasElement, callback: &::js_sys::Function) -> Result<(), JsValue>;
70    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toBlob)]
71    #[doc = "The `toBlob()` method."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
76    pub fn to_blob_with_type(
77        this: &HtmlCanvasElement,
78        callback: &::js_sys::Function,
79        type_: &str,
80    ) -> Result<(), JsValue>;
81    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toBlob)]
82    #[doc = "The `toBlob()` method."]
83    #[doc = ""]
84    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)"]
85    #[doc = ""]
86    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
87    pub fn to_blob_with_type_and_encoder_options(
88        this: &HtmlCanvasElement,
89        callback: &::js_sys::Function,
90        type_: &str,
91        encoder_options: &::wasm_bindgen::JsValue,
92    ) -> Result<(), JsValue>;
93    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toDataURL)]
94    #[doc = "The `toDataURL()` method."]
95    #[doc = ""]
96    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)"]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
99    pub fn to_data_url(this: &HtmlCanvasElement) -> Result<String, JsValue>;
100    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toDataURL)]
101    #[doc = "The `toDataURL()` method."]
102    #[doc = ""]
103    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)"]
104    #[doc = ""]
105    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
106    pub fn to_data_url_with_type(this: &HtmlCanvasElement, type_: &str) -> Result<String, JsValue>;
107    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toDataURL)]
108    #[doc = "The `toDataURL()` method."]
109    #[doc = ""]
110    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)"]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"]
113    pub fn to_data_url_with_type_and_encoder_options(
114        this: &HtmlCanvasElement,
115        type_: &str,
116        encoder_options: &::wasm_bindgen::JsValue,
117    ) -> Result<String, JsValue>;
118    #[cfg(feature = "OffscreenCanvas")]
119    # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = transferControlToOffscreen)]
120    #[doc = "The `transferControlToOffscreen()` method."]
121    #[doc = ""]
122    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen)"]
123    #[doc = ""]
124    #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `OffscreenCanvas`*"]
125    pub fn transfer_control_to_offscreen(
126        this: &HtmlCanvasElement,
127    ) -> Result<OffscreenCanvas, JsValue>;
128}