> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interface: OccurrenceWriter

> Not exported: an exported type refers to it.

[server](https://docs.bijection.com/api/modules/server).OccurrenceWriter

Not exported: an exported type refers to it.

## Hierarchy

* [`OccurrenceReader`](https://docs.bijection.com/api/interfaces/server.OccurrenceReader)

  ↳ **`OccurrenceWriter`**

## Methods

### payload

▸ **payload**(): `Promise`\<`string`>

The exact verified JSON the provider sent, byte for byte.

It is returned as a string and parsed by the handler, so provider integers
and decimals never pass through a host float on the way in.

#### Returns

`Promise`\<`string`>

#### Inherited from

[OccurrenceReader](https://docs.bijection.com/api/interfaces/server.OccurrenceReader.md).[payload](https://docs.bijection.com/api/interfaces/server.OccurrenceReader.md#payload)

***

### readFile

▸ **readFile**(`part`, `range`): `Promise`\<`ArrayBuffer`>

Read a private email part from this occurrence. Each range is at most
256 KiB and shares ordinary transaction file-read limits. Part names
come from the retained manifest; file IDs and URLs grant no authority.

#### Parameters

| Name | Type |
| :- | :- |
| `part` | `string` |
| `range` | `Object` |
| `range.offset` | `number` |
| `range.length` | `number` |

#### Returns

`Promise`\<`ArrayBuffer`>

#### Inherited from

[OccurrenceReader](https://docs.bijection.com/api/interfaces/server.OccurrenceReader.md).readFile

***

### read

▸ **read**\<`V`>(`validator`): `Promise`\<[`Infer`](https://docs.bijection.com/api/modules/values#infer)\<`V`>>

Validate the retained JSON in the host and return its declared type.
Validation happens during processing, after durable intake. Use payload()
when provider decimal or large integer spelling must remain exact.

#### Type parameters

| Name | Type |
| :- | :- |
| `V` | extends [`GenericValidator`](https://docs.bijection.com/api/modules/values#genericvalidator) |

#### Parameters

| Name | Type |
| :- | :- |
| `validator` | `V` |

#### Returns

`Promise`\<[`Infer`](https://docs.bijection.com/api/modules/values#infer)\<`V`>>

#### Inherited from

[OccurrenceReader](https://docs.bijection.com/api/interfaces/server.OccurrenceReader.md).[read](https://docs.bijection.com/api/interfaces/server.OccurrenceReader.md#read)

***

### grantFile

▸ **grantFile**(`part`, `options`): `Promise`\<[`FileRef`](https://docs.bijection.com/api/modules/values#fileref)>

#### Parameters

| Name | Type |
| :- | :- |
| `part` | `string` |
| `options` | `Object` |
| `options.holder` | `object` |
| `options.key` | `string` |
| `options.format` | `string` |
| `options.expires_at` | `number` |

#### Returns

`Promise`\<[`FileRef`](https://docs.bijection.com/api/modules/values#fileref)>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.