|
@@ -3,7 +3,7 @@
|
|
|
//
|
|
|
// See [Note: types.ts <-> preload.ts <-> ipc.ts]
|
|
|
|
|
|
-import type { ElectronFile, WatchMapping } from "./file";
|
|
|
+import type { ElectronFile } from "./file";
|
|
|
|
|
|
export interface AppUpdateInfo {
|
|
|
autoUpdatable: boolean;
|
|
@@ -298,16 +298,16 @@ export interface Electron {
|
|
|
|
|
|
removeWatchMapping: (folderPath: string) => Promise<void>;
|
|
|
|
|
|
- getWatchMappings: () => Promise<WatchMapping[]>;
|
|
|
+ getWatchMappings: () => Promise<FolderWatch[]>;
|
|
|
|
|
|
updateWatchMappingSyncedFiles: (
|
|
|
folderPath: string,
|
|
|
- files: WatchMapping["syncedFiles"],
|
|
|
+ files: FolderWatch["syncedFiles"],
|
|
|
) => Promise<void>;
|
|
|
|
|
|
updateWatchMappingIgnoredFiles: (
|
|
|
folderPath: string,
|
|
|
- files: WatchMapping["ignoredFiles"],
|
|
|
+ files: FolderWatch["ignoredFiles"],
|
|
|
) => Promise<void>;
|
|
|
|
|
|
// - FS legacy
|
|
@@ -332,3 +332,30 @@ export interface Electron {
|
|
|
setToUploadCollection: (collectionName: string) => Promise<void>;
|
|
|
getDirFiles: (dirPath: string) => Promise<ElectronFile[]>;
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * A top level folder that was selected by the user for watching.
|
|
|
+ *
|
|
|
+ * The user can set up multiple such watches. Each of these can in turn be
|
|
|
+ * syncing multiple on disk folders to one or more (dependening on the
|
|
|
+ * {@link uploadStrategy}) Ente albums.
|
|
|
+ *
|
|
|
+ * This type is passed across the IPC boundary. It is persisted on the Node.js
|
|
|
+ * side.
|
|
|
+ */
|
|
|
+export interface FolderWatch {
|
|
|
+ rootFolderName: string;
|
|
|
+ uploadStrategy: number;
|
|
|
+ folderPath: string;
|
|
|
+ syncedFiles: FolderWatchSyncedFile[];
|
|
|
+ ignoredFiles: string[];
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * An on-disk file that was synced as part of a folder watch.
|
|
|
+ */
|
|
|
+export interface FolderWatchSyncedFile {
|
|
|
+ path: string;
|
|
|
+ uploadedFileID: number;
|
|
|
+ collectionID: number;
|
|
|
+}
|