mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-07 08:24:27 +00:00
Refactor uploadFile to support multiple file uploads and update related types and handlers
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user