UNPKG

opfs-tools

Version:

EN: A simple, high-performance, and comprehensive file system API running in the browser, built on [OPFS](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system).

12 lines (11 loc) 609 B
import { FileSystemSyncAccessHandle } from './common'; export type OPFSWorkerAccessHandle = { read: (offset: number, size: number) => Promise<ArrayBuffer>; write: FileSystemSyncAccessHandle['write']; close: FileSystemSyncAccessHandle['close']; truncate: FileSystemSyncAccessHandle['truncate']; getSize: FileSystemSyncAccessHandle['getSize']; flush: FileSystemSyncAccessHandle['flush']; }; export type OpenMode = 'read-only' | 'readwrite' | 'readwrite-unsafe'; export declare function createOPFSAccess(fileId: number, filePath: string, mode: OpenMode): Promise<OPFSWorkerAccessHandle>;