import { EventEmitter } from "node:events"; import type { Context, NodeConfig } from "alp-node"; import type { Strategy as Oauth2Strategy } from "../../../strategies/strategies.d"; import type { Account, AccountId, User, UserSanitized } from "../../types"; import type UserAccountsService from "../user/UserAccountsService"; import type { AllowedStrategyKeys, Tokens } from "./types"; export interface GenerateAuthUrlOptions { accessType?: string; grantType?: string; includeGrantedScopes?: boolean; loginHint?: string; prompt?: string; redirectUri?: string; scope?: string; state?: string; } export interface GetTokensOptions { code: string; redirectUri: string; } export type Strategies = Record>; export interface AccessResponseHooks { afterLoginSuccess?: (strategy: StrategyKey, loggedInUser: U) => Promise | void; afterScopeUpdate?: (strategy: StrategyKey, scopeKey: string, account: Account, user: U) => Promise | void; } export declare class AuthenticationService extends EventEmitter { config: NodeConfig; strategies: Strategies; userAccountsService: UserAccountsService; constructor(config: NodeConfig, strategies: Strategies, userAccountsService: UserAccountsService); generateAuthUrl(strategy: T, params: any): string; getTokens(strategy: StrategyKeys, options: GetTokensOptions): Promise; refreshToken(strategy: StrategyKeys, tokensParam: { refreshToken: string; }): Promise; redirectUri(ctx: Context, strategy: string): string; redirectAuthUrl(ctx: Context, strategy: StrategyKeys, { refreshToken, scopeKey, user, accountId, }: { refreshToken?: string | undefined; scopeKey?: string | undefined; user?: U; accountId?: AccountId; }, params?: any): Promise; accessResponse(ctx: Context, strategy: StrategyKey, isLoggedIn: boolean, hooks: AccessResponseHooks): Promise; refreshAccountTokens(user: U, account: Account): Promise; } //# sourceMappingURL=AuthenticationService.d.ts.map