Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 6b61354

Browse files
author
williamd5
committed
attempt result interface
1 parent 291f64f commit 6b61354

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

lib/AttemptResult.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

src/AttemptResult.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import {RateLimit} from "./RateLimit";
2+
3+
/**
4+
* The result from a rate limit attempt
5+
* @interface
6+
*/
7+
export interface AttemptResult {
8+
/**
9+
* The number of requests this rate limit allows per time window
10+
*/
11+
limit: number;
12+
13+
/**
14+
* The number of requests remaining in the current time window
15+
*/
16+
remaining: number;
17+
18+
/**
19+
* The number of seconds until the current time window resets
20+
*/
21+
reset: number;
22+
23+
/**
24+
* The rate limit that this attempt was made on
25+
*/
26+
rateLimit: RateLimit;
27+
28+
/**
29+
* Whether this attempt should be allowed to proceed. If false, the attempt is rate limited.
30+
*/
31+
allow: boolean;
32+
}

0 commit comments

Comments
 (0)