import type { EndpointOutput } from "@sveltejs/kit/types/endpoint"; import { RequestEvent } from "@sveltejs/kit/types/hooks"; import type { Auth } from "../auth"; 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(event: RequestEvent, auth: Auth, state: string, nonce: string): string | Promise; abstract getTokens(code: string, redirectUri: string): TokensType | Promise; abstract getUserProfile(tokens: any): ProfileType | Promise; signin(event: RequestEvent, auth: Auth): Promise; getStateValue(query: URLSearchParams, name: string): string | undefined; callback(event: RequestEvent, auth: Auth): Promise; }