Refactor uploadFile to support multiple file uploads and update related types and handlers

This commit is contained in:
2025-07-12 14:25:03 +02:00
parent 51c6f62c44
commit ff4d1de2b7
4 changed files with 105 additions and 56 deletions

View File

@@ -98,6 +98,24 @@ export function isSaveFileResponse(obj: unknown): obj is SaveFileResponse {
);
}
export interface UploadFilesResponse {
filePaths: string[];
}
export function isUploadFilesResponse(
obj: unknown
): obj is UploadFilesResponse {
return (
typeof obj === 'object' &&
obj !== null &&
'filePaths' in obj &&
Array.isArray((obj as UploadFilesResponse).filePaths) &&
(obj as UploadFilesResponse).filePaths.every(
(path) => typeof path === 'string'
)
);
}
export interface UpdateLastOpenedFileRequest {
filePath: string;
}