# IDocMiddlewareContext

## Content

# Interface: IDocMiddlewareContext<S, T\>

Defines the context for document middleware operations.

## Type parameters

| Name |
| :------ |
| `S` |
| `T` |

## Table of contents

### Properties

- [afterWrite](IDocMiddlewareContext#afterwrite)
- [apply](IDocMiddlewareContext#apply)
- [commit](IDocMiddlewareContext#commit)
- [readOp](IDocMiddlewareContext#readop)
- [readSnapshots](IDocMiddlewareContext#readsnapshots)
- [receive](IDocMiddlewareContext#receive)
- [reply](IDocMiddlewareContext#reply)
- [submit](IDocMiddlewareContext#submit)

## Properties

### <a id="afterwrite" name="afterwrite"></a> afterWrite

• **afterWrite**: [`IDocSubmitMiddlewareContext`](IDocSubmitMiddlewareContext)<`S`, `T`\>

Context for after an operation has been successfully written to the database.

___

### <a id="apply" name="apply"></a> apply

• **apply**: [`IDocSubmitMiddlewareContext`](IDocSubmitMiddlewareContext)<`S`, `T`\>

Context for applying an operation to the snapshot.

___

### <a id="commit" name="commit"></a> commit

• **commit**: [`IDocSubmitMiddlewareContext`](IDocSubmitMiddlewareContext)<`S`, `T`\>

Context for preparing an operation to be committed to the database.

___

### <a id="readop" name="readop"></a> readOp

• **readOp**: [`IDocReadOpMiddlewareContext`](IDocReadOpMiddlewareContext)<`T`\>

Context for when an operation is loaded from the database.

___

### <a id="readsnapshots" name="readsnapshots"></a> readSnapshots

• **readSnapshots**: [`IDocReadSnapshotsMiddlewareContext`](IDocReadSnapshotsMiddlewareContext)<`S`\>

Context for when one or more snapshots are loaded from the database for fetch or subscribe operations.

___

### <a id="receive" name="receive"></a> receive

• **receive**: [`IDocReceiveMiddlewareContext`](IDocReceiveMiddlewareContext)<`T`\>

Context for when the document receives a message from a client.

___

### <a id="reply" name="reply"></a> reply

• **reply**: [`IDocReplyMiddlewareContext`](IDocReplyMiddlewareContext)<`S`, `T`\>

Context for when the document is about to send a non-error reply to a client message.

___

### <a id="submit" name="submit"></a> submit

• **submit**: [`IDocSubmitMiddlewareContext`](IDocSubmitMiddlewareContext)<`S`, `T`\>

Context for initiating the submission of an operation.
