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'