Skip to content

Commit

Permalink
fix(types): export paginateGraphQLInterface (#200)
Browse files Browse the repository at this point in the history
This resolves issues in consumers of this package getting errors from TypeScript

```
The inferred type of 'Octokit' cannot be named without a reference to '@octokit/core/node_modules/@octokit/graphql/types'. This is likely not portable. A type annotation is necessary.
```
  • Loading branch information
wolfy1339 authored Apr 30, 2024
1 parent 193a9f1 commit a789a6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { createPaginate } from "./paginate.js";
export type { PageInfoForward, PageInfoBackward } from "./page-info.js";
export { VERSION } from "./version.js";

type paginateGraphQLInterface = {
// Export the paginateGraphQLInterface type in order to fix TypeScript errors in downstream projects
// The inferred type of 'Octokit' cannot be named without a reference to '@octokit/core/node_modules/@octokit/graphql/types'. This is likely not portable. A type annotation is necessary.
export type paginateGraphQLInterface = {
graphql: Octokit["graphql"] & {
paginate: ReturnType<typeof createPaginate> & {
iterator: ReturnType<typeof createIterator>;
Expand Down

0 comments on commit a789a6f

Please # to comment.