(key: string)
| 24 | |
| 25 | // Load a file handle by key |
| 26 | export async function loadHandle(key: string): Promise<FileSystemFileHandle> { |
| 27 | const result = await db.handles.get(key); |
| 28 | if (result?.handle instanceof FileSystemFileHandle) { |
| 29 | return result.handle; |
| 30 | } else { |
| 31 | throw new Error("Handle not found or invalid"); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // Delete a file handle by key |
| 36 | export async function deleteHandle(key: string): Promise<void> { |