Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
typealias ErrorCallback = (err: DOMException) -> Unit
Link copied to clipboard
typealias FileCallback = (file: File) -> Unit
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class FileSystem

The File and Directory Entries API interface FileSystem is used to represent a file system. These objects can be obtained from the filesystem property on any file system entry. Some browsers offer additional APIs to create and manage file systems, such as Chrome's requestFileSystem() method.

Link copied to clipboard
Link copied to clipboard

The FileSystemDirectoryEntry interface of the File and Directory Entries API represents a directory in a file system. It provides methods which make it possible to access and manipulate the files in a directory, as well as to access the entries within the directory.

Link copied to clipboard

The FileSystemDirectoryHandle interface of the File System API provides a handle to a file system directory. Available only in secure contexts.

Link copied to clipboard

The FileSystemDirectoryReader interface of the File and Directory Entries API lets you access the FileSystemFileEntry-based objects (generally FileSystemFileEntry or FileSystemDirectoryEntry) representing each entry in a directory.

Link copied to clipboard
open class FileSystemEntry

The FileSystemEntry interface of the File and Directory Entries API represents a single entry in a file system. The entry can be a file or a directory (directories are represented by the FileSystemDirectoryEntry interface). It includes methods for working with files—including copying, moving, removing, and reading files—as well as information about a file it points to—including the file name and its path from the root to the entry.

Link copied to clipboard
Link copied to clipboard

The FileSystemFileEntry interface of the File and Directory Entries API represents a file in a file system. It offers properties describing the file's attributes, as well as the file() method, which creates a File object that can be used to read the file.

Link copied to clipboard

The FileSystemFileHandle interface of the File System API represents a handle to a file system entry. The interface is accessed through the window.showOpenFilePicker() method. Available only in secure contexts.

Link copied to clipboard
interface FileSystemFlags
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The FileSystemHandle interface of the File System API is an object which represents a file or directory entry. Multiple handles can represent the same entry. For the most part you do not work with FileSystemHandle directly but rather its child interfaces FileSystemFileHandle and FileSystemDirectoryHandle. Available only in secure contexts.

Link copied to clipboard
sealed interface FileSystemHandleKind
Link copied to clipboard
sealed interface FileSystemPermissionMode
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The FileSystemSyncAccessHandle interface of the File System API represents a synchronous handle to a file system entry. Available only in secure contexts.

Link copied to clipboard

The FileSystemWritableFileStream interface of the File System API is a WritableStream object with additional convenience methods, which operates on a single file on disk. The interface is accessed through the FileSystemFileHandle.createWritable() method. Available only in secure contexts.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed interface StartInDirectory
Link copied to clipboard
Link copied to clipboard
sealed interface WriteCommandType
Link copied to clipboard
interface WriteParams

Properties

Functions

Link copied to clipboard

The createSyncAccessHandle() method of the FileSystemFileHandle interface returns a Promise which resolves to a FileSystemSyncAccessHandle object that can be used to synchronously read from and write to a file. The synchronous nature of this method brings performance advantages, but it is only usable inside dedicated Web Workers for files within the origin private file system.

Link copied to clipboard

The createWritable() method of the FileSystemFileHandle interface creates a FileSystemWritableFileStream that can be used to write to a file. The method returns a Promise which resolves to this created stream.

Link copied to clipboard

The FileSystemFileEntry interface's method file() returns a the directory entry.

Link copied to clipboard
suspend fun FileSystemDirectoryEntry.getDirectory(path: String? = undefined, options: FileSystemFlags = unsafeJso()): FileSystemEntry

The FileSystemDirectoryEntry interface's method getDirectory() returns a somewhere within the directory subtree rooted at the directory on which it's called.

Link copied to clipboard

The getDirectoryHandle() method of the FileSystemDirectoryHandle interface returns a FileSystemDirectoryHandle for a subdirectory with the specified name within the directory handle on which the method is called.

Link copied to clipboard
inline suspend fun FileSystemFileHandle.getFile(): File

The getFile() method of the FileSystemFileHandle interface returns a Promise which resolves to a File object representing the state on disk of the entry represented by the handle.

suspend fun FileSystemDirectoryEntry.getFile(path: String? = undefined, options: FileSystemFlags = unsafeJso()): FileSystemEntry

The FileSystemDirectoryEntry interface's method getFile() returns a within the directory subtree rooted at the directory on which it's called.

Link copied to clipboard

The getFileHandle() method of the FileSystemDirectoryHandle interface returns a FileSystemFileHandle for a file with the specified name, within the directory the method is called.

Link copied to clipboard

The FileSystemEntry interface's method getParent() obtains a ``js-nolint getParent(successCallback, errorCallback) getParent(successCallback) `` - successCallback - : A function which is called when the parent directory entry has been retrieved.

Link copied to clipboard

The isSameEntry() method of the FileSystemHandle interface compares two handles to see if the associated entries (either a file or directory) match.

Link copied to clipboard
Link copied to clipboard
inline suspend fun FileSystemDirectoryHandle.removeEntry(name: String)

The removeEntry() method of the FileSystemDirectoryHandle interface attempts to remove an entry if the directory handle contains a file or directory called the name specified.

Link copied to clipboard
inline suspend fun FileSystemDirectoryHandle.resolve(possibleDescendant: FileSystemHandle): ReadonlyArray<JsString>?

The resolve() method of the FileSystemDirectoryHandle interface returns an Array of directory names from the parent handle to the specified child entry, with the name of the child entry as the last array item.

Link copied to clipboard
inline suspend fun FileSystemWritableFileStream.seek(position: UInt53)

The seek() method of the FileSystemWritableFileStream interface updates the current file cursor offset to the position (in bytes) specified when calling the method.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline suspend fun FileSystemWritableFileStream.truncate(size: UInt53)

The truncate() method of the FileSystemWritableFileStream interface resizes the file associated with the stream to the specified size in bytes.

Link copied to clipboard

The write() method of the FileSystemWritableFileStream interface writes content into the file the method is called on, at the current file cursor offset.