Skip to content

Commit 424cdeb

Browse files
authored
fix: fix FileWithPath inheritance and close #12
This should fix conflicts with Electron where they modify File and there's no way in Typescript to force File to be imported from 'dom'. Since typescript is structural this should work just fine.
1 parent d66c563 commit 424cdeb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/file.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ export function toFileWithPath(file: FileWithPath, path?: string): FileWithPath
3737
return f;
3838
}
3939

40-
export interface FileWithPath extends File {
40+
interface DOMFile extends Blob {
41+
readonly lastModified: number;
42+
readonly name: string;
43+
}
44+
45+
export interface FileWithPath extends DOMFile {
4146
readonly path?: string;
4247
}
4348

0 commit comments

Comments
 (0)