Skip to content

CapacitorAdapterFs

Unofficial

File system adapter for Capacitor (mobile) platform.

Import:

import type { CapacitorAdapterFs } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface CapacitorAdapterFs

Constructor

new CapacitorAdapterFs(dir: string)

Constructor.

To extract the constructor type, use ExtractConstructor<CapacitorAdapterFs>.

Properties

PropertyTypeDescription
dirnull | stringBase directory path for the file system, or null if not initialized.
uristringBase URI for the file system.

Methods

MethodReturnsDescription
append(realPath, data)Promise<void>Append text data to a file.
copy(realPath, newRealPath)Promise<void>Copy a file to a new path.
delete(realPath)Promise<void>Delete a file at the given path.
exists(realPath)Promise<boolean>Check whether a file exists at the given path.
getNativeUri(realPath)stringGet the native platform URI for a file path.
getUri(realPath)stringGet the URI for a file path.
init()Promise<void>Initialize the file system adapter.
mkdir(realPath)Promise<void>Create a directory at the given path.
open(realPath)Promise<void>Open a file using the native platform handler.
read(realPath)Promise<string>Read a file as text.
readBinary(realPath)Promise<ArrayBuffer>Read a file as binary data.
readdir(realPath)Promise<CapacitorFileEntry[]>List entries in a directory.
rename(realPath, newRealPath)Promise<void>Rename or move a file to a new path.
rmdir(realPath)Promise<void>Remove a directory.
setTimes(realPath, ctime, mtime)Promise<void>Set the creation and modification times for a file.
stat(realPath)Promise<CapacitorFileEntry>Get file statistics for the given path.
trash(realPath)Promise<void>Move a file to the system trash.
verifyIcloud(realPath)Promise<void>Verify and download an iCloud file if it is not yet available locally.
watch(realPath)Promise<void>Start watching a path for file system changes.
watchAndStatAll(realPath)Promise<WatchAndStatAllResult>Watch a path and return stat information for all contained files.
write(realPath, data)Promise<void>Write text data to a file.
writeBinary(realPath, data)Promise<void>Write binary data to a file.
writeBinaryInternal(realPath, data)Promise<void>Write binary data to a file using the internal storage path.

Links to this page: