Skip to content

Commit

Permalink
Apply requested changes v2
Browse files Browse the repository at this point in the history
Signed-off-by: TukanDev <contact@tukandev.com>
  • Loading branch information
TukanDev committed Feb 24, 2024
1 parent 97b73ac commit 64e8b35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 4 additions & 6 deletions plugins/clipboard-manager/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -62,7 +60,7 @@ async function readText(): Promise<string> {
* import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager';
* await writeHtml('<h1>Tauri is awesome!</h1>', 'plaintext');
* await writeHtml('<h1>Tauri is awesome!</h1>', '<h1>Tauri is awesome</h1>'); // Will write "<h1>Tauri is awesome</h1>" as plain text
* assert(await readHtml(), '<h1>Tauri is awesome!</h1>');
* assert(await readText(), '<h1>Tauri is awesome!</h1>');
* ```
*
* @returns A promise indicating the success or failure of the operation.
Expand All @@ -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
*/
Expand Down
3 changes: 1 addition & 2 deletions plugins/clipboard-manager/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> }
PlainText { text: String }
}

0 comments on commit 64e8b35

Please sign in to comment.