Skip to content

Commit 3ddd79e

Browse files
committed
fix: add explicit type anotation
1 parent aed67c2 commit 3ddd79e

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/index.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
import { Octokit as Core } from "@octokit/core";
22
import { requestLog } from "@octokit/plugin-request-log";
3-
import { paginateRest } from "@octokit/plugin-paginate-rest";
3+
import {
4+
paginateRest,
5+
type PaginateInterface,
6+
} from "@octokit/plugin-paginate-rest";
47
import { legacyRestEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
58
export type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
69

710
import { VERSION } from "./version.js";
811

9-
export const Octokit = Core.plugin(
10-
requestLog,
11-
legacyRestEndpointMethods,
12-
paginateRest,
13-
).defaults({
14-
userAgent: `octokit-rest.js/${VERSION}`,
15-
});
12+
type Constructor<T> = new (...args: any[]) => T;
13+
14+
export const Octokit: typeof Core &
15+
Constructor<
16+
ReturnType<typeof legacyRestEndpointMethods> & {
17+
paginate: PaginateInterface;
18+
}
19+
> = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults(
20+
{
21+
userAgent: `octokit-rest.js/${VERSION}`,
22+
},
23+
);
1624

1725
export type Octokit = InstanceType<typeof Octokit>;

0 commit comments

Comments
 (0)