I am trying to set the types for a file upload, but I can not believe I have to define every single property on the file object
export type FileProps = {
path: string
lastModified: number
slice: () => void
stream: () => void
text: () => void
arrayBuffer: ArrayBuffer
name: string
size: number
type: string
}
const [files, setFiles] = useState<FileProps[]>([])
I upload a few files and store them on the state, but then when I try to add to the form
const formData = new FormData()
for (const file of files) {
formData.append('files', file)
}
I get an error on file

file.textif that is a string representation of the text of the file. You could also convert theArrayBufferto Blob or use the stream to create the blob.filewith with name, size etc. as I am passing the file to the back end, it works if I turn every type toanybut I get the yellow warning, there must be a better way