@tauri-apps/plugin-clipboard-manager 3.0.0-alpha.1 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist-js/index.cjs +8 -0
- package/dist-js/index.d.ts +8 -0
- package/dist-js/index.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Read and write to the system clipboard.
|
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
|
-
_This plugin requires a Rust version of at least **1.
|
|
15
|
+
_This plugin requires a Rust version of at least **1.95**_
|
|
16
16
|
|
|
17
17
|
There are three general methods of installation that we can recommend.
|
|
18
18
|
|
package/dist-js/index.cjs
CHANGED
|
@@ -20,6 +20,9 @@ var image = require('@tauri-apps/api/image');
|
|
|
20
20
|
* assert(await readText(), 'Tauri is awesome!');
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
23
|
+
* @param text The plain text to write to the clipboard.
|
|
24
|
+
* @param opts Additional configuration for the write operation.
|
|
25
|
+
* @param opts.label A label describing the copied content. **Android only**, ignored on other platforms.
|
|
23
26
|
* @returns A promise indicating the success or failure of the operation.
|
|
24
27
|
*
|
|
25
28
|
* @since 2.0.0
|
|
@@ -37,6 +40,7 @@ async function writeText(text, opts) {
|
|
|
37
40
|
* import { readText } from '@tauri-apps/plugin-clipboard-manager';
|
|
38
41
|
* const clipboardText = await readText();
|
|
39
42
|
* ```
|
|
43
|
+
* @returns A promise resolving to the clipboard contents as plain text.
|
|
40
44
|
* @since 2.0.0
|
|
41
45
|
*/
|
|
42
46
|
async function readText() {
|
|
@@ -62,6 +66,7 @@ async function readText() {
|
|
|
62
66
|
* await writeImage(buffer);
|
|
63
67
|
* ```
|
|
64
68
|
*
|
|
69
|
+
* @param image The image to write, as a path, raw RGBA bytes, or an existing {@link Image}.
|
|
65
70
|
* @returns A promise indicating the success or failure of the operation.
|
|
66
71
|
*
|
|
67
72
|
* @since 2.0.0
|
|
@@ -86,6 +91,7 @@ async function writeImage(image$1) {
|
|
|
86
91
|
* const blob = new Blob([await clipboardImage.rgba()], { type: 'image' })
|
|
87
92
|
* const url = URL.createObjectURL(blob)
|
|
88
93
|
* ```
|
|
94
|
+
* @returns A promise resolving to the clipboard contents as an {@link Image}.
|
|
89
95
|
* @since 2.0.0
|
|
90
96
|
*/
|
|
91
97
|
async function readImage() {
|
|
@@ -108,6 +114,8 @@ async function readImage() {
|
|
|
108
114
|
* assert(await readText(), '<h1>Tauri is awesome!</h1>');
|
|
109
115
|
* ```
|
|
110
116
|
*
|
|
117
|
+
* @param html The HTML markup to write to the clipboard.
|
|
118
|
+
* @param altText The plain text fallback written alongside the HTML, used by targets that cannot render it.
|
|
111
119
|
* @returns A promise indicating the success or failure of the operation.
|
|
112
120
|
*
|
|
113
121
|
* @since 2.0.0
|
package/dist-js/index.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { Image } from '@tauri-apps/api/image';
|
|
|
8
8
|
* assert(await readText(), 'Tauri is awesome!');
|
|
9
9
|
* ```
|
|
10
10
|
*
|
|
11
|
+
* @param text The plain text to write to the clipboard.
|
|
12
|
+
* @param opts Additional configuration for the write operation.
|
|
13
|
+
* @param opts.label A label describing the copied content. **Android only**, ignored on other platforms.
|
|
11
14
|
* @returns A promise indicating the success or failure of the operation.
|
|
12
15
|
*
|
|
13
16
|
* @since 2.0.0
|
|
@@ -22,6 +25,7 @@ declare function writeText(text: string, opts?: {
|
|
|
22
25
|
* import { readText } from '@tauri-apps/plugin-clipboard-manager';
|
|
23
26
|
* const clipboardText = await readText();
|
|
24
27
|
* ```
|
|
28
|
+
* @returns A promise resolving to the clipboard contents as plain text.
|
|
25
29
|
* @since 2.0.0
|
|
26
30
|
*/
|
|
27
31
|
declare function readText(): Promise<string>;
|
|
@@ -45,6 +49,7 @@ declare function readText(): Promise<string>;
|
|
|
45
49
|
* await writeImage(buffer);
|
|
46
50
|
* ```
|
|
47
51
|
*
|
|
52
|
+
* @param image The image to write, as a path, raw RGBA bytes, or an existing {@link Image}.
|
|
48
53
|
* @returns A promise indicating the success or failure of the operation.
|
|
49
54
|
*
|
|
50
55
|
* @since 2.0.0
|
|
@@ -65,6 +70,7 @@ declare function writeImage(image: string | Image | Uint8Array | ArrayBuffer | n
|
|
|
65
70
|
* const blob = new Blob([await clipboardImage.rgba()], { type: 'image' })
|
|
66
71
|
* const url = URL.createObjectURL(blob)
|
|
67
72
|
* ```
|
|
73
|
+
* @returns A promise resolving to the clipboard contents as an {@link Image}.
|
|
68
74
|
* @since 2.0.0
|
|
69
75
|
*/
|
|
70
76
|
declare function readImage(): Promise<Image>;
|
|
@@ -85,6 +91,8 @@ declare function readImage(): Promise<Image>;
|
|
|
85
91
|
* assert(await readText(), '<h1>Tauri is awesome!</h1>');
|
|
86
92
|
* ```
|
|
87
93
|
*
|
|
94
|
+
* @param html The HTML markup to write to the clipboard.
|
|
95
|
+
* @param altText The plain text fallback written alongside the HTML, used by targets that cannot render it.
|
|
88
96
|
* @returns A promise indicating the success or failure of the operation.
|
|
89
97
|
*
|
|
90
98
|
* @since 2.0.0
|
package/dist-js/index.js
CHANGED
|
@@ -18,6 +18,9 @@ import { transformImage, Image } from '@tauri-apps/api/image';
|
|
|
18
18
|
* assert(await readText(), 'Tauri is awesome!');
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
|
+
* @param text The plain text to write to the clipboard.
|
|
22
|
+
* @param opts Additional configuration for the write operation.
|
|
23
|
+
* @param opts.label A label describing the copied content. **Android only**, ignored on other platforms.
|
|
21
24
|
* @returns A promise indicating the success or failure of the operation.
|
|
22
25
|
*
|
|
23
26
|
* @since 2.0.0
|
|
@@ -35,6 +38,7 @@ async function writeText(text, opts) {
|
|
|
35
38
|
* import { readText } from '@tauri-apps/plugin-clipboard-manager';
|
|
36
39
|
* const clipboardText = await readText();
|
|
37
40
|
* ```
|
|
41
|
+
* @returns A promise resolving to the clipboard contents as plain text.
|
|
38
42
|
* @since 2.0.0
|
|
39
43
|
*/
|
|
40
44
|
async function readText() {
|
|
@@ -60,6 +64,7 @@ async function readText() {
|
|
|
60
64
|
* await writeImage(buffer);
|
|
61
65
|
* ```
|
|
62
66
|
*
|
|
67
|
+
* @param image The image to write, as a path, raw RGBA bytes, or an existing {@link Image}.
|
|
63
68
|
* @returns A promise indicating the success or failure of the operation.
|
|
64
69
|
*
|
|
65
70
|
* @since 2.0.0
|
|
@@ -84,6 +89,7 @@ async function writeImage(image) {
|
|
|
84
89
|
* const blob = new Blob([await clipboardImage.rgba()], { type: 'image' })
|
|
85
90
|
* const url = URL.createObjectURL(blob)
|
|
86
91
|
* ```
|
|
92
|
+
* @returns A promise resolving to the clipboard contents as an {@link Image}.
|
|
87
93
|
* @since 2.0.0
|
|
88
94
|
*/
|
|
89
95
|
async function readImage() {
|
|
@@ -106,6 +112,8 @@ async function readImage() {
|
|
|
106
112
|
* assert(await readText(), '<h1>Tauri is awesome!</h1>');
|
|
107
113
|
* ```
|
|
108
114
|
*
|
|
115
|
+
* @param html The HTML markup to write to the clipboard.
|
|
116
|
+
* @param altText The plain text fallback written alongside the HTML, used by targets that cannot render it.
|
|
109
117
|
* @returns A promise indicating the success or failure of the operation.
|
|
110
118
|
*
|
|
111
119
|
* @since 2.0.0
|