mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-12 16:36:33 +02:00
chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)
* chore: adjust prettier config, .gitignore and use taplo to format toml files This brings the plugins-workspace repository to the same code style of the main tauri repo * format toml * ignore examples gen dir * add .vscode/extensions.json * remove packageManager field * fmt * fix audit * taplo ignore permissions autogenerated files * remove create dummy dist * fix prettier workflow * install fmt in prettier workflow --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
* @module
|
||||
*/
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { Image, transformImage } from "@tauri-apps/api/image";
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { Image, transformImage } from '@tauri-apps/api/image'
|
||||
|
||||
/**
|
||||
* Writes plain text to the clipboard.
|
||||
@@ -26,12 +26,12 @@ import { Image, transformImage } from "@tauri-apps/api/image";
|
||||
*/
|
||||
async function writeText(
|
||||
text: string,
|
||||
opts?: { label?: string },
|
||||
opts?: { label?: string }
|
||||
): Promise<void> {
|
||||
await invoke("plugin:clipboard-manager|write_text", {
|
||||
await invoke('plugin:clipboard-manager|write_text', {
|
||||
label: opts?.label,
|
||||
text,
|
||||
});
|
||||
text
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ async function writeText(
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function readText(): Promise<string> {
|
||||
return await invoke("plugin:clipboard-manager|read_text");
|
||||
return await invoke('plugin:clipboard-manager|read_text')
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,11 +66,11 @@ async function readText(): Promise<string> {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function writeImage(
|
||||
image: string | Image | Uint8Array | ArrayBuffer | number[],
|
||||
image: string | Image | Uint8Array | ArrayBuffer | number[]
|
||||
): Promise<void> {
|
||||
await invoke("plugin:clipboard-manager|write_image", {
|
||||
image: transformImage(image),
|
||||
});
|
||||
await invoke('plugin:clipboard-manager|write_image', {
|
||||
image: transformImage(image)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,9 +86,9 @@ async function writeImage(
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function readImage(): Promise<Image> {
|
||||
return await invoke<number>("plugin:clipboard-manager|read_image").then(
|
||||
(rid) => new Image(rid),
|
||||
);
|
||||
return await invoke<number>('plugin:clipboard-manager|read_image').then(
|
||||
(rid) => new Image(rid)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,10 +106,10 @@ async function readImage(): Promise<Image> {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function writeHtml(html: string, altHtml?: string): Promise<void> {
|
||||
await invoke("plugin:clipboard-manager|write_html", {
|
||||
await invoke('plugin:clipboard-manager|write_html', {
|
||||
html,
|
||||
altHtml,
|
||||
});
|
||||
altHtml
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ async function writeHtml(html: string, altHtml?: string): Promise<void> {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function clear(): Promise<void> {
|
||||
await invoke("plugin:clipboard-manager|clear");
|
||||
await invoke('plugin:clipboard-manager|clear')
|
||||
}
|
||||
|
||||
export { writeText, readText, writeHtml, clear, readImage, writeImage };
|
||||
export { writeText, readText, writeHtml, clear, readImage, writeImage }
|
||||
|
||||
Reference in New Issue
Block a user