# RateLimiterOptions

Defined in: [packages/rate-limit/src/rate-limit.ts:137](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/rate-limit/src/rate-limit.ts#L137)

The options every built-in rate limiter accepts, whatever its kind.

The record is the same for three of the four kinds, so a caller can switch algorithm by changing the factory alone. Quantities are exact: a construction whose largest intermediate product would exceed `Number.MAX_SAFE_INTEGER` is rejected rather than approximated.

## Extended by

* [`TokenBucketOptions`](/reference/knotkit/rate-limit/interfaces/tokenbucketoptions/)

## Properties

### capacity

> `readonly` **capacity**: `number`

Defined in: [packages/rate-limit/src/rate-limit.ts:142](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/rate-limit/src/rate-limit.ts#L142)

The most weight one instant can admit from a fresh state. A positive safe integer.

***

### windowDuration

> `readonly` **windowDuration**: `number`

Defined in: [packages/rate-limit/src/rate-limit.ts:147](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/rate-limit/src/rate-limit.ts#L147)

The width of the kind’s trailing window, in the milliseconds of [clock](/reference/knotkit/rate-limit/interfaces/ratelimiteroptions/#clock). A positive safe integer.

***

### clock

> `readonly` **clock**: [`Clock`](/reference/knotkit/cache/type-aliases/clock/)

Defined in: [packages/rate-limit/src/rate-limit.ts:149](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/rate-limit/src/rate-limit.ts#L149)

The time source the meter reads through, injected so a test replays every decision.
