Skip to content

Commit

Permalink
Fixing TS API typings (#1451)
Browse files Browse the repository at this point in the history
Co-authored-by: Amr Bashir <48618675+amrbashir@users.noreply.github.com>
  • Loading branch information
Laegel and amrbashir committed Apr 11, 2021
1 parent bf82136 commit 44fc65c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .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.
6 changes: 3 additions & 3 deletions api/src/app.ts
Expand Up @@ -55,8 +55,8 @@ async function getTauriVersion(): Promise<string> {
* @param [exitCode] defaults to 0.
* @returns {Promise<void>} Application is closing, nothing is returned
*/
async function exit(exitCode: Number = 0): Promise<void> {
return invokeTauriCommand<string>({
async function exit(exitCode: number = 0): Promise<void> {
return invokeTauriCommand({
__tauriModule: 'App',
mainThread: true,
message: {
Expand All @@ -72,7 +72,7 @@ async function exit(exitCode: Number = 0): Promise<void> {
* @returns {Promise<void>} Application is restarting, nothing is returned
*/
async function relaunch(): Promise<void> {
return invokeTauriCommand<string>({
return invokeTauriCommand({
__tauriModule: 'App',
mainThread: true,
message: {
Expand Down
1 change: 1 addition & 0 deletions api/src/helpers/tauri.ts
Expand Up @@ -5,6 +5,7 @@
import { invoke } from '../tauri'

export type TauriModule =
| 'App'
| 'Fs'
| 'Window'
| 'Shell'
Expand Down

0 comments on commit 44fc65c

Please sign in to comment.