Skip to content

Commit

Permalink
docs: document vanilla JS import alternative (#11632)
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski authored Nov 11, 2024
1 parent 86f22f0 commit 0fcef3f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down

0 comments on commit 0fcef3f

Please sign in to comment.