diff --git a/tooling/api/src/app.ts b/tooling/api/src/app.ts index 3a8cebb83..19551b7ab 100644 --- a/tooling/api/src/app.ts +++ b/tooling/api/src/app.ts @@ -4,6 +4,7 @@ /** * Get application metadata. + * This package is also accessible with `window.__TAURI__.app` when `tauri.conf.json > build > withGlobalTauri` is set to true. * @packageDocumentation */ diff --git a/tooling/api/src/bundle.ts b/tooling/api/src/bundle.ts index b131c0692..d95841dc9 100644 --- a/tooling/api/src/bundle.ts +++ b/tooling/api/src/bundle.ts @@ -9,28 +9,30 @@ import * as app from './app' import * as cli from './cli' import * as dialog from './dialog' import * as event from './event' -import * as updater from './updater' import * as fs from './fs' -import * as path from './path' +import * as globalShortcut from './globalShortcut' import * as http from './http' +import * as notification from './notification' +import * as path from './path' +import * as process from './process' import * as shell from './shell' import * as tauri from './tauri' +import * as updater from './updater' import * as window from './window' -import * as notification from './notification' -import * as globalShortcut from './globalShortcut' export { app, cli, dialog, event, - updater, fs, - path, + globalShortcut, http, + notification, + path, + process, shell, tauri, - window, - notification, - globalShortcut + updater, + window } diff --git a/tooling/api/src/cli.ts b/tooling/api/src/cli.ts index 734090617..ba7450cc3 100644 --- a/tooling/api/src/cli.ts +++ b/tooling/api/src/cli.ts @@ -4,6 +4,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. * @packageDocumentation */ diff --git a/tooling/api/src/dialog.ts b/tooling/api/src/dialog.ts index eb298bbf0..5558b9bcf 100644 --- a/tooling/api/src/dialog.ts +++ b/tooling/api/src/dialog.ts @@ -4,6 +4,7 @@ /** * 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. * @packageDocumentation */ diff --git a/tooling/api/src/event.ts b/tooling/api/src/event.ts index 9e0fc3ae2..593c66f81 100644 --- a/tooling/api/src/event.ts +++ b/tooling/api/src/event.ts @@ -4,6 +4,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. * @packageDocumentation */ diff --git a/tooling/api/src/fs.ts b/tooling/api/src/fs.ts index 8a7ebcab3..6f01e45d5 100644 --- a/tooling/api/src/fs.ts +++ b/tooling/api/src/fs.ts @@ -4,6 +4,7 @@ /** * Access the file system. + * This package is also accessible with `window.__TAURI__.fs` when `tauri.conf.json > build > withGlobalTauri` is set to true. * @packageDocumentation */ diff --git a/tooling/api/src/globalShortcut.ts b/tooling/api/src/globalShortcut.ts index 0fa498fa1..645b927b0 100644 --- a/tooling/api/src/globalShortcut.ts +++ b/tooling/api/src/globalShortcut.ts @@ -4,6 +4,7 @@ /** * Register global shortcuts. + * This package is also accessible with `window.__TAURI__.globalShortcut` when `tauri.conf.json > build > withGlobalTauri` is set to true. * @packageDocumentation */ diff --git a/tooling/api/src/http.ts b/tooling/api/src/http.ts index ff1b353ce..1775a4ce0 100644 --- a/tooling/api/src/http.ts +++ b/tooling/api/src/http.ts @@ -4,6 +4,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. * @packageDocumentation */ diff --git a/tooling/api/src/index.ts b/tooling/api/src/index.ts index 78e3e43c2..fb0c5fca8 100644 --- a/tooling/api/src/index.ts +++ b/tooling/api/src/index.ts @@ -4,6 +4,11 @@ /** * The Tauri API allows you to interface with the backend layer. + * This module exposes all other modules as an object where the key is the module name, and the value is the module exports. + * @example + * ```typescript + * import { app, dialog, event, fs, globalShortcut } from '@tauri-apps/api' + * ``` * @packageDocumentation */ diff --git a/tooling/api/src/notification.ts b/tooling/api/src/notification.ts index 6666d05a6..47b1f9837 100644 --- a/tooling/api/src/notification.ts +++ b/tooling/api/src/notification.ts @@ -4,6 +4,7 @@ /** * Send notifications 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. * @packageDocumentation */ diff --git a/tooling/api/src/path.ts b/tooling/api/src/path.ts index 70643df30..08c33de78 100644 --- a/tooling/api/src/path.ts +++ b/tooling/api/src/path.ts @@ -7,6 +7,7 @@ import { BaseDirectory } from './fs' /** * Read common system paths such as home, config and cache directories. + * This package is also accessible with `window.__TAURI__.path` when `tauri.conf.json > build > withGlobalTauri` is set to true. * @packageDocumentation */ diff --git a/tooling/api/src/process.ts b/tooling/api/src/process.ts index b8d8dfe1a..849cc1aba 100644 --- a/tooling/api/src/process.ts +++ b/tooling/api/src/process.ts @@ -6,6 +6,7 @@ import { invokeTauriCommand } from './helpers/tauri' /** * 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. * @packageDocumentation */ diff --git a/tooling/api/src/shell.ts b/tooling/api/src/shell.ts index b4c5e951d..2cfa5f636 100644 --- a/tooling/api/src/shell.ts +++ b/tooling/api/src/shell.ts @@ -8,6 +8,7 @@ import { transformCallback } from './tauri' /** * 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. * @packageDocumentation */ diff --git a/tooling/api/src/tauri.ts b/tooling/api/src/tauri.ts index 0277613a9..4a1959ee4 100644 --- a/tooling/api/src/tauri.ts +++ b/tooling/api/src/tauri.ts @@ -4,6 +4,7 @@ /** * Invoke your custom commands. + * This package is also accessible with `window.__TAURI__.tauri` when `tauri.conf.json > build > withGlobalTauri` is set to true. * @packageDocumentation */ diff --git a/tooling/api/src/updater.ts b/tooling/api/src/updater.ts index 9665f0783..9b27ef54e 100644 --- a/tooling/api/src/updater.ts +++ b/tooling/api/src/updater.ts @@ -4,6 +4,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. * @packageDocumentation */ diff --git a/tooling/api/src/window.ts b/tooling/api/src/window.ts index dbcfea1af..bda22cb5d 100644 --- a/tooling/api/src/window.ts +++ b/tooling/api/src/window.ts @@ -4,6 +4,7 @@ /** * 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. * @packageDocumentation */