Skip to content

VaultAdapter

API reference uses a reviewed source snapshot. Source links open the published source; unverified line locations are omitted.

Defined in: storage/fs.ts:284

Preferred name for the canonical vault file adapter contract.

DataAdapter remains exported for Obsidian API compatibility while the runtime migrates toward the cross-host vault session model.

append(normalizedPath, data, options?): Promise<void>

Defined in: storage/fs.ts:226

string

string

Partial<FileProperties>

Promise<void>

DataAdapter.append


appendBinary(normalizedPath, data, options?): Promise<void>

Defined in: storage/fs.ts:231

string

ArrayBuffer

Partial<FileProperties>

Promise<void>

DataAdapter.appendBinary


optional atomicWrite(normalizedPath, source, options?): Promise<void>

Defined in: storage/fs.ts:303

string

ReadableStream<Uint8Array<ArrayBufferLike>>

AtomicDataWriteOptions

Promise<void>


copy(normalizedPath, normalizedNewPath): Promise<void>

Defined in: storage/fs.ts:261

string

string

Promise<void>

DataAdapter.copy


exists(normalizedPath, sensitive?): Promise<boolean>

Defined in: storage/fs.ts:212

string

boolean

Promise<boolean>

DataAdapter.exists


optional getCapabilities(): Partial<VaultAdapterCapabilities>

Defined in: storage/fs.ts:285

Partial<VaultAdapterCapabilities>


getName(): string

Defined in: storage/fs.ts:211

string

DataAdapter.getName


getResourcePath(normalizedPath): string

Defined in: storage/fs.ts:262

string

string

DataAdapter.getResourcePath


list(normalizedPath): Promise<ListedFiles>

Defined in: storage/fs.ts:253

string

Promise<ListedFiles>

DataAdapter.list


mkdir(normalizedPath, options?): Promise<void>

Defined in: storage/fs.ts:254

string

Partial<{ mode: string; recursive: boolean; }>

Promise<void>

DataAdapter.mkdir


optional openRead(normalizedPath): Promise<VaultReadHandle>

Defined in: storage/fs.ts:302

string

Promise<VaultReadHandle>


process(normalizedPath, fn, options?): Promise<string>

Defined in: storage/fs.ts:248

Atomically read, modify, and save the contents of a plaintext file.

string

Path to file/folder, use normalizePath to normalize beforehand.

(data) => string

A callback function which returns the new content of the file synchronously.

Partial<FileProperties>

Write options.

Promise<string>

String - the text value of the file that was written.

DataAdapter.process


read(normalizedPath): Promise<string>

Defined in: storage/fs.ts:214

string

Promise<string>

DataAdapter.read


readBinary(normalizedPath): Promise<ArrayBuffer>

Defined in: storage/fs.ts:215

string

Promise<ArrayBuffer>

DataAdapter.readBinary


remove(normalizedPath): Promise<void>

Defined in: storage/fs.ts:259

string

Promise<void>

DataAdapter.remove


rename(normalizedPath, normalizedNewPath): Promise<void>

Defined in: storage/fs.ts:260

string

string

Promise<void>

DataAdapter.rename


rmdir(normalizedPath, recursive): Promise<void>

Defined in: storage/fs.ts:258

string

boolean

Promise<void>

DataAdapter.rmdir


stat(normalizedPath): Promise<Stat | null>

Defined in: storage/fs.ts:213

string

Promise<Stat | null>

DataAdapter.stat


trashLocal(normalizedPath): Promise<void>

Defined in: storage/fs.ts:264

string

Promise<void>

DataAdapter.trashLocal


trashSystem(normalizedPath): Promise<boolean>

Defined in: storage/fs.ts:263

string

Promise<boolean>

DataAdapter.trashSystem


write(normalizedPath, data, options?): Promise<void>

Defined in: storage/fs.ts:216

string

string

Partial<FileProperties>

Promise<void>

DataAdapter.write


writeBinary(normalizedPath, data, options?): Promise<void>

Defined in: storage/fs.ts:221

string

ArrayBuffer

Partial<FileProperties>

Promise<void>

DataAdapter.writeBinary


optional writeExclusive(normalizedPath, data, options?): Promise<void>

Defined in: storage/fs.ts:287

Publish new complete bytes without replacing an existing destination.

string

string | ArrayBuffer

Partial<FileProperties>

Promise<void>


optional writeTextIfUnchanged(normalizedPath, data, expected, options?): Promise<void>

Defined in: storage/fs.ts:296

Reject when the file no longer has these exact contents (null means absent).

string

string

string | null

Partial<FileProperties>

Promise<void>