Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: typecast file to fix the build (#5410)

Aakansha Doshid05745070bcc
diff --git a/src/data/filesystem.ts b/src/data/filesystem.ts
index 8db365c674..ffe088fafc 100644
--- a/src/data/filesystem.ts
+++ b/src/data/filesystem.ts
@@ -1,5 +1,4 @@
import {
- FileWithHandle,
fileOpen as _fileOpen,
fileSave as _fileSave,
FileSystemHandle,
@@ -26,13 +25,9 @@ export const fileOpen = <M extends boolean | undefined = false>(opts: {
extensions?: FILE_EXTENSION[];
description: string;
multiple?: M;
-}): Promise<
- M extends false | undefined ? FileWithHandle : FileWithHandle[]
-> => {
+}): Promise<M extends false | undefined ? File : File[]> => {
// an unsafe TS hack, alas not much we can do AFAIK
- type RetType = M extends false | undefined
- ? FileWithHandle
- : FileWithHandle[];
+ type RetType = M extends false | undefined ? File : File[];
const mimeTypes = opts.extensions?.reduce((mimeTypes, type) => {
mimeTypes.push(MIME_TYPES[type]);