From a789a6ffc30f5b27c464d1a4c165d8b4c1d64b9b Mon Sep 17 00:00:00 2001 From: wolfy1339 <4595477+wolfy1339@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:16:38 -0400 Subject: [PATCH] fix(types): export `paginateGraphQLInterface` (#200) 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. ``` --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index df45172..5d2dd77 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 & { iterator: ReturnType;