Skip to content

Commit

Permalink
fix: add explicit type anotation
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Mar 4, 2024
1 parent aed67c2 commit 3ddd79e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import { Octokit as Core } from "@octokit/core";
import { requestLog } from "@octokit/plugin-request-log";
import { paginateRest } from "@octokit/plugin-paginate-rest";
import {
paginateRest,
type PaginateInterface,
} from "@octokit/plugin-paginate-rest";
import { legacyRestEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
export type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";

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

export const Octokit = Core.plugin(
requestLog,
legacyRestEndpointMethods,
paginateRest,
).defaults({
userAgent: `octokit-rest.js/${VERSION}`,
});
type Constructor<T> = new (...args: any[]) => T;

export const Octokit: typeof Core &
Constructor<
ReturnType<typeof legacyRestEndpointMethods> & {
paginate: PaginateInterface;
}
> = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults(
{
userAgent: `octokit-rest.js/${VERSION}`,
},
);

export type Octokit = InstanceType<typeof Octokit>;

0 comments on commit 3ddd79e

Please sign in to comment.