Skip to content

Commit

Permalink
fix(api.js): appWindow shown as type any, fixes #3747 (#3772)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
  • Loading branch information
FabianLars and lucasfernog authored Mar 24, 2022
1 parent 266156a commit 1deeb03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/appwindow-type-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"api": patch
---

Properly define the `appWindow` type.
3 changes: 2 additions & 1 deletion tooling/api/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export default [
}),
babel({
configFile: false,
presets: [['@babel/preset-env'], ['@babel/preset-typescript']]
presets: [['@babel/preset-env'], ['@babel/preset-typescript']],
babelHelpers: 'bundled'
}),
terser()
],
Expand Down
2 changes: 1 addition & 1 deletion tooling/api/src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ class WebviewWindow extends WindowManager {
}

/** The WebviewWindow for the current window. */
let appWindow
let appWindow: WebviewWindow
if ('__TAURI_METADATA__' in window) {
appWindow = new WebviewWindow(
window.__TAURI_METADATA__.__currentWindow.label,
Expand Down

0 comments on commit 1deeb03

Please sign in to comment.