diff --git a/plugins/app/README.md b/plugins/app/README.md index 94ba0287..0eb3f159 100644 --- a/plugins/app/README.md +++ b/plugins/app/README.md @@ -60,7 +60,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { getVersion, hide } from '@tauri-apps/plugin-app'; +import { getVersion, hide } from "@tauri-apps/plugin-app"; const appVersion = await getVersion(); await hide(); ``` diff --git a/plugins/cli/README.md b/plugins/cli/README.md index cfe24c64..fea5ff7b 100644 --- a/plugins/cli/README.md +++ b/plugins/cli/README.md @@ -60,16 +60,16 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { getMatches } from '@tauri-apps/plugin-cli'; +import { getMatches } from "@tauri-apps/plugin-cli"; const matches = await getMatches(); -if (matches.subcommand?.name === 'run') { +if (matches.subcommand?.name === "run") { // `./your-app run $ARGS` was executed - const args = matches.subcommand?.matches.args - if ('debug' in args) { + const args = matches.subcommand?.matches.args; + if ("debug" in args) { // `./your-app run --debug` was executed } } else { - const args = matches.args + const args = matches.args; // `./your-app $ARGS` was executed } ``` diff --git a/plugins/clipboard/README.md b/plugins/clipboard/README.md index d71dc606..a527484d 100644 --- a/plugins/clipboard/README.md +++ b/plugins/clipboard/README.md @@ -60,9 +60,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { writeText, readText } from '@tauri-apps/plugin-clipboard'; -await writeText('Tauri is awesome!'); -assert(await readText(), 'Tauri is awesome!'); +import { writeText, readText } from "@tauri-apps/plugin-clipboard"; +await writeText("Tauri is awesome!"); +assert(await readText(), "Tauri is awesome!"); ``` ## Contributing diff --git a/plugins/http/README.md b/plugins/http/README.md index 17d45ba1..e6e9cc1d 100644 --- a/plugins/http/README.md +++ b/plugins/http/README.md @@ -60,9 +60,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { fetch } from '@tauri-apps/plugin-http'; -const response = await fetch('http://localhost:3003/users/2', { - method: 'GET', +import { fetch } from "@tauri-apps/plugin-http"; +const response = await fetch("http://localhost:3003/users/2", { + method: "GET", timeout: 30, }); ``` diff --git a/plugins/localhost/README.md b/plugins/localhost/README.md index 79bb0905..5b83bf4b 100644 --- a/plugins/localhost/README.md +++ b/plugins/localhost/README.md @@ -45,7 +45,7 @@ fn main() { RemoteDomainAccessScope::new(format!("localhost:{}", port)) .add_window("main") ); - + let url = format!("http://localhost:{}", port).parse().unwrap(); WindowBuilder::new(app, "main".to_string(), WindowUrl::External(url)) .title("Localhost Example") diff --git a/plugins/os/README.md b/plugins/os/README.md index 244ffc77..b97aef02 100644 --- a/plugins/os/README.md +++ b/plugins/os/README.md @@ -60,7 +60,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { version } from '@tauri-apps/plugin-os'; +import { version } from "@tauri-apps/plugin-os"; const osVersion = await version(); ``` diff --git a/plugins/process/README.md b/plugins/process/README.md index d712b4f7..104df495 100644 --- a/plugins/process/README.md +++ b/plugins/process/README.md @@ -60,7 +60,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { exit, relaunch } from '@tauri-apps/plugin-process'; +import { exit, relaunch } from "@tauri-apps/plugin-process"; // exit the app with the given status code await exit(0); // restart the app diff --git a/plugins/shell/README.md b/plugins/shell/README.md index de442b5d..2e0c2b0e 100644 --- a/plugins/shell/README.md +++ b/plugins/shell/README.md @@ -60,8 +60,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { Command } from '@tauri-apps/plugin-shell' -Command.create('git', ['commit', '-m', 'the commit message']) +import { Command } from "@tauri-apps/plugin-shell"; +Command.create("git", ["commit", "-m", "the commit message"]); ``` ## Contributing diff --git a/plugins/updater/README.md b/plugins/updater/README.md index e96edac6..9d5df52a 100644 --- a/plugins/updater/README.md +++ b/plugins/updater/README.md @@ -64,8 +64,8 @@ import { check } from "@tauri-apps/plugin-updater"; import { relaunch } from "@tauri-apps/plugin-process"; const update = await check(); if (update.response.available) { - await update.downloadAndInstall(); - await relaunch(); + await update.downloadAndInstall(); + await relaunch(); } ``` diff --git a/plugins/window/README.md b/plugins/window/README.md index 70efd3ae..584952e4 100644 --- a/plugins/window/README.md +++ b/plugins/window/README.md @@ -67,12 +67,12 @@ await appWindow.setResizable(false); // Creating new windows: // loading embedded asset: -const webview = new WebviewWindow('theUniqueLabel', { - url: 'path/to/page.html' +const webview = new WebviewWindow("theUniqueLabel", { + url: "path/to/page.html", }); // alternatively, load a remote URL: -const webview = new WebviewWindow('theUniqueLabel', { - url: 'https://github.com/tauri-apps/tauri' +const webview = new WebviewWindow("theUniqueLabel", { + url: "https://github.com/tauri-apps/tauri", }); ``` diff --git a/plugins/window/guest-js/index.ts b/plugins/window/guest-js/index.ts index afe5bc0f..038fdc05 100644 --- a/plugins/window/guest-js/index.ts +++ b/plugins/window/guest-js/index.ts @@ -972,12 +972,12 @@ class WindowManager extends WebviewWindowHandle { label: this.label, value: size ? { - type: size.type, - data: { - width: size.width, - height: size.height, - }, - } + type: size.type, + data: { + width: size.width, + height: size.height, + }, + } : null, }); } @@ -1006,12 +1006,12 @@ class WindowManager extends WebviewWindowHandle { label: this.label, value: size ? { - type: size.type, - data: { - width: size.width, - height: size.height, - }, - } + type: size.type, + data: { + width: size.width, + height: size.height, + }, + } : null, }); } @@ -1786,11 +1786,11 @@ function mapMonitor(m: Monitor | null): Monitor | null { return m === null ? null : { - name: m.name, - scaleFactor: m.scaleFactor, - position: mapPhysicalPosition(m.position), - size: mapPhysicalSize(m.size), - }; + name: m.name, + scaleFactor: m.scaleFactor, + position: mapPhysicalPosition(m.position), + size: mapPhysicalSize(m.size), + }; } function mapPhysicalPosition(m: PhysicalPosition): PhysicalPosition {