forked from probablykasper/time-machine-inspector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbindings.ts
More file actions
55 lines (43 loc) · 2.13 KB
/
bindings.ts
File metadata and controls
55 lines (43 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* eslint-disable */
// This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually.
declare global {
interface Window {
__TAURI_INVOKE__<T>(cmd: string, args?: Record<string, unknown>): Promise<T>;
}
}
// Function avoids 'window not defined' in SSR
const invoke = () => window.__TAURI_INVOKE__;
export function errorPopup(msg: string) {
return invoke()<null>("error_popup", { msg })
}
export function loadBackupList(destinationId: string, refresh: boolean) {
return invoke()<Backup[]>("load_backup_list", { destinationId,refresh })
}
export function getBackup(destinationId: string, newB: string, refresh: boolean) {
return invoke()<DirMap>("get_backup", { destinationId,newB,refresh })
}
export function backupsInfo() {
return invoke()<BackupInfo[]>("backups_info")
}
export function deleteBackups(paths: string[]) {
return invoke()<null>("delete_backups", { paths })
}
export function revealInFinder(path: string) {
return invoke()<null>("reveal_in_finder", { path })
}
export function destinationinfo() {
return invoke()<DestinationDetail[]>("destinationinfo")
}
export function exploreBackup(backupPath: string) {
return invoke()<DirMap>("explore_backup", { backupPath })
}
export function diagnoseBackups() {
return invoke()<BackupDiagnosis[]>("diagnose_backups")
}
export type Backup = { path: string; name: string }
export type BackupInfo = { old: string; new: string; loading: boolean }
export type BackupDiagnosis = { destination_id: string; destination_mount: string; last_attempt_at: string | null; last_success_at: string | null; status: DiagnosisStatus; failure_code: string | null; failure_summary: string | null; failure_explanation: string | null; log_excerpt: string[]; destination_total_bytes: number; destination_free_bytes: number }
export type DiagnosisStatus = "healthy" | "failed" | "noRecentAttempt"
export type DirMap = { map: { [key: string]: { [key: string]: LoadedBackupItem } } }
export type DestinationDetail = { id: string; mount_point: string; mount_point_name: string }
export type LoadedBackupItem = { size: number }