mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 (#1228)
* chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 * actually apply the rules lol * rebuild --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars <fabianlars@fabianlars.de>
This commit is contained in:
@@ -163,13 +163,14 @@ type OpenDialogReturn<T extends OpenDialogOptions> = T["directory"] extends true
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function open<T extends OpenDialogOptions>(
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
options: T = {} as T,
|
||||
): Promise<OpenDialogReturn<T>> {
|
||||
if (typeof options === "object") {
|
||||
Object.freeze(options);
|
||||
}
|
||||
|
||||
return invoke("plugin:dialog|open", { options });
|
||||
return await invoke("plugin:dialog|open", { options });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,7 +202,7 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
|
||||
Object.freeze(options);
|
||||
}
|
||||
|
||||
return invoke("plugin:dialog|save", { options });
|
||||
return await invoke("plugin:dialog|save", { options });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,7 +227,7 @@ async function message(
|
||||
options?: string | MessageDialogOptions,
|
||||
): Promise<void> {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return invoke("plugin:dialog|message", {
|
||||
await invoke("plugin:dialog|message", {
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
kind: opts?.kind,
|
||||
@@ -255,7 +256,7 @@ async function ask(
|
||||
options?: string | ConfirmDialogOptions,
|
||||
): Promise<boolean> {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return invoke("plugin:dialog|ask", {
|
||||
return await invoke("plugin:dialog|ask", {
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
kind: opts?.kind,
|
||||
@@ -285,7 +286,7 @@ async function confirm(
|
||||
options?: string | ConfirmDialogOptions,
|
||||
): Promise<boolean> {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return invoke("plugin:dialog|confirm", {
|
||||
return await invoke("plugin:dialog|confirm", {
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
kind: opts?.kind,
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
window.alert = function (message: string) {
|
||||
invoke("plugin:dialog|message", {
|
||||
void invoke("plugin:dialog|message", {
|
||||
message: message.toString(),
|
||||
});
|
||||
};
|
||||
|
||||
// @ts-expect-error tauri does not have sync IPC :(
|
||||
window.confirm = function (message: string) {
|
||||
return invoke("plugin:dialog|confirm", {
|
||||
window.confirm = async function (message: string) {
|
||||
return await invoke("plugin:dialog|confirm", {
|
||||
message: message.toString(),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user