import { type Authenticatable } from "../interfaces/authenticatable.interface"; import { type AuthProvider } from "../types/auth-provider"; /** * Emitted after successful authentication. * * @example * ```typescript * @OnEvent('garmr.authenticated') * async handleAuthenticated(event: GarmrAuthenticatedEvent) { * await this.analyticsService.trackLogin(event.entity.id) * console.log(`Authenticated via ${event.provider}`) * } * ``` * * @important Listeners should handle their own errors. * Unhandled errors will result in unhandled promise rejections. */ export declare class GarmrAuthenticatedEvent { readonly entity: T; readonly provider: AuthProvider; static readonly EVENT_NAME = "garmr.authenticated"; /** * @param entity - The authenticated entity * @param provider - The authentication provider that triggered authentication (defaults to "magic-link") */ constructor(entity: T, provider?: AuthProvider); }