Key changes: - Added Web Worker for background image thumbnailing with a 1MiB threshold to optimize CPU/memory usage. - Implemented a serial task queue for memory-safe high-res image processing, preventing OOM crashes. - Added inter-post preloading in the modal for seamless 'Previous/Next' navigation. - Refined scanning UI with double-buffering and a dark background to completely eliminate white flashes. - Renamed project to 'instaarchive-viewer' in package.json. - Fixed 'Open image in new tab' by denylisting /archives and /api in PWA config.
38 lines
697 B
TypeScript
38 lines
697 B
TypeScript
export interface MediaFile {
|
|
name: string;
|
|
url: string;
|
|
type: 'image' | 'video';
|
|
index: number;
|
|
size?: number;
|
|
}
|
|
|
|
export interface Post {
|
|
id: string;
|
|
date: string;
|
|
username: string;
|
|
caption: string;
|
|
media: MediaFile[];
|
|
thumbnail: string;
|
|
isStory?: boolean;
|
|
}
|
|
|
|
/**
|
|
* Common interface for both local File objects and remote server-side files.
|
|
*/
|
|
export interface ArchiveFile {
|
|
name: string;
|
|
webkitRelativePath: string;
|
|
size: number;
|
|
text(): Promise<string>;
|
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
stream(): ReadableStream<Uint8Array>;
|
|
url?: string;
|
|
}
|
|
|
|
export interface ServerArchive {
|
|
name: string;
|
|
thumbnail: string;
|
|
path: string;
|
|
fileCount: number;
|
|
}
|