import type { Auth } from "../auth"; import type { CallbackResult } from "../types"; import { Provider, ProviderConfig } from "./base"; export interface OAuth2Tokens { access_token: string; token_type: string; } export declare type ProfileCallback = (profile: ProfileType, tokens: TokensType) => ReturnType | Promise; export interface OAuth2BaseProviderConfig extends ProviderConfig { profile?: ProfileCallback; } export declare abstract class OAuth2BaseProvider extends Provider { abstract getAuthorizationUrl(request: any, auth: Auth, state: string, nonce: string): string | Promise; abstract getTokens(code: string, redirectUri: string): TokensType | Promise; abstract getUserProfile(tokens: any): ProfileType | Promise; signin(request: any, auth: Auth): Promise; getStateValue(query: URLSearchParams, name: string): string | undefined; callback({ query, host }: any, auth: Auth): Promise; }