web_sys/features/
gen_Clipboard.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "EventTarget",
9 extends = "::js_sys::Object",
10 js_name = "Clipboard",
11 typescript_type = "Clipboard"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `Clipboard` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"]
19 pub type Clipboard;
20 #[wasm_bindgen(method, js_class = "Clipboard")]
21 #[doc = "The `read()` method."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"]
26 pub fn read(this: &Clipboard) -> ::js_sys::Promise;
27 #[cfg(web_sys_unstable_apis)]
28 #[cfg(all(feature = "ClipboardItem", feature = "ClipboardUnsanitizedFormats",))]
29 #[wasm_bindgen(method, js_class = "Clipboard", js_name = "read")]
30 #[doc = "The `read()` method."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `Clipboard`, `ClipboardItem`, `ClipboardUnsanitizedFormats`*"]
35 #[doc = ""]
36 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
37 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
38 pub fn read_with_formats(
39 this: &Clipboard,
40 formats: &ClipboardUnsanitizedFormats,
41 ) -> ::js_sys::Promise<::js_sys::Array<ClipboardItem>>;
42 #[wasm_bindgen(method, js_class = "Clipboard", js_name = "readText")]
43 #[doc = "The `readText()` method."]
44 #[doc = ""]
45 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText)"]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"]
48 pub fn read_text(this: &Clipboard) -> ::js_sys::Promise;
49 #[wasm_bindgen(method, js_class = "Clipboard")]
50 #[doc = "The `write()` method."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/write)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"]
55 pub fn write(this: &Clipboard, data: &::wasm_bindgen::JsValue) -> ::js_sys::Promise;
56 #[wasm_bindgen(method, js_class = "Clipboard", js_name = "writeText")]
57 #[doc = "The `writeText()` method."]
58 #[doc = ""]
59 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText)"]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"]
62 pub fn write_text(this: &Clipboard, data: &str) -> ::js_sys::Promise;
63}