From 44fc65c723f638f2a1b2ecafb79b32d509ed2f35 Mon Sep 17 00:00:00 2001 From: Laegel Date: Sun, 11 Apr 2021 14:51:21 +0200 Subject: [PATCH] Fixing TS API typings (#1451) Co-authored-by: Amr Bashir <48618675+amrbashir@users.noreply.github.com> --- .changes/fix-ts-api-typings.md | 6 ++++++ api/src/app.ts | 6 +++--- api/src/helpers/tauri.ts | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changes/fix-ts-api-typings.md diff --git a/.changes/fix-ts-api-typings.md b/.changes/fix-ts-api-typings.md new file mode 100644 index 000000000..f3ed4603b --- /dev/null +++ b/.changes/fix-ts-api-typings.md @@ -0,0 +1,6 @@ +--- +"tauri.js": patch +"tauri": minor +--- + +Fixed missing 'App' variant & string promise instead of void promise. diff --git a/api/src/app.ts b/api/src/app.ts index d7a2ee955..eb17cd75d 100644 --- a/api/src/app.ts +++ b/api/src/app.ts @@ -55,8 +55,8 @@ async function getTauriVersion(): Promise { * @param [exitCode] defaults to 0. * @returns {Promise} Application is closing, nothing is returned */ -async function exit(exitCode: Number = 0): Promise { - return invokeTauriCommand({ +async function exit(exitCode: number = 0): Promise { + return invokeTauriCommand({ __tauriModule: 'App', mainThread: true, message: { @@ -72,7 +72,7 @@ async function exit(exitCode: Number = 0): Promise { * @returns {Promise} Application is restarting, nothing is returned */ async function relaunch(): Promise { - return invokeTauriCommand({ + return invokeTauriCommand({ __tauriModule: 'App', mainThread: true, message: { diff --git a/api/src/helpers/tauri.ts b/api/src/helpers/tauri.ts index fd82fdcef..1b7e6f9db 100644 --- a/api/src/helpers/tauri.ts +++ b/api/src/helpers/tauri.ts @@ -5,6 +5,7 @@ import { invoke } from '../tauri' export type TauriModule = + | 'App' | 'Fs' | 'Window' | 'Shell'