Skip to main content

Class: RateLimit<K>

ratelimits/src.RateLimit

Type parameters

NameType
Kstring

Constructors

constructor

new RateLimit<K>(manager)

Type parameters

NameType
Kstring

Parameters

NameTypeDescription
managerRateLimitManager<K>

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:22

Properties

expires

expires: number

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:12


manager

Private manager: RateLimitManager<K>

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:17


remaining

remaining: number

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:7

Accessors

expired

get expired(): boolean

Returns

boolean

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:30


limited

get limited(): boolean

Returns

boolean

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:37


remainingTime

get remainingTime(): number

Returns

number

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:44

Methods

consume

consume(): RateLimit<K>

Returns

RateLimit<K>

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:51


reset

reset(): RateLimit<K>

Returns

RateLimit<K>

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:62


resetRemaining

resetRemaining(): RateLimit<K>

Returns

RateLimit<K>

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:69


resetTime

resetTime(): RateLimit<K>

Returns

RateLimit<K>

Defined in

projects/utilities/packages/ratelimits/src/lib/RateLimit.ts:77