---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/storage/opfs/interfaces/OpfsDirectoryHandle.md
description: >-
  Minimal subset of the [File System
  Access](https://developer.mozilla.org/docs/Web/API/File_System_API)
  `OpfsDirectoryHandle` interface that this module touches at runtime.
  Structurally compatible with the DOM-lib `OpfsDirectoryHandle` — at call sites
  you pass real OPFS handles directly.
---

# Interface: OpfsDirectoryHandle

Defined in: [batteries/storage/opfs/index.ts:79](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L79)

Minimal subset of the
[File System Access](https://developer.mozilla.org/docs/Web/API/File_System_API)
`OpfsDirectoryHandle` interface that this module touches at runtime. Structurally
compatible with the DOM-lib `OpfsDirectoryHandle` — at call sites you pass real OPFS
handles directly.

## Properties

| Property                          | Modifier   | Type          | Defined in                                                                                                                    |
| --------------------------------- | ---------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|  `kind` | `readonly` | `"directory"` | [batteries/storage/opfs/index.ts:80](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L80) |
|  `name` | `readonly` | `string`      | [batteries/storage/opfs/index.ts:81](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L81) |

## Methods

### getDirectoryHandle()

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

Defined in: [batteries/storage/opfs/index.ts:83](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L83)

#### Parameters

| Parameter         | Type                        |
| ----------------- | --------------------------- |
| `name`            | `string`                    |
| `options?`        | { `create?`: `boolean`; } |
| `options.create?` | `boolean`                   |

#### Returns

`Promise`<`OpfsDirectoryHandle`>

***

### getFileHandle()

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

Defined in: [batteries/storage/opfs/index.ts:82](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L82)

#### Parameters

| Parameter         | Type                        |
| ----------------- | --------------------------- |
| `name`            | `string`                    |
| `options?`        | { `create?`: `boolean`; } |
| `options.create?` | `boolean`                   |

#### Returns

`Promise`<[`OpfsFileHandle`](OpfsFileHandle.md)>

***

### removeEntry()

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

Defined in: [batteries/storage/opfs/index.ts:84](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L84)

#### Parameters

| Parameter            | Type                           |
| -------------------- | ------------------------------ |
| `name`               | `string`                       |
| `options?`           | { `recursive?`: `boolean`; } |
| `options.recursive?` | `boolean`                      |

#### Returns

`Promise`<`void`>
