From 47666c4a0b4ec6f0a79a7fdb4735e3314a0a60fd Mon Sep 17 00:00:00 2001 From: Lorenzo Lewis Date: Mon, 11 Jul 2022 14:14:31 +0100 Subject: [PATCH] Fix/docs qol improvements (#4641) --- tooling/api/src/app.ts | 6 +++--- tooling/api/src/cli.ts | 4 ++-- tooling/api/src/clipboard.ts | 4 ++-- tooling/api/src/dialog.ts | 4 ++-- tooling/api/src/event.ts | 2 +- tooling/api/src/fs.ts | 4 ++-- tooling/api/src/globalShortcut.ts | 4 ++-- tooling/api/src/http.ts | 2 +- tooling/api/src/notification.ts | 4 ++-- tooling/api/src/os.ts | 4 ++-- tooling/api/src/path.ts | 6 +++--- tooling/api/src/process.ts | 2 +- tooling/api/src/shell.ts | 4 ++-- tooling/api/src/tauri.ts | 8 ++++---- tooling/api/src/updater.ts | 2 +- tooling/api/src/window.ts | 4 ++-- tooling/api/typedoc.json | 1 + 17 files changed, 33 insertions(+), 32 deletions(-) diff --git a/tooling/api/src/app.ts b/tooling/api/src/app.ts index 683003264..b4c2a91dc 100644 --- a/tooling/api/src/app.ts +++ b/tooling/api/src/app.ts @@ -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 { } /** - * Gets the tauri version. + * Gets the Tauri version. * * @example * ```typescript @@ -58,7 +58,7 @@ async function getName(): Promise { * const tauriVersion = await getTauriVersion(); * ``` * - * @returns A promise resolving to tauri version. + * @returns A promise resolving to Tauri version. */ async function getTauriVersion(): Promise { return invokeTauriCommand({ diff --git a/tooling/api/src/cli.ts b/tooling/api/src/cli.ts index 0e9bdc095..6a0dd9205 100644 --- a/tooling/api/src/cli.ts +++ b/tooling/api/src/cli.ts @@ -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'; diff --git a/tooling/api/src/clipboard.ts b/tooling/api/src/clipboard.ts index b6eb536bf..5f9a6022d 100644 --- a/tooling/api/src/clipboard.ts +++ b/tooling/api/src/clipboard.ts @@ -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'; diff --git a/tooling/api/src/dialog.ts b/tooling/api/src/dialog.ts index 3e3e0952b..33c14a13f 100644 --- a/tooling/api/src/dialog.ts +++ b/tooling/api/src/dialog.ts @@ -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": { diff --git a/tooling/api/src/event.ts b/tooling/api/src/event.ts index 66edc9eba..adaf907fc 100644 --- a/tooling/api/src/event.ts +++ b/tooling/api/src/event.ts @@ -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 */ diff --git a/tooling/api/src/fs.ts b/tooling/api/src/fs.ts index 76b812b6f..1f441a84e 100644 --- a/tooling/api/src/fs.ts +++ b/tooling/api/src/fs.ts @@ -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": { diff --git a/tooling/api/src/globalShortcut.ts b/tooling/api/src/globalShortcut.ts index e91befe53..b50e0822c 100644 --- a/tooling/api/src/globalShortcut.ts +++ b/tooling/api/src/globalShortcut.ts @@ -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": { diff --git a/tooling/api/src/http.ts b/tooling/api/src/http.ts index 0cea6f5aa..20694fe12 100644 --- a/tooling/api/src/http.ts +++ b/tooling/api/src/http.ts @@ -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 diff --git a/tooling/api/src/notification.ts b/tooling/api/src/notification.ts index 0a1862374..f9a368904 100644 --- a/tooling/api/src/notification.ts +++ b/tooling/api/src/notification.ts @@ -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": { diff --git a/tooling/api/src/os.ts b/tooling/api/src/os.ts index e81ae245d..d751e110c 100644 --- a/tooling/api/src/os.ts +++ b/tooling/api/src/os.ts @@ -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": { diff --git a/tooling/api/src/path.ts b/tooling/api/src/path.ts index 189e648bf..7bebb12ac 100644 --- a/tooling/api/src/path.ts +++ b/tooling/api/src/path.ts @@ -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'; diff --git a/tooling/api/src/process.ts b/tooling/api/src/process.ts index 64632f844..8b4083a97 100644 --- a/tooling/api/src/process.ts +++ b/tooling/api/src/process.ts @@ -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 */ diff --git a/tooling/api/src/shell.ts b/tooling/api/src/shell.ts index 01b1a3cf1..7fe6465f2 100644 --- a/tooling/api/src/shell.ts +++ b/tooling/api/src/shell.ts @@ -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": { diff --git a/tooling/api/src/tauri.ts b/tooling/api/src/tauri.ts index c794b5e1d..f8a9d5858 100644 --- a/tooling/api/src/tauri.ts +++ b/tooling/api/src/tauri.ts @@ -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(cmd: string, args: InvokeArgs = {}): Promise { /** * 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. diff --git a/tooling/api/src/updater.ts b/tooling/api/src/updater.ts index 27d3a56c3..8e7cfef1d 100644 --- a/tooling/api/src/updater.ts +++ b/tooling/api/src/updater.ts @@ -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 */ diff --git a/tooling/api/src/window.ts b/tooling/api/src/window.ts index 20a7c7d5a..12f472e04 100644 --- a/tooling/api/src/window.ts +++ b/tooling/api/src/window.ts @@ -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": { diff --git a/tooling/api/typedoc.json b/tooling/api/typedoc.json index ac782713d..962cf97e9 100644 --- a/tooling/api/typedoc.json +++ b/tooling/api/typedoc.json @@ -21,6 +21,7 @@ "githubPages": false, "readme": "none", "hideInPageTOC": true, + "hideMembersSymbol": true, "out": "docs", "json": "docs/js-api.json", "pretty": false