---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/storage/opfs/interfaces/OpfsWritableFileStream.md
description: >-
  Minimal subset of the DOM `FileSystemWritableFileStream` interface used by the
  OPFS battery's main-thread write path.
---

# Interface: OpfsWritableFileStream

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

Minimal subset of the DOM `FileSystemWritableFileStream` interface used by the OPFS battery's
main-thread write path.

## Methods

### close()

```ts
close(): Promise<void>;
```

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

#### Returns

`Promise`<`void`>

***

### write()

```ts
write(data:
  | string
  | ArrayBuffer
  | Uint8Array<ArrayBufferLike>
| ArrayBufferView<ArrayBufferLike>): Promise<void>;
```

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

#### Parameters

| Parameter | Type                                                                                                        |
| --------- | ----------------------------------------------------------------------------------------------------------- |
| `data`    | | `string` | `ArrayBuffer` | `Uint8Array`<`ArrayBufferLike`> | `ArrayBufferView`<`ArrayBufferLike`> |

#### Returns

`Promise`<`void`>
