fix(api.js): fix @ts-expect-error usage, closes #2249 (#2250)

This commit is contained in:
Amr Bashir 2021-07-20 00:19:58 +02:00 committed by GitHub
parent e3f9916526
commit dd52e738f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -0,0 +1,4 @@
---
"api": patch
---
Fix `@ts-expect` error usage

File diff suppressed because one or more lines are too long

View File

@ -195,8 +195,8 @@ enum UserAttentionType {
* @return The current WebviewWindow.
*/
function getCurrent(): WebviewWindow {
// @ts-expect-error
return new WebviewWindow(window.__TAURI__.__currentWindow.label, {
// @ts-expect-error
skip: true
})
}
@ -207,9 +207,12 @@ function getCurrent(): WebviewWindow {
* @return The list of WebviewWindow.
*/
function getAll(): WebviewWindow[] {
// @ts-expect-error
return window.__TAURI__.__windows.map(
(w) => new WebviewWindow(w, { skip: true })
(w) =>
new WebviewWindow(w.label, {
// @ts-expect-error
skip: true
})
)
}