still working on saving files
This commit is contained in:
parent
e363ee1844
commit
c96348e888
6 changed files with 67 additions and 54 deletions
|
@ -11,6 +11,8 @@ export interface FileEntry {
|
|||
id: string;
|
||||
kind: 'file';
|
||||
meta: File;
|
||||
handle: FileSystemFileHandle;
|
||||
directory: FileSystemDirectoryHandle;
|
||||
}
|
||||
|
||||
export interface FolderEntry {
|
||||
|
@ -37,7 +39,7 @@ export async function* walk(directory: FileSystemDirectoryHandle, filters: RegEx
|
|||
const id = await handle.getUniqueId();
|
||||
|
||||
if (handle.kind === 'file') {
|
||||
yield { name: handle.name, id, kind: 'file', meta: await handle.getFile() };
|
||||
yield { name: handle.name, id, kind: 'file', meta: await handle.getFile(), handle, directory };
|
||||
}
|
||||
else {
|
||||
yield { name: handle.name, id, kind: 'folder', entries: await Array.fromAsync(walk(handle, filters, depth + 1)) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue