import type { EndpointOutput } from "@sveltejs/kit" ; import { ServerRequest } from "@sveltejs/kit/types/hooks" ; import type { Auth } from "../auth" ; import type { CallbackResult } from "../types" ; export interface ProviderConfig { id ? : string ; profile ? : ( profile : any , account : any ) => any | Promise < any > ; } export abstract class Provider < T extends ProviderConfig = ProviderConfig > { id : string ; constructor ( protected readonly config ) { this . id = config . id ! ; } getUri ( svelteKitAuth , path , host ? ) { return svelteKitAuth . getUrl ( path , host ) ; } getCallbackUri ( svelteKitAuth , host ? ) { return this . getUri ( svelteKitAuth , `${ "/callback/" }${ this . id }` , host ) ; } getSigninUri ( svelteKitAuth , host ? ) { return this . getUri ( svelteKitAuth , `${ "/signin/" }${ this . id }` , host ) ; } abstract signin < Locals extends Record < string , any > = Record < string , any > , Body = unknown > ( request , svelteKitAuth ) ; abstract callback < Locals extends Record < string , any > = Record < string , any > , Body = unknown > ( request , svelteKitAuth ) ; }