Skip to content

Commit 298c6c3

Browse files
authored
fix(types): export minimal types for the OAuthApp class (#526)
This resolves issues in consumers of this package getting errors from TypeScript ``` The inferred type of 'OAuthApp' cannot be named without a reference to '../node_modules/@octokit/oauth-app/dist-types/methods/check-token.js'. This is likely not portable. A type annotation is necessary. ```
1 parent 0cbef37 commit 298c6c3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/index.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,27 @@ export { sendResponse as sendNodeResponse } from "./middleware/node/send-respons
6767
export { createWebWorkerHandler } from "./middleware/web-worker/index.js";
6868
export { createAWSLambdaAPIGatewayV2Handler } from "./middleware/aws-lambda/api-gateway-v2.js";
6969

70+
// Export types required for the OAuthApp class
71+
// This is in order to fix TypeScript errors in downstream projects:
72+
// The inferred type of 'OAuthApp' cannot be named without a reference to '../node_modules/@octokit/oauth-app/dist-types/{filename}.js'. This is likely not portable. A type annotation is necessary.
73+
export type { GetUserOctokitWithStateInterface } from "./methods/get-user-octokit.js";
74+
export type { GetWebFlowAuthorizationUrlInterface } from "./methods/get-web-flow-authorization-url.js";
75+
export type { CreateTokenInterface } from "./methods/create-token.js";
76+
export type { CheckTokenInterface } from "./methods/check-token.js";
77+
export type { ResetTokenInterface } from "./methods/reset-token.js";
78+
export type { RefreshTokenInterface } from "./methods/refresh-token.js";
79+
export type { ScopeTokenInterface } from "./methods/scope-token.js";
80+
export type { DeleteTokenInterface } from "./methods/delete-token.js";
81+
export type { DeleteAuthorizationInterface } from "./methods/delete-authorization.js";
82+
export type {
83+
AddEventHandler,
84+
ClientType,
85+
ClientTypeFromOptions,
86+
ConstructorOptions,
87+
OctokitTypeFromOptions,
88+
Options,
89+
} from "./types.js";
90+
7091
type Constructor<T> = new (...args: any[]) => T;
7192

7293
export class OAuthApp<

0 commit comments

Comments
 (0)