Defined in: packages/rate-limit/src/rate-limit.ts:153
The options a token-bucket accepts: RateLimiterOptions plus the weight it regains.
Extends
Section titled “Extends”Properties
Section titled “Properties”capacity
Section titled “capacity”
readonlycapacity:number
Defined in: packages/rate-limit/src/rate-limit.ts:142
The most weight one instant can admit from a fresh state. A positive safe integer.
Inherited from
Section titled “Inherited from”windowDuration
Section titled “windowDuration”
readonlywindowDuration:number
Defined in: packages/rate-limit/src/rate-limit.ts:147
The width of the kind’s trailing window, in the milliseconds of clock. A positive safe integer.
Inherited from
Section titled “Inherited from”RateLimiterOptions.windowDuration
readonlyclock:Clock
Defined in: packages/rate-limit/src/rate-limit.ts:149
The time source the meter reads through, injected so a test replays every decision.
Inherited from
Section titled “Inherited from”refillAmount
Section titled “refillAmount”
readonlyrefillAmount:number
Defined in: packages/rate-limit/src/rate-limit.ts:159
The weight the bucket regains over one RateLimiterOptions.windowDuration.
A positive safe integer; a steady trickle of requests settles at one
refillAmount per window.