/** * @file OPFS backend for {@link TinyFSCore}. */ import TinyFSCore from '../../index.mjs'; export type OPFSFileSystemOptions = { /** * Custom OPFS root. Defaults to `navigator.storage.getDirectory()`. */ root?: FileSystemDirectoryHandle; }; /** * @typedef {Object} OPFSFileSystemOptions * @property {FileSystemDirectoryHandle} [root] Custom OPFS root. Defaults to `navigator.storage.getDirectory()`. */ /** * Origin Private File System backend. * * OPFS has no symbolic links, no permission bits and no way to set * timestamps. Those operations are emulated by the base class and stored in * memory, so they are lost when the tab is closed. * @beta */ declare class TinyOPFSFileSystem extends TinyFSCore { #private; /** * @param {import('../../index.mjs').FSOptions & OPFSFileSystemOptions} [options] Construction options. */ constructor(options?: import('../../index.mjs').FSOptions & OPFSFileSystemOptions); /** @returns {import('../../index.mjs').FSCapabilities} The capabilities advertised by OPFS. */ static get capabilities(): import('../../index.mjs').FSCapabilities; /** * Resolves the root directory handle used by every operation. * * Backends that store their tree inside a nested location — such as a * storage bucket — override this hook and return the nested directory. * * @protected * @returns {Promise} The OPFS root directory. * @throws {Error} When OPFS is not reachable in the current context. */ protected _resolveRoot(): Promise; /** * @override * @param {string} targetPath Absolute path of the file. * @returns {Promise} The raw file contents. */ _readFile(targetPath: string): Promise; /** * @override * @param {string} targetPath Absolute path of the file. * @param {Uint8Array} bytes Payload to persist. * @param {import('../../index.mjs').TWriteFileOptions} options Write options. * @returns {Promise} Resolves once the payload is committed. */ _writeFile(targetPath: string, bytes: Uint8Array, options: import('../../index.mjs').TWriteFileOptions): Promise; /** * @override * @param {string} targetPath Absolute path of the directory. * @returns {Promise} The directory entries. */ _readdir(targetPath: string): Promise; /** * @override * @param {string} targetPath Absolute path of the directory. * @param {import('../../index.mjs').TMkdirOptions} options Creation options. * @returns {Promise} Resolves once the directory exists. */ _mkdir(targetPath: string, options: import('../../index.mjs').TMkdirOptions): Promise; /** * @override * @param {string} targetPath Absolute path of the entry. * @param {import('../../index.mjs').TRmOptions} options Removal options. * @returns {Promise} Resolves once the entry is gone. */ _rm(targetPath: string, options: import('../../index.mjs').TRmOptions): Promise; /** * @override * @param {string} targetPath Absolute path of the entry. * @returns {Promise} */ _stat(targetPath: string): Promise; /** * @override * @param {string} oldPath Current absolute path. * @param {string} newPath Target absolute path. * @returns {Promise} Resolves once the move is complete. */ _rename(oldPath: string, newPath: string): Promise; /** * @override * @param {string} sourcePath Absolute path of the source file. * @param {string} destinationPath Absolute path of the destination file. * @returns {Promise} Resolves once the copy is complete. */ _copyFile(sourcePath: string, destinationPath: string): Promise; } export default TinyOPFSFileSystem; //# sourceMappingURL=index.d.mts.map