Emmm Monster
4 years ago
No known key found for this signature in database
GPG Key ID: C98279C83FB50DB9
2 changed files with
11 additions and
4 deletions
-
src/shims-fs.d.ts
-
src/view/Home.vue
|
@ -6,6 +6,10 @@ interface FileSystemCreateWritableOptions { |
|
|
keepExistingData?: boolean |
|
|
keepExistingData?: boolean |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface FileSystemRemoveOptions { |
|
|
|
|
|
recursive?: boolean |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
interface FileSystemFileHandle { |
|
|
interface FileSystemFileHandle { |
|
|
getFile(): Promise<File>; |
|
|
getFile(): Promise<File>; |
|
|
|
|
|
|
|
@ -37,13 +41,16 @@ interface FileSystemWritableFileStream extends WritableStream { |
|
|
close(): Promise<undefined> // should be implemented in WritableStream
|
|
|
close(): Promise<undefined> // should be implemented in WritableStream
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare interface FileSystemDirectoryHandle { |
|
|
export declare interface FileSystemDirectoryHandle { |
|
|
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle> |
|
|
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle> |
|
|
|
|
|
|
|
|
|
|
|
removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<undefined> |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
declare global { |
|
|
declare global { |
|
|
interface Window { |
|
|
interface Window { |
|
|
FileSystemDirectoryHandle |
|
|
|
|
|
|
|
|
|
|
|
showDirectoryPicker?(): Promise<FileSystemDirectoryHandle> |
|
|
showDirectoryPicker?(): Promise<FileSystemDirectoryHandle> |
|
|
} |
|
|
} |
|
|
|
@ -144,9 +144,9 @@ export default { |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
this.dir = await window.showDirectoryPicker() |
|
|
this.dir = await window.showDirectoryPicker() |
|
|
window.dir = this.dir |
|
|
const test_filename = "__unlock_music_write_test.txt" |
|
|
window.f = await this.dir.getFileHandle("write-test.txt", {create: true}) |
|
|
await this.dir.getFileHandle(test_filename, {create: true}) |
|
|
|
|
|
await this.dir.removeEntry(test_filename) |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
console.error(e) |
|
|
console.error(e) |
|
|
} |
|
|
} |
|
|