pull/381/head
Lucas Nogueira 2 years ago
parent 907569c3ba
commit 08c3faae9b
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1

@ -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();
```

@ -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
}
```

@ -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

@ -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,
});
```

@ -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")

@ -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();
```

@ -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

@ -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

@ -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();
}
```

@ -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",
});
```

@ -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 {

Loading…
Cancel
Save