From 0fcef3f94142cd56509c91371d6eb81c095bc6a4 Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 11 Nov 2024 12:21:08 +0000 Subject: [PATCH] docs: document vanilla JS import alternative (#11632) --- packages/api/src/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 11ddc5e4670f..03639e81c688 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -10,6 +10,16 @@ * ```typescript * import { event, window, path } from '@tauri-apps/api' * ``` + * + * ### Vanilla JS API + * + * The above import syntax is for JavaScript/TypeScript with a bundler. If you're using vanilla JavaScript, you can use the global `window.__TAURI__` object instead. It requires `app.withGlobalTauri` configuration option enabled. + * + * @example + * ```js + * const { event, window: tauriWindow, path } = window.__TAURI__; + * ``` + * * @module */