# StreamDecoder

Source: /tuil/docs/reference/packages/streaming/api/stream-decoder
Locale: en

interface exported by @mwillbanks/tuil-streaming.



{/* Generated by tooling/docs/generate-reference.ts. */}

## interface [#interface]

Public interface exported by `@mwillbanks/tuil-streaming`.

```ts
export interface StreamDecoder {
  readonly id: string;
  write(chunk: Uint8Array | string): string;
  flush(): string;
  reset(): void;
}
```

## Members [#members]

| Member  | Type                                      | Required | Description                                                                     | Related types |
| ------- | ----------------------------------------- | -------- | ------------------------------------------------------------------------------- | ------------- |
| `id`    | `string`                                  | Yes      | The `id` member uses the `string` contract.                                     | —             |
| `write` | `(chunk: Uint8Array \| string) => string` | Yes      | The `write` member uses the `(chunk: Uint8Array \| string) => string` contract. | —             |
| `flush` | `() => string`                            | Yes      | The `flush` member uses the `() => string` contract.                            | —             |
| `reset` | `() => void`                              | Yes      | The `reset` member uses the `() => void` contract.                              | —             |

## Parameters [#parameters]

This declaration has no public members.

## Returns [#returns]

This declaration does not return a value.

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

No package-local related types.

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/streaming/src/index.ts)

## Package [#package]

[@mwillbanks/tuil-streaming](/tuil/docs/reference/packages/streaming)
