π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
import { downloadManager } from "ente-gallery/services/download";
import {
fileViewerDidClose,
fileViewerWillOpen,
forgetExifForItemData,
forgetItemDataForFileID,
forgetItemDataForFileIDIfNeeded,
itemDataForFile,
updateFileInfoExifIfNeeded,
} from "./data-source";
import {
FileViewerPhotoSwipe as FileViewerPhotoSwipeCore,
moreButtonID,
moreMenuID,
resetMoreMenuButtonOnMenuClose,
type FileViewerPhotoSwipeAnnotatedFile,
type FileViewerPhotoSwipeCoreOptions,
type FileViewerPhotoSwipeDataSource,
type FileViewerPhotoSwipeDelegate,
} from "./photoswipe-core";
export type FileViewerPhotoSwipeOptions<
T extends FileViewerPhotoSwipeAnnotatedFile =
FileViewerPhotoSwipeAnnotatedFile,
> = Omit<
FileViewerPhotoSwipeCoreOptions<T>,
"dataSource" | "isPublicAlbum" | "publicAlbumLogoHTML"
>;
const fileViewerPhotoSwipeDataSource = {
fileDownloadProgressSubscribe: (onChange: () => void) =>
downloadManager.fileDownloadProgressSubscribe(onChange),
fileDownloadProgressSnapshot: () =>
downloadManager.fileDownloadProgressSnapshot(),
fileViewerDidClose,
fileViewerWillOpen,
forgetExifForItemData,
forgetItemDataForFileID,
forgetItemDataForFileIDIfNeeded,
itemDataForFile,
updateFileInfoExifIfNeeded,
} satisfies FileViewerPhotoSwipeDataSource;
export class FileViewerPhotoSwipe<
T extends FileViewerPhotoSwipeAnnotatedFile =
FileViewerPhotoSwipeAnnotatedFile,
> extends FileViewerPhotoSwipeCore<T> {
constructor(options: FileViewerPhotoSwipeOptions<T>) {
super({ ...options, dataSource: fileViewerPhotoSwipeDataSource });
}
}
export { moreButtonID, moreMenuID, resetMoreMenuButtonOnMenuClose };
export type { FileViewerPhotoSwipeAnnotatedFile, FileViewerPhotoSwipeDelegate };