mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-10-26 09:58:16 +03:00
Fix/docs qol improvements (#4641)
This commit is contained in:
parent
95abf48e21
commit
47666c4a0b
@ -5,7 +5,7 @@
|
||||
/**
|
||||
* Get application metadata.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.app` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.app` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
* @module
|
||||
*/
|
||||
|
||||
@ -50,7 +50,7 @@ async function getName(): Promise<string> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the tauri version.
|
||||
* Gets the Tauri version.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
@ -58,7 +58,7 @@ async function getName(): Promise<string> {
|
||||
* const tauriVersion = await getTauriVersion();
|
||||
* ```
|
||||
*
|
||||
* @returns A promise resolving to tauri version.
|
||||
* @returns A promise resolving to Tauri version.
|
||||
*/
|
||||
async function getTauriVersion(): Promise<string> {
|
||||
return invokeTauriCommand<string>({
|
||||
|
@ -5,7 +5,7 @@
|
||||
/**
|
||||
* Parse arguments from your Command Line Interface.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.cli` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.cli` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
* @module
|
||||
*/
|
||||
|
||||
@ -35,7 +35,7 @@ interface CliMatches {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the arguments provided to the current process and get the matches using the configuration defined `tauri.conf.json > tauri > cli`.
|
||||
* Parse the arguments provided to the current process and get the matches using the configuration defined [`tauri.cli`](https://tauri.app/v1/api/config/#tauriconfig.cli) in `tauri.conf.json`
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { getMatches } from '@tauri-apps/api/cli';
|
||||
|
@ -5,14 +5,14 @@
|
||||
/**
|
||||
* Read and write to the system clipboard.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.clipboard` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.clipboard` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
* @module
|
||||
*/
|
||||
|
||||
import { invokeTauriCommand } from './helpers/tauri'
|
||||
|
||||
/**
|
||||
* Writes a plain text to the clipboard.
|
||||
* Writes plain text to the clipboard.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { writeText, readText } from '@tauri-apps/api/clipboard';
|
||||
|
@ -5,9 +5,9 @@
|
||||
/**
|
||||
* Native system dialogs for opening and saving files.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.dialog` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.dialog` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.dialog`](https://tauri.app/v1/api/config/#allowlistconfig.dialog) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
|
@ -5,7 +5,7 @@
|
||||
/**
|
||||
* The event system allows you to emit events to the backend and listen to events from it.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.event` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.event` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
* @module
|
||||
*/
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
/**
|
||||
* Access the file system.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.fs` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.fs` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.fs`](https://tauri.app/v1/api/config/#allowlistconfig.fs) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
|
@ -5,9 +5,9 @@
|
||||
/**
|
||||
* Register global shortcuts.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.globalShortcut` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.globalShortcut` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.globalShortcut`](https://tauri.app/v1/api/config/#allowlistconfig.globalshortcut) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
|
@ -5,7 +5,7 @@
|
||||
/**
|
||||
* Access the HTTP client written in Rust.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.http` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.http` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* ```json
|
||||
|
@ -6,9 +6,9 @@
|
||||
* Send toast notifications (brief auto-expiring OS window element) to your user.
|
||||
* Can also be used with the Notification Web API.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.notification` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.notification` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.notification`](https://tauri.app/v1/api/config/#allowlistconfig.notification) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
|
@ -5,9 +5,9 @@
|
||||
/**
|
||||
* Provides operating system-related utility methods and properties.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.os` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.os` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.os`](https://tauri.app/v1/api/config/#allowlistconfig.os) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
|
@ -5,9 +5,9 @@
|
||||
/**
|
||||
* The path module provides utilities for working with file and directory paths.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.path` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.path` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.path`](https://tauri.app/v1/api/config/#allowlistconfig.path) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
@ -29,7 +29,7 @@ import { isWindows } from './helpers/os-check'
|
||||
|
||||
/**
|
||||
* Returns the path to the suggested directory for your app config files.
|
||||
* Resolves to `${configDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value configured on `tauri.conf.json > tauri > bundle > identifier`.
|
||||
* Resolves to `${configDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appDir } from '@tauri-apps/api/path';
|
||||
|
@ -5,7 +5,7 @@
|
||||
/**
|
||||
* Perform operations on the current process.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.process` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.process` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
* @module
|
||||
*/
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
* Access the system shell.
|
||||
* Allows you to spawn child processes and manage files and URLs using their default application.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.shell` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.shell` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.shell`](https://tauri.app/v1/api/config/#allowlistconfig.shell) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
|
@ -5,7 +5,7 @@
|
||||
/**
|
||||
* Invoke your custom commands.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.tauri` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.tauri` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
* @module
|
||||
*/
|
||||
|
||||
@ -92,11 +92,11 @@ async function invoke<T>(cmd: string, args: InvokeArgs = {}): Promise<T> {
|
||||
|
||||
/**
|
||||
* Convert a device file path to an URL that can be loaded by the webview.
|
||||
* Note that `asset:` and `https://asset.localhost` must be allowed on the `csp` value configured on `tauri.conf.json > tauri > security`.
|
||||
* Note that `asset:` and `https://asset.localhost` must be added to [`tauri.security.csp`](https://tauri.app/v1/api/config/#securityconfig.csp) in `tauri.conf.json`.
|
||||
* Example CSP value: `"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost"` to use the asset protocol on image sources.
|
||||
*
|
||||
* Additionally, the `asset` must be allowlisted under `tauri.conf.json > tauri > allowlist > protocol`,
|
||||
* and its access scope must be defined on the `assetScope` array on the same `protocol` object.
|
||||
* Additionally, `asset` must be added to [`tauri.allowlist.protocol`](https://tauri.app/v1/api/config/#allowlistconfig.protocol)
|
||||
* in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object.
|
||||
*
|
||||
* @param filePath The file path.
|
||||
* @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.
|
||||
|
@ -5,7 +5,7 @@
|
||||
/**
|
||||
* Customize the auto updater flow.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.updater` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.updater` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
* @module
|
||||
*/
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
/**
|
||||
* Provides APIs to create windows, communicate with other windows and manipulate the current window.
|
||||
*
|
||||
* This package is also accessible with `window.__TAURI__.window` when `tauri.conf.json > build > withGlobalTauri` is set to true.
|
||||
* This package is also accessible with `window.__TAURI__.window` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
|
||||
*
|
||||
* The APIs must be allowlisted on `tauri.conf.json`:
|
||||
* The APIs must be added to [`tauri.allowlist.window`](https://tauri.app/v1/api/config/#allowlistconfig.window) in `tauri.conf.json`:
|
||||
* ```json
|
||||
* {
|
||||
* "tauri": {
|
||||
|
@ -21,6 +21,7 @@
|
||||
"githubPages": false,
|
||||
"readme": "none",
|
||||
"hideInPageTOC": true,
|
||||
"hideMembersSymbol": true,
|
||||
"out": "docs",
|
||||
"json": "docs/js-api.json",
|
||||
"pretty": false
|
||||
|
Loading…
Reference in New Issue
Block a user