refactor: update type definitions for file handling in FileStorage and FilesPage components

- Changed return type from FileType to FileMetadata in saveBase64Image method of FileStorage class for consistency.
- Updated import in FilesPage component to reflect the new FileMetadata type, enhancing clarity in file handling.
This commit is contained in:
suyao
2025-06-03 18:17:14 +08:00
parent 58253a210d
commit af37568ec4
+2 -2
View File
@@ -278,7 +278,7 @@ class FileStorage {
}
}
public saveBase64Image = async (_: Electron.IpcMainInvokeEvent, base64Data: string): Promise<FileType> => {
public saveBase64Image = async (_: Electron.IpcMainInvokeEvent, base64Data: string): Promise<FileMetadata> => {
try {
if (!base64Data) {
throw new Error('Base64 data is required')
@@ -304,7 +304,7 @@ class FileStorage {
await fs.promises.writeFile(destPath, buffer)
const fileMetadata: FileType = {
const fileMetadata: FileMetadata = {
id: uuid,
origin_name: uuid + ext,
name: uuid + ext,