Skip to content

Commit 703ebf8

Browse files
authored
fix(types): export Api (#740)
This resolves issues in consumers of this package getting errors from TypeScript ``` The inferred type of 'Octokit' cannot be named without a reference to '../node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.js'. This is likely not portable. A type annotation is necessary. ```
1 parent 3263f2d commit 703ebf8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { VERSION } from "./version.js";
55
import type { Api } from "./types.js";
66
import { endpointsToMethods } from "./endpoints-to-methods.js";
77

8+
// Export the type for downstream users in order to fix a TypeScript error
9+
// The inferred type of 'Octokit' cannot be named without a reference to '../node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.js'. This is likely not portable. A type annotation is necessary.
10+
export type { Api };
11+
812
export function restEndpointMethods(octokit: Octokit): Api {
913
const api = endpointsToMethods(octokit);
1014
return {

0 commit comments

Comments
 (0)