/* _ __ _ __ | | / /___ _(_) /____ | | /| / / __ `/ / / ___/ | |/ |/ / /_/ / / (__ ) |__/|__/\__,_/_/_/____/ The electron alternative for Go (c) Lea Anthony 2019-present */ /* jshint esversion: 9 */ /** * @typedef {import("./types").MessageDialogOptions} MessageDialogOptions * @typedef {import("./types").OpenDialogOptions} OpenDialogOptions * @typedef {import("./types").SaveDialogOptions} SaveDialogOptions */ /** * The Dialog API provides methods to interact with system dialogs. */ export const Dialog = { /** * Shows an info dialog * @param {MessageDialogOptions} options - options for the dialog * @returns {Promise} */ Info: (options) => { return wails.Dialog.Info(options); }, /** * Shows a warning dialog * @param {MessageDialogOptions} options - options for the dialog * @returns {Promise} */ Warning: (options) => { return wails.Dialog.Warning(options); }, /** * Shows an error dialog * @param {MessageDialogOptions} options - options for the dialog * @returns {Promise} */ Error: (options) => { return wails.Dialog.Error(options); }, /** * Shows a question dialog * @param {MessageDialogOptions} options - options for the dialog * @returns {Promise} */ Question: (options) => { return wails.Dialog.Question(options); }, /** * Shows a file open dialog and returns the files selected by the user. * A blank string indicates that the dialog was cancelled. * @param {OpenDialogOptions} options - options for the dialog * @returns {Promise|Promise} */ OpenFile: (options) => { return wails.Dialog.OpenFile(options); }, /** * Shows a file save dialog and returns the filename given by the user. * A blank string indicates that the dialog was cancelled. * @param {SaveDialogOptions} options - options for the dialog * @returns {Promise} */ SaveFile: (options) => { return wails.Dialog.SaveFile(options); }, };