# DequeOptions

Defined in: [packages/deque/src/deque.ts:7](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/deque/src/deque.ts#L7)

The options every deque factory accepts, whatever its storage.

The record is the same for every layout, so a caller can switch layout by changing the factory alone.

## Type Parameters

### A

`A`

## Properties

### items?

> `readonly` `optional` **items?**: `Iterable`<`A`, `any`, `any`>

Defined in: [packages/deque/src/deque.ts:13](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/deque/src/deque.ts#L13)

Elements to push at the back, in iteration order, as the deque is built. With [capacity](/reference/knotkit/deque/interfaces/dequeoptions/#capacity), only the last `capacity` of them remain, as if each had been pushed in turn.

***

### capacity?

> `readonly` `optional` **capacity?**: `number`

Defined in: [packages/deque/src/deque.ts:21](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/deque/src/deque.ts#L21)

The most elements the deque holds. A push onto a full deque evicts the element at the opposite end and returns it, which makes a bounded deque a sliding window. Must be `Infinity` or a positive safe integer no larger than [DEQUE_MAX_CAPACITY](/reference/knotkit/deque/variables/deque_max_capacity/). Omit it, or pass `Infinity`, for a deque that grows without bound; that is the value [Deque.capacity](/reference/knotkit/deque/interfaces/deque/#capacity) reports.
