From 64e8b35433d49d6b5883190e0aacfa2c35f3c1be Mon Sep 17 00:00:00 2001 From: TukanDev Date: Sat, 24 Feb 2024 18:03:28 +0100 Subject: [PATCH] Apply requested changes v2 Signed-off-by: TukanDev --- plugins/clipboard-manager/guest-js/index.ts | 10 ++++------ plugins/clipboard-manager/src/models.rs | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/plugins/clipboard-manager/guest-js/index.ts b/plugins/clipboard-manager/guest-js/index.ts index 19ea4f4cc..4cc104dae 100644 --- a/plugins/clipboard-manager/guest-js/index.ts +++ b/plugins/clipboard-manager/guest-js/index.ts @@ -11,8 +11,6 @@ import { invoke } from "@tauri-apps/api/core"; type ClipResponse = Record<"plainText", { text: string }>; -// Commented this type out as it can come in handy to stay -//type ClipHtmlResponse = Record<"html", { html: string, altHtml: string }>; /** * Writes plain text to the clipboard. @@ -62,7 +60,7 @@ async function readText(): Promise { * import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager'; * await writeHtml('

Tauri is awesome!

', 'plaintext'); * await writeHtml('

Tauri is awesome!

', '

Tauri is awesome

'); // Will write "

Tauri is awesome

" as plain text - * assert(await readHtml(), '

Tauri is awesome!

'); + * assert(await readText(), '

Tauri is awesome!

'); * ``` * * @returns A promise indicating the success or failure of the operation. @@ -84,11 +82,11 @@ async function writeHtml( } /** - * Gets the clipboard content as HTML text. + * Clears the clipboard. * @example * ```typescript - * import { readHtml } from '@tauri-apps/plugin-clipboard-manager'; - * const clipboardHtml = await readHtml(); + * import { clear } from '@tauri-apps/plugin-clipboard-manager'; + * await clear(); * ``` * @since 2.0.0 */ diff --git a/plugins/clipboard-manager/src/models.rs b/plugins/clipboard-manager/src/models.rs index f4bff3f29..110ab3334 100644 --- a/plugins/clipboard-manager/src/models.rs +++ b/plugins/clipboard-manager/src/models.rs @@ -14,6 +14,5 @@ pub enum ClipKind { #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum ClipboardContents { - PlainText { text: String }, - Html { html: String, alt_html: Option } + PlainText { text: String } }