|
@@ -8,16 +8,123 @@
|
|
|
//!
|
|
|
//! # Cargo features
|
|
|
//!
|
|
|
-//! The following are a list of Cargo features that can be enabled or disabled:
|
|
|
+//! The following are a list of [Cargo features](https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section) that can be enabled or disabled:
|
|
|
//!
|
|
|
//! - **wry** *(enabled by default)*: Enables the [wry](https://github.com/tauri-apps/wry) runtime. Only disable it if you want a custom runtime.
|
|
|
+//! - **custom-protocol**: Feature managed by the Tauri CLI. When enabled, Tauri assumes a production environment instead of a development one.
|
|
|
+//! - **updater**: Enables the application auto updater. Enabled by default if the `updater` config is defined on the `tauri.conf.json` file.
|
|
|
+//! - **http-api**: Enables the [`api::http`] module.
|
|
|
//! - **reqwest-client**: Uses `reqwest` as HTTP client on the `http` APIs. Improves performance, but increases the bundle size.
|
|
|
+//! - **command**: Enables the [`api::process::Command`] APIs.
|
|
|
+//! - **dialog**: Enables the [`api::dialog`] module.
|
|
|
+//! - **notification**: Enables the [`api::notification`] module.
|
|
|
//! - **cli**: Enables usage of `clap` for CLI argument parsing. Enabled by default if the `cli` config is defined on the `tauri.conf.json` file.
|
|
|
//! - **system-tray**: Enables application system tray API. Enabled by default if the `systemTray` config is defined on the `tauri.conf.json` file.
|
|
|
//! - **macos-private-api**: Enables features only available in **macOS**'s private APIs, currently the `transparent` window functionality and the `fullScreenEnabled` preference setting to `true`. Enabled by default if the `tauri > macosPrivateApi` config flag is set to `true` on the `tauri.conf.json` file.
|
|
|
-//! - **updater**: Enables the application auto updater. Enabled by default if the `updater` config is defined on the `tauri.conf.json` file.
|
|
|
-//! - **egui**: Enables method to create a native egui window. This can be used for creating native
|
|
|
-//! OpenGL contexts or [egui](https://github.com/emilk/egui) widgets.
|
|
|
+//! - **egui**: Enables method to create a native egui window. This can be used for creating native OpenGL contexts or [egui](https://github.com/emilk/egui) widgets.
|
|
|
+//!
|
|
|
+//! ## Cargo allowlist features
|
|
|
+//!
|
|
|
+//! The following are a list of [Cargo features](https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section) that enables commands for Tauri's API package.
|
|
|
+//! These features are automatically enabled by the Tauri CLI based on the `allowlist` configuration under `tauri.conf.json`.
|
|
|
+//!
|
|
|
+//! - **api-all**: Enables all API endpoints.
|
|
|
+//!
|
|
|
+//! ### Clipboard allowlist
|
|
|
+//!
|
|
|
+//! - **clipboard-all**: Enables all [Clipboard APIs](https://tauri.studio/en/docs/api/js/modules/clipboard/).
|
|
|
+//! - **clipboard-read-text**: Enables the [`readText` API](https://tauri.studio/en/docs/api/js/modules/clipboard/#readtext).
|
|
|
+//! - **clipboard-write-text**: Enables the [`writeText` API](https://tauri.studio/en/docs/api/js/modules/clipboard/#writetext).
|
|
|
+//!
|
|
|
+//! ### Dialog allowlist
|
|
|
+//!
|
|
|
+//! - **dialog-all**: Enables all [Dialog APIs](https://tauri.studio/en/docs/api/js/modules/dialog).
|
|
|
+//! - **dialog-ask**: Enables the [`ask` API](https://tauri.studio/en/docs/api/js/modules/dialog#ask).
|
|
|
+//! - **dialog-confirm**: Enables the [`confirm` API](https://tauri.studio/en/docs/api/js/modules/dialog#confirm).
|
|
|
+//! - **dialog-message**: Enables the [`message` API](https://tauri.studio/en/docs/api/js/modules/dialog#message).
|
|
|
+//! - **dialog-open**: Enables the [`open` API](https://tauri.studio/en/docs/api/js/modules/dialog#open).
|
|
|
+//! - **dialog-save**: Enables the [`save` API](https://tauri.studio/en/docs/api/js/modules/dialog#save).
|
|
|
+//!
|
|
|
+//! ### Filesystem allowlist
|
|
|
+//!
|
|
|
+//! - **fs-all**: Enables all [Filesystem APIs](https://tauri.studio/en/docs/api/js/modules/fs).
|
|
|
+//! - **fs-copy-file**: Enables the [`copyFile` API](https://tauri.studio/en/docs/api/js/modules/fs#copyfile).
|
|
|
+//! - **fs-create-dir**: Enables the [`createDir` API](https://tauri.studio/en/docs/api/js/modules/fs#createdir).
|
|
|
+//! - **fs-read-binary-file**: Enables the [`readBinaryFile` API](https://tauri.studio/en/docs/api/js/modules/fs#readbinaryfile).
|
|
|
+//! - **fs-read-dir**: Enables the [`readDir` API](https://tauri.studio/en/docs/api/js/modules/fs#readdir).
|
|
|
+//! - **fs-read-text-file**: Enables the [`readTextFile` API](https://tauri.studio/en/docs/api/js/modules/fs#readtextfile).
|
|
|
+//! - **fs-remove-dir**: Enables the [`removeDir` API](https://tauri.studio/en/docs/api/js/modules/fs#removedir).
|
|
|
+//! - **fs-remove-file**: Enables the [`removeFile` API](https://tauri.studio/en/docs/api/js/modules/fs#removefile).
|
|
|
+//! - **fs-rename-file**: Enables the [`renameFile` API](https://tauri.studio/en/docs/api/js/modules/fs#renamefile).
|
|
|
+//! - **fs-write-binary-file**: Enables the [`writeBinaryFile` API](https://tauri.studio/en/docs/api/js/modules/fs#writebinaryfile).
|
|
|
+//! - **fs-write-file**: Enables the [`writeFile` API](https://tauri.studio/en/docs/api/js/modules/fs#writefile).
|
|
|
+//!
|
|
|
+//! ### Global shortcut allowlist
|
|
|
+//!
|
|
|
+//! - **global-shortcut-all**: Enables all [GlobalShortcut APIs](https://tauri.studio/en/docs/api/js/modules/globalShortcut).
|
|
|
+//!
|
|
|
+//! ### HTTP allowlist
|
|
|
+//!
|
|
|
+//! - **http-all**: Enables all [HTTP APIs](https://tauri.studio/en/docs/api/js/modules/http).
|
|
|
+//! - **http-request**: Enables the [`request` APIs](https://tauri.studio/en/docs/api/js/classes/http.client/).
|
|
|
+//!
|
|
|
+//! ### Notification allowlist
|
|
|
+//!
|
|
|
+//! - **notification-all**: Enables all [Notification APIs](https://tauri.studio/en/docs/api/js/modules/notification).
|
|
|
+//!
|
|
|
+//! ### OS allowlist
|
|
|
+//!
|
|
|
+//! - **os-all**: Enables all [OS APIs](https://tauri.studio/en/docs/api/js/modules/os).
|
|
|
+//!
|
|
|
+//! ### Path allowlist
|
|
|
+//!
|
|
|
+//! - **path-all**: Enables all [Path APIs](https://tauri.studio/en/docs/api/js/modules/path).
|
|
|
+//!
|
|
|
+//! ### Process allowlist
|
|
|
+//!
|
|
|
+//! - **process-all**: Enables all [Process APIs](https://tauri.studio/en/docs/api/js/modules/process).
|
|
|
+//! - **process-exit**: Enables the [`exit` API](https://tauri.studio/en/docs/api/js/modules/process#exit).
|
|
|
+//! - **process-relaunch**: Enables the [`relaunch` API](https://tauri.studio/en/docs/api/js/modules/process#relaunch).
|
|
|
+//!
|
|
|
+//! ### Protocol allowlist
|
|
|
+//!
|
|
|
+//! - **protocol-all**: Enables all Protocol APIs.
|
|
|
+//! - **protocol-asset**: Enables the `asset` custom protocol.
|
|
|
+//!
|
|
|
+//! ### Shell allowlist
|
|
|
+//!
|
|
|
+//! - **shell-all**: Enables all [Clipboard APIs](https://tauri.studio/en/docs/api/js/modules/shell).
|
|
|
+//! - **shell-execute**: Enables [executing arbitrary programs](https://tauri.studio/en/docs/api/js/classes/shell.Command#constructor).
|
|
|
+//! - **shell-sidecar**: Enables [executing a `sidecar` program](https://tauri.studio/en/docs/api/js/classes/shell.Command#sidecar).
|
|
|
+//! - **shell-open**: Enables the [`open` API](https://tauri.studio/en/docs/api/js/modules/shell#open).
|
|
|
+//!
|
|
|
+//! ### Window allowlist
|
|
|
+//!
|
|
|
+//! - **window-all**: Enables all [Window APIs](https://tauri.studio/en/docs/api/js/modules/window).
|
|
|
+//! - **window-create**: Enables the API used to [create new windows](https://tauri.studio/en/docs/api/js/classes/window.webviewwindow/).
|
|
|
+//! - **window-center**: Enables the [`center` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#center).
|
|
|
+//! - **window-request-user-attention**: Enables the [`requestUserAttention` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#requestuserattention).
|
|
|
+//! - **window-set-resizable**: Enables the [`setResizable` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setresizable).
|
|
|
+//! - **window-set-title**: Enables the [`setTitle` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#settitle).
|
|
|
+//! - **window-maximize**: Enables the [`maximize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#maximize).
|
|
|
+//! - **window-unmaximize**: Enables the [`unmaximize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#unmaximize).
|
|
|
+//! - **window-minimize**: Enables the [`minimize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#minimize).
|
|
|
+//! - **window-unminimize**: Enables the [`unminimize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#unminimize).
|
|
|
+//! - **window-show**: Enables the [`show` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#show).
|
|
|
+//! - **window-hide**: Enables the [`hide` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#hide).
|
|
|
+//! - **window-close**: Enables the [`close` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#close).
|
|
|
+//! - **window-set-decorations**: Enables the [`setDecorations` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setdecorations).
|
|
|
+//! - **window-set-always-on-top**: Enables the [`setAlwaysOnTop` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setalwaysontop).
|
|
|
+//! - **window-set-size**: Enables the [`setSize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setsize).
|
|
|
+//! - **window-set-min-size**: Enables the [`setMinSize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setminsize).
|
|
|
+//! - **window-set-max-size**: Enables the [`setMaxSize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setmaxsize).
|
|
|
+//! - **window-set-position**: Enables the [`setPosition` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setposition).
|
|
|
+//! - **window-set-fullscreen**: Enables the [`setFullscreen` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setfullscreen).
|
|
|
+//! - **window-set-focus**: Enables the [`setFocus` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setfocus).
|
|
|
+//! - **window-set-icon**: Enables the [`setIcon` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#seticon).
|
|
|
+//! - **window-set-skip-taskbar**: Enables the [`setSkipTaskbar` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setskiptaskbar).
|
|
|
+//! - **window-start-dragging**: Enables the [`startDragging` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#startdragging).
|
|
|
+//! - **window-print**: Enables the [`print` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#print).
|
|
|
|
|
|
#![warn(missing_docs, rust_2018_idioms)]
|
|
|
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
|
@@ -153,7 +260,7 @@ macro_rules! tauri_build_context {
|
|
|
/// User supplied data required inside of a Tauri application.
|
|
|
///
|
|
|
/// # Stability
|
|
|
-/// This is the output of the `tauri::generate_context!` macro, and is not considered part of the stable API.
|
|
|
+/// This is the output of the [`generate_context`] macro, and is not considered part of the stable API.
|
|
|
/// Unless you know what you are doing and are prepared for this type to have breaking changes, do not create it yourself.
|
|
|
pub struct Context<A: Assets> {
|
|
|
pub(crate) config: Config,
|