Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): export minimal types for the OAuthApp class #526

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,27 @@ export { sendResponse as sendNodeResponse } from "./middleware/node/send-respons
export { createWebWorkerHandler } from "./middleware/web-worker/index.js";
export { createAWSLambdaAPIGatewayV2Handler } from "./middleware/aws-lambda/api-gateway-v2.js";

// Export types required for the OAuthApp class
// This is in order to fix TypeScript errors in downstream projects:
// 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.
export type { GetUserOctokitWithStateInterface } from "./methods/get-user-octokit.js";
export type { GetWebFlowAuthorizationUrlInterface } from "./methods/get-web-flow-authorization-url.js";
export type { CreateTokenInterface } from "./methods/create-token.js";
export type { CheckTokenInterface } from "./methods/check-token.js";
export type { ResetTokenInterface } from "./methods/reset-token.js";
export type { RefreshTokenInterface } from "./methods/refresh-token.js";
export type { ScopeTokenInterface } from "./methods/scope-token.js";
export type { DeleteTokenInterface } from "./methods/delete-token.js";
export type { DeleteAuthorizationInterface } from "./methods/delete-authorization.js";
export type {
AddEventHandler,
ClientType,
ClientTypeFromOptions,
ConstructorOptions,
OctokitTypeFromOptions,
Options,
} from "./types.js";

type Constructor<T> = new (...args: any[]) => T;

export class OAuthApp<
Expand Down