You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tauri-plugins-workspace/plugins/dialog/guest-js/init.ts

19 lines
506 B

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { invoke } from '@tauri-apps/api/core'
window.alert = function (message: string) {
void invoke('plugin:dialog|message', {
message: message.toString()
})
}
// @ts-expect-error tauri does not have sync IPC :(
window.confirm = async function (message: string) {
return await invoke('plugin:dialog|confirm', {
message: message.toString()
})
}