Skip to content
1 min read · 129 words

Interface: OpfsFileHandle

Defined in: src/batteries/storage/opfs/index.ts:72

Minimal subset of the File System AccessOpfsFileHandle interface that this module touches at runtime. Structurally compatible with the DOM-lib OpfsFileHandle — at call sites you pass real OPFS handles directly.

Properties

PropertyModifierTypeDescriptionDefined in
kindreadonly"file"Discriminant: always 'file'.src/batteries/storage/opfs/index.ts:74
namereadonlystringThe entry's name.src/batteries/storage/opfs/index.ts:76

Methods

createWritable()

ts
createWritable(): Promise<OpfsWritableFileStream>;

Defined in: src/batteries/storage/opfs/index.ts:80

Open a writable stream that replaces the file's contents.

Returns

Promise<OpfsWritableFileStream>


getFile()

ts
getFile(): Promise<OpfsFile>;

Defined in: src/batteries/storage/opfs/index.ts:78

Resolve a readable OpfsFile snapshot of the handle's contents.

Returns

Promise<OpfsFile>