import type { SocialAuthOption } from "../../../../wallets/types.js"; import type { Account } from "../../../interfaces/wallet.js"; import type { ClientScopedStorage } from "../authentication/client-scoped-storage.js"; import type { AuthArgsType, AuthLoginReturnType, AuthStoredTokenWithCookieReturnType, GetUser, LogoutReturnType, MultiStepAuthArgsType, PreAuthArgsType, Profile, SingleStepAuthArgsType, } from "../authentication/types.js"; export interface InAppConnector { getUser(): Promise; getAccount(): Promise; preAuthenticate(args: PreAuthArgsType): Promise; // Authenticate generates an auth token, when redirecting it returns void as the user is redirected to a new page and the token is stored in the callback url authenticateWithRedirect?( strategy: SocialAuthOption, mode?: "redirect" | "popup" | "window", redirectUrl?: string, ): Promise; // Link a profile with redirect mode linkProfileWithRedirect?( strategy: SocialAuthOption, mode?: "redirect" | "window", redirectUrl?: string, ): Promise; // Login takes an auth token and connects a user with it loginWithAuthToken?( authResult: AuthStoredTokenWithCookieReturnType, ): Promise; // Authenticate generates an auth token but does not log the user in authenticate( args: MultiStepAuthArgsType | SingleStepAuthArgsType, ): Promise; // Connect is authenticate + login combined connect( args: MultiStepAuthArgsType | SingleStepAuthArgsType, ): Promise; logout(): Promise; linkProfile(args: AuthArgsType): Promise; unlinkProfile( args: Profile, allowAccountDeletion?: boolean, ): Promise; getProfiles(): Promise; storage: ClientScopedStorage; }