@@ -23,6 +23,7 @@ import type { EventCallback, EventName } from '@tauri-apps/api/event';
23
23
export default class Tauri implements IBackend {
24
24
platformName = platform ( ) ;
25
25
private appWindow : Window | undefined ;
26
+
26
27
systemTheme = readable < string | null > ( null , ( set ) => {
27
28
if ( ! this . appWindow ) {
28
29
this . appWindow = getCurrentWindow ( ) ;
@@ -35,6 +36,7 @@ export default class Tauri implements IBackend {
35
36
set ( e . payload ) ;
36
37
} ) ;
37
38
} ) ;
39
+
38
40
invoke = tauriInvoke ;
39
41
listen = tauriListen ;
40
42
checkUpdate = tauriCheck ;
@@ -47,18 +49,29 @@ export default class Tauri implements IBackend {
47
49
getAppInfo = tauriGetAppInfo ;
48
50
readTextFromClipboard = tauriReadText ;
49
51
writeTextToClipboard = tauriWriteText ;
52
+
50
53
async filePicker < T extends OpenDialogOptions > ( options ?: T ) {
51
54
return await filePickerTauri < T > ( options ) ;
52
55
}
56
+
53
57
async homeDirectory ( ) : Promise < string > {
54
58
// TODO: Find a workaround to avoid this dynamic import
55
59
// https://github.com/sveltejs/kit/issues/905
56
60
return await ( await import ( '@tauri-apps/api/path' ) ) . homeDir ( ) ;
57
61
}
62
+
58
63
async loadDiskStore ( fileName : string ) : Promise < DiskStore > {
59
64
const store = await Store . load ( fileName , { autoSave : true } ) ;
60
65
return new TauriDiskStore ( store ) ;
61
66
}
67
+
68
+ async getWindowTitle ( ) : Promise < string > {
69
+ if ( ! this . appWindow ) {
70
+ this . appWindow = getCurrentWindow ( ) ;
71
+ }
72
+ return await this . appWindow . title ( ) ;
73
+ }
74
+
62
75
setWindowTitle ( title : string ) : void {
63
76
if ( ! this . appWindow ) {
64
77
this . appWindow = getCurrentWindow ( ) ;
0 commit comments