Skip to content
1 min read · 232 words

Interface: OpfsDirectoryHandle

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

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

Properties

PropertyModifierTypeDescriptionDefined in
kindreadonly"directory"Discriminant: always 'directory'.src/batteries/storage/opfs/index.ts:92
namereadonlystringThe directory's name.src/batteries/storage/opfs/index.ts:94

Methods

getDirectoryHandle()

ts
getDirectoryHandle(name: string, options?: {
  create?: boolean;
}): Promise<OpfsDirectoryHandle>;

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

Resolve a child directory handle, optionally creating it.

Parameters

ParameterType
namestring
options?{ create?: boolean; }
options.create?boolean

Returns

Promise<OpfsDirectoryHandle>


getFileHandle()

ts
getFileHandle(name: string, options?: {
  create?: boolean;
}): Promise<OpfsFileHandle>;

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

Resolve a child file handle, optionally creating it.

Parameters

ParameterType
namestring
options?{ create?: boolean; }
options.create?boolean

Returns

Promise<OpfsFileHandle>


removeEntry()

ts
removeEntry(name: string, options?: {
  recursive?: boolean;
}): Promise<void>;

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

Remove a child entry, optionally recursively.

Parameters

ParameterType
namestring
options?{ recursive?: boolean; }
options.recursive?boolean

Returns

Promise<void>