Skip to content

Commit 44fc65c

Browse files
Laegelamrbashir
Laegel
andauthored
Fixing TS API typings (#1451)
Co-authored-by: Amr Bashir <48618675+amrbashir@users.noreply.github.com>
1 parent bf82136 commit 44fc65c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.changes/fix-ts-api-typings.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri.js": patch
3+
"tauri": minor
4+
---
5+
6+
Fixed missing 'App' variant & string promise instead of void promise.

api/src/app.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ async function getTauriVersion(): Promise<string> {
5555
* @param [exitCode] defaults to 0.
5656
* @returns {Promise<void>} Application is closing, nothing is returned
5757
*/
58-
async function exit(exitCode: Number = 0): Promise<void> {
59-
return invokeTauriCommand<string>({
58+
async function exit(exitCode: number = 0): Promise<void> {
59+
return invokeTauriCommand({
6060
__tauriModule: 'App',
6161
mainThread: true,
6262
message: {
@@ -72,7 +72,7 @@ async function exit(exitCode: Number = 0): Promise<void> {
7272
* @returns {Promise<void>} Application is restarting, nothing is returned
7373
*/
7474
async function relaunch(): Promise<void> {
75-
return invokeTauriCommand<string>({
75+
return invokeTauriCommand({
7676
__tauriModule: 'App',
7777
mainThread: true,
7878
message: {

api/src/helpers/tauri.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { invoke } from '../tauri'
66

77
export type TauriModule =
8+
| 'App'
89
| 'Fs'
910
| 'Window'
1011
| 'Shell'

0 commit comments

Comments
 (0)