Skip to content

Commit c4147c9

Browse files
authoredOct 21, 2023
fix(types): export ThrottlingOptions (#631)
1 parent 9a61d13 commit c4147c9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
 

‎src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,5 @@ declare module "@octokit/core/dist-types/types.d" {
181181
throttle?: ThrottlingOptions;
182182
}
183183
}
184+
185+
export type { ThrottlingOptions };

‎test/exports.test.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { ThrottlingOptions } from "../src";
2+
import type { Octokit } from "@octokit/core";
3+
4+
describe("Exports", function () {
5+
it("Should export ThrottlingOptions", function () {
6+
const options: ThrottlingOptions = {
7+
enabled: true,
8+
onRateLimit: () => {},
9+
onSecondaryRateLimit: () => {},
10+
};
11+
12+
options.enabled = false;
13+
options.onRateLimit(10, {}, {} as Octokit, 0);
14+
options.onSecondaryRateLimit(10, {}, {} as Octokit, 0);
15+
});
16+
});

0 commit comments

Comments
 (0)
Please sign in to comment.