Skip to content

Commit 0fcef3f

Browse files
authored
docs: document vanilla JS import alternative (#11632)
1 parent 86f22f0 commit 0fcef3f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/api/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
* ```typescript
1111
* import { event, window, path } from '@tauri-apps/api'
1212
* ```
13+
*
14+
* ### Vanilla JS API
15+
*
16+
* 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.
17+
*
18+
* @example
19+
* ```js
20+
* const { event, window: tauriWindow, path } = window.__TAURI__;
21+
* ```
22+
*
1323
* @module
1424
*/
1525

0 commit comments

Comments
 (0)