Defined in: packages/rate-limit/src/rate-limit.ts:137
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
Section titled “Extended by”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.
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.
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.