-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.ts
More file actions
42 lines (39 loc) · 1.3 KB
/
api.ts
File metadata and controls
42 lines (39 loc) · 1.3 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
// Types shared between both back and front end
import type { Snapshot, BackupEvent } from "./types";
type Promisable<T> = T | PromiseLike<T>;
export type LoginResponse =
| {
success: true;
}
| {
success: false;
error: string;
};
// This type is transformed into backend.invoke() form in src/lib/backend
export type Api = {
setup: (arg0: {
endpoint: string;
bucket: string;
accessKey: string;
secretKey: string;
resticPassphrase: string;
}) => Promisable<LoginResponse>;
// setSnapshots: (arg0: any[]) => Promisable<void>;
snapshots: () => Promisable<Snapshot[]>;
logout: () => Promisable<void>;
backup: (arg0: { directories: string[] }) => Promisable<void>;
"get-backup-events": () => Promisable<BackupEvent[]>;
restore: (arg0: { snapshot: Snapshot; target: string }) => Promisable<void>;
"get-directory": () => Promisable<
{ canceled: boolean; filePaths: string[] } | undefined
>;
openSignup: () => Promisable<void>;
openUpgradePlan: () => Promisable<void>;
openGetStarted: () => Promisable<void>;
getEndpoint: () => Promisable<string>;
getBucketName: () => Promisable<string>;
getTotalUsage: () => Promisable<void>;
// setBucketName: (arg0: string) => Promisable<void>;
loginStatus: () => Promisable<boolean>;
"get-file-count": (arg0: { path: string }) => Promisable<number>;
};