import type { OctokitResponse, RequestInterface } from "@octokit/types"; import type { OAuthAppAuthentication, GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithExpirationDisabled, GitHubAppAuthenticationWithRefreshToken, OAuthAppCreateTokenResponseData, GitHubAppCreateTokenResponseData, GitHubAppCreateTokenWithExpirationResponseData } from "./types"; export type ExchangeWebFlowCodeOAuthAppOptions = { clientType: "oauth-app"; clientId: string; clientSecret: string; code: string; redirectUrl?: string; request?: RequestInterface; }; export type ExchangeWebFlowCodeGitHubAppOptions = { clientType: "github-app"; clientId: string; clientSecret: string; code: string; redirectUrl?: string; request?: RequestInterface; }; export type ExchangeWebFlowCodeOAuthAppResponse = OctokitResponse & { authentication: OAuthAppAuthentication; }; export type ExchangeWebFlowCodeGitHubAppResponse = OctokitResponse & { authentication: GitHubAppAuthenticationWithExpirationEnabled | GitHubAppAuthenticationWithExpirationDisabled | GitHubAppAuthenticationWithRefreshToken; }; /** * Exchange the code from GitHub's OAuth Web flow for OAuth Apps. */ export declare function exchangeWebFlowCode(options: ExchangeWebFlowCodeOAuthAppOptions): Promise; /** * Exchange the code from GitHub's OAuth Web flow for GitHub Apps. Note that `scopes` are not supported by GitHub Apps. */ export declare function exchangeWebFlowCode(options: ExchangeWebFlowCodeGitHubAppOptions): Promise;