파일/디렉터리 목록 캐싱 추가

This commit is contained in:
static
2025-01-06 19:19:43 +09:00
parent 47850e1421
commit 10b7472ee9
13 changed files with 293 additions and 241 deletions

30
src/lib/stores/file.ts Normal file
View File

@@ -0,0 +1,30 @@
import type { Writable } from "svelte/store";
export type DirectoryInfo =
| {
id: "root";
dataKey?: undefined;
dataKeyVersion?: undefined;
name?: undefined;
subDirectoryIds: number[];
fileIds: number[];
}
| {
id: number;
dataKey: CryptoKey;
dataKeyVersion: Date;
name: string;
subDirectoryIds: number[];
fileIds: number[];
};
export interface FileInfo {
id: number;
dataKey: CryptoKey;
dataKeyVersion: Date;
contentIv: string;
name: string;
}
export const directoryInfoStore = new Map<"root" | number, Writable<DirectoryInfo | null>>();
export const fileInfoStore = new Map<number, Writable<FileInfo | null>>();